version 1.1.1.1, 2012/02/21 22:14:23
|
version 1.1.1.2, 2013/07/22 11:54:42
|
Line 34
|
Line 34
|
#if (HAVE_CONFIG_H) |
#if (HAVE_CONFIG_H) |
#include "../include/config.h" |
#include "../include/config.h" |
#endif |
#endif |
|
|
#if (!(_WIN32) || (__CYGWIN__)) |
#if (!(_WIN32) || (__CYGWIN__)) |
#include "../include/libnet.h" |
#include "../include/libnet.h" |
#else |
#else |
Line 41
|
Line 42
|
#endif |
#endif |
|
|
libnet_ptag_t |
libnet_ptag_t |
libnet_build_link(u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type, | libnet_build_link(const uint8_t *dst, const uint8_t *src, const uint8_t *oui, uint16_t type, |
u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag) | const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag) |
|
|
{ |
{ |
u_int8_t org[3] = {0x00, 0x00, 0x00}; | uint8_t org[3] = {0x00, 0x00, 0x00}; |
switch (l->link_type) |
switch (l->link_type) |
{ |
{ |
/* add FDDI */ |
/* add FDDI */ |
case DLT_EN10MB: |
case DLT_EN10MB: |
return (libnet_build_ethernet(dst, src, type, payload, payload_s, l, | return libnet_build_ethernet(dst, src, type, payload, payload_s, l, |
ptag)); | ptag); |
case DLT_IEEE802: |
case DLT_IEEE802: |
return (libnet_build_token_ring(LIBNET_TOKEN_RING_FRAME, | return libnet_build_token_ring(LIBNET_TOKEN_RING_FRAME, |
LIBNET_TOKEN_RING_LLC_FRAME, dst, src, LIBNET_SAP_SNAP, |
LIBNET_TOKEN_RING_LLC_FRAME, dst, src, LIBNET_SAP_SNAP, |
LIBNET_SAP_SNAP, 0x03, org, type, payload, payload_s, |
LIBNET_SAP_SNAP, 0x03, org, type, payload, payload_s, |
l, ptag)); | l, ptag); |
default: | |
break; | |
} |
} |
snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, |
snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, |
"%s(): linktype %d not supported\n", __func__, l->link_type); |
"%s(): linktype %d not supported\n", __func__, l->link_type); |
return (-1); | return -1; |
} |
} |
|
|
libnet_ptag_t |
libnet_ptag_t |
libnet_autobuild_link(u_int8_t *dst, u_int8_t *oui, u_int16_t type, libnet_t *l) | libnet_autobuild_link(const uint8_t *dst, const uint8_t *oui, uint16_t type, libnet_t *l) |
{ |
{ |
u_int8_t org[3] = {0x00, 0x00, 0x00}; | uint8_t org[3] = {0x00, 0x00, 0x00}; |
switch (l->link_type) |
switch (l->link_type) |
{ |
{ |
/* add FDDI */ |
/* add FDDI */ |
Line 78 libnet_autobuild_link(u_int8_t *dst, u_int8_t *oui, u_
|
Line 77 libnet_autobuild_link(u_int8_t *dst, u_int8_t *oui, u_
|
return (libnet_autobuild_token_ring(LIBNET_TOKEN_RING_FRAME, |
return (libnet_autobuild_token_ring(LIBNET_TOKEN_RING_FRAME, |
LIBNET_TOKEN_RING_LLC_FRAME, dst, LIBNET_SAP_SNAP, |
LIBNET_TOKEN_RING_LLC_FRAME, dst, LIBNET_SAP_SNAP, |
LIBNET_SAP_SNAP, 0x03, org, TOKEN_RING_TYPE_IP, l)); |
LIBNET_SAP_SNAP, 0x03, org, TOKEN_RING_TYPE_IP, l)); |
default: |
|
break; |
|
} |
} |
snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, |
snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, |
"%s(): linktype %d not supported\n", __func__, l->link_type); |
"%s(): linktype %d not supported\n", __func__, l->link_type); |
return (-1); |
return (-1); |
} |
} |
|
|
/* EOF */ |
|
|
|