--- embedaddon/libnet/src/libnet_link_none.c 2012/02/21 22:14:23 1.1.1.1 +++ embedaddon/libnet/src/libnet_link_none.c 2013/07/22 11:54:42 1.1.1.2 @@ -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.2 2013/07/22 11:54:42 misho Exp $ * * libnet * libnet_none.c - dummy routines for suckers with no link-layer interface @@ -36,31 +36,40 @@ #include "../include/win32/libnet.h" #endif +static void nosupport(libnet_t* l) +{ + snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, + "%s(): no link support on this platform\n", __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 */