Code:
#include <stdio.h>
#include <stdlib.h>
#include <libnet.h>
int
main (int argc, char *argv[])
{
libnet_t *l; /* libnet context */
char errbuf[LIBNET_ERRBUF_SIZE]; /* error messages */
int r; /* generic return value */
char *dev=libnet_getdevice(l);
l = libnet_init (LIBNET_RAW4, dev, errbuf);
if (l == NULL)
{
fprintf (stderr, "Error opening context: %s", errbuf);
exit (1);
}
libnet_destroy (l);
system("pause");
return 0;
}
Habe auch probiert:
[code]
l = libnet_init (LIBNET_RAW4, NULL, errbuf);
l = libnet_init (LIBNET_RAW4, 0, errbuf);
l = libnet_init (LIBNET_RAW4, "10.0.2.15", errbuf);
Ausgabe:
Code:
Error opening context: libnet_open_link(): NULL device
bzw.
Error opening context: libnet_open_link(): unable to open the driver, error Code
: 14
Bei
char *dev=libnet_getdevice(l);
l = libnet_init (LIBNET_LINK, dev, errbuf);
merkert er nicht.
Kann mir wer helfen?
MFG
bl0xx