--- embedaddon/libnet/src/libnet_link_none.c 2012/02/21 22:14:23 1.1.1.1 +++ embedaddon/libnet/src/libnet_link_none.c 2023/09/27 11:11:38 1.1.1.3 @@ -1,5 +1,5 @@ /* - * $Id: libnet_link_none.c,v 1.1.1.1 2012/02/21 22:14:23 misho Exp $ + * $Id: libnet_link_none.c,v 1.1.1.3 2023/09/27 11:11:38 misho Exp $ * * libnet * libnet_none.c - dummy routines for suckers with no link-layer interface @@ -16,7 +16,7 @@ * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: + * features or use of this software display the following acknowledgment: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse @@ -27,40 +27,48 @@ * 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" +static void nosupport(libnet_t* l) +{ + snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, + "%s(): no link support on this platform", __func__); +} + int libnet_open_link(libnet_t *l) { - return (NULL); + nosupport(l); + return -1; } int libnet_close_link(libnet_t *l) { - return (-1); + nosupport(l); + return -1; } int -libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size) +libnet_write_link(libnet_t *l, const uint8_t *packet, uint32_t size) { - return (-1); + nosupport(l); + return -1; } struct libnet_ether_addr * libnet_get_hwaddr(libnet_t *l) { - return (NULL); + nosupport(l); + return NULL; } -/* EOF */ +/** + * Local Variables: + * indent-tabs-mode: nil + * c-file-style: "stroustrup" + * End: + */