--- embedaddon/libnet/src/libnet_link_nit.c 2012/02/21 22:14:23 1.1.1.1 +++ embedaddon/libnet/src/libnet_link_nit.c 2023/09/27 11:11:38 1.1.1.3 @@ -1,5 +1,5 @@ /* - * $Id: libnet_link_nit.c,v 1.1.1.1 2012/02/21 22:14:23 misho Exp $ + * $Id: libnet_link_nit.c,v 1.1.1.3 2023/09/27 11:11:38 misho Exp $ * * libnet * libnet_nit.c - network interface tap routines @@ -27,14 +27,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#if (HAVE_CONFIG_H) -#include "../include/config.h" -#endif -#if (!(_WIN32) || (__CYGWIN__)) -#include "../include/libnet.h" -#else -#include "../include/win32/libnet.h" -#endif +#include "common.h" #include "../include/gnuc.h" #ifdef HAVE_OS_PROTO_H @@ -59,7 +52,8 @@ libnet_open_link_interface(int8_t *device, int8_t *ebu l->fd = socket(AF_NIT, SOCK_RAW, NITPROTO_RAW); if (l->fd < 0) { - sprintf(ebuf, "socket: %s", strerror(errno)); + snprintf(ebuf, LIBNET_ERRBUF_SIZE, + "socket: %s", strerror(errno)); goto bad; } snit.snit_family = AF_NIT; @@ -68,7 +62,8 @@ libnet_open_link_interface(int8_t *device, int8_t *ebu if (bind(l->fd, (struct sockaddr *)&snit, sizeof(snit))) { - sprintf(ebuf, "bind: %s: %s", snit.snit_ifname, strerror(errno)); + snprintf(ebuf, LIBNET_ERRBUF_SIZE, + "bind: %s: %s", snit.snit_ifname, strerror(errno)); goto bad; } @@ -107,7 +102,7 @@ libnet_close_link_interface(struct libnet_link_int *l) int write_link_layer(struct libnet_link_int *l, const int8_t *device, - u_int8_t *buf, int len) + uint8_t *buf, int len) { int c; struct sockaddr sa; @@ -123,3 +118,9 @@ write_link_layer(struct libnet_link_int *l, const int8 return (c); } +/** + * Local Variables: + * indent-tabs-mode: nil + * c-file-style: "stroustrup" + * End: + */