version 1.1.1.2, 2013/07/22 11:54:42
|
version 1.1.1.3, 2023/09/27 11:11:38
|
Line 31
|
Line 31
|
* This module now handles the STREAMS based NIT. |
* This module now handles the STREAMS based NIT. |
*/ |
*/ |
|
|
#if (HAVE_CONFIG_H) | #include "common.h" |
#include "../include/config.h" | |
#endif | |
#if (!(_WIN32) || (__CYGWIN__)) | |
#include "../include/libnet.h" | |
#else | |
#include "../include/win32/libnet.h" | |
#endif | |
#include "../include/gnuc.h" |
#include "../include/gnuc.h" |
#ifdef HAVE_OS_PROTO_H |
#ifdef HAVE_OS_PROTO_H |
#include "../include/os-proto.h" |
#include "../include/os-proto.h" |
#endif |
#endif |
|
|
|
|
struct libnet_link_int * |
struct libnet_link_int * |
libnet_open_link_interface(int8_t *device, int8_t *ebuf) |
libnet_open_link_interface(int8_t *device, int8_t *ebuf) |
{ |
{ |
Line 65 libnet_open_link_interface(int8_t *device, int8_t *ebu
|
Line 58 libnet_open_link_interface(int8_t *device, int8_t *ebu
|
l->fd = open(dev, O_RDWR); |
l->fd = open(dev, O_RDWR); |
if (l->fd < 0) |
if (l->fd < 0) |
{ |
{ |
sprintf(ebuf, "%s: %s", dev, strerror(errno)); | snprintf(ebuf, LIBNET_ERRBUF_SIZE, |
| "%s: %s", dev, strerror(errno)); |
goto bad; |
goto bad; |
} |
} |
|
|
Line 74 libnet_open_link_interface(int8_t *device, int8_t *ebu
|
Line 68 libnet_open_link_interface(int8_t *device, int8_t *ebu
|
*/ |
*/ |
if (ioctl(l->fd, I_SRDOPT, (int8_t *)RMSGD) < 0) |
if (ioctl(l->fd, I_SRDOPT, (int8_t *)RMSGD) < 0) |
{ |
{ |
sprintf(ebuf, "I_SRDOPT: %s", strerror(errno)); | snprintf(ebuf, LIBNET_ERRBUF_SIZE, |
| "I_SRDOPT: %s", strerror(errno)); |
goto bad; |
goto bad; |
} |
} |
if (ioctl(l->fd, I_PUSH, "nbuf") < 0) |
if (ioctl(l->fd, I_PUSH, "nbuf") < 0) |
{ |
{ |
sprintf(ebuf, "push nbuf: %s", strerror(errno)); | snprintf(ebuf, LIBNET_ERRBUF_SIZE, |
| "push nbuf: %s", strerror(errno)); |
goto bad; |
goto bad; |
} |
} |
/* |
/* |
Line 92 libnet_open_link_interface(int8_t *device, int8_t *ebu
|
Line 88 libnet_open_link_interface(int8_t *device, int8_t *ebu
|
si.ic_dp = (int8_t *)𝔦 |
si.ic_dp = (int8_t *)𝔦 |
if (ioctl(l->fd, I_STR, (int8_t *)&si) < 0) |
if (ioctl(l->fd, I_STR, (int8_t *)&si) < 0) |
{ |
{ |
sprintf(ebuf, "NIOCBIND: %s: %s", ifr.ifr_name, strerror(errno)); | snprintf(ebuf, LIBNET_ERRBUF_SIZE, |
| "NIOCBIND: %s: %s", ifr.ifr_name, strerror(errno)); |
goto bad; |
goto bad; |
} |
} |
|
|
Line 147 libnet_write_link_layer(struct libnet_link_int *l, con
|
Line 144 libnet_write_link_layer(struct libnet_link_int *l, con
|
} |
} |
return (c); |
return (c); |
} |
} |
|
|
|
/** |
|
* Local Variables: |
|
* indent-tabs-mode: nil |
|
* c-file-style: "stroustrup" |
|
* End: |
|
*/ |