version 1.1, 2012/02/21 22:14:23
|
version 1.1.1.3, 2023/09/27 11:11:38
|
Line 48 main(int argc, char **argv)
|
Line 48 main(int argc, char **argv)
|
char *payload; |
char *payload; |
libnet_ptag_t t; |
libnet_ptag_t t; |
struct libnet_stats ls; |
struct libnet_stats ls; |
u_int16_t payload_s; | uint16_t payload_s; |
u_int32_t src_ip, dst_ip; | uint32_t src_ip, dst_ip; |
u_int16_t bport, eport, cport; | uint16_t bport, eport, cport; |
libnet_plist_t plist, *plist_p; |
libnet_plist_t plist, *plist_p; |
char errbuf[LIBNET_ERRBUF_SIZE]; |
char errbuf[LIBNET_ERRBUF_SIZE]; |
|
|
Line 137 main(int argc, char **argv)
|
Line 137 main(int argc, char **argv)
|
cport, /* destination port */ |
cport, /* destination port */ |
LIBNET_UDP_H + payload_s, /* packet size */ |
LIBNET_UDP_H + payload_s, /* packet size */ |
0, /* checksum */ |
0, /* checksum */ |
payload, /* payload */ | (uint8_t *)payload, /* payload */ |
payload_s, /* payload size */ |
payload_s, /* payload size */ |
l, /* libnet handle */ |
l, /* libnet handle */ |
udp); /* libnet id */ |
udp); /* libnet id */ |
Line 208 main(int argc, char **argv)
|
Line 208 main(int argc, char **argv)
|
#endif |
#endif |
|
|
libnet_timersub(&e, &s, &r); |
libnet_timersub(&e, &s, &r); |
fprintf(stderr, "Total time spent in loop: %d.%d\n", r.tv_sec, r.tv_usec); | fprintf(stderr, "Total time spent in loop: %d.%d\n", (int)r.tv_sec, |
| (int)r.tv_usec); |
|
|
libnet_stats(l, &ls); |
libnet_stats(l, &ls); |
fprintf(stderr, "Packets sent: %lld\n" |
fprintf(stderr, "Packets sent: %lld\n" |
"Packet errors: %lld\n" |
"Packet errors: %lld\n" |
"Bytes written: %lld\n", |
"Bytes written: %lld\n", |
ls.packets_sent, ls.packet_errors, ls.bytes_written); | (long long)ls.packets_sent, (long long)ls.packet_errors, |
| (long long)ls.bytes_written); |
libnet_destroy(l); |
libnet_destroy(l); |
return (EXIT_SUCCESS); |
return (EXIT_SUCCESS); |
bad: |
bad: |
Line 229 usage(char *name)
|
Line 231 usage(char *name)
|
fprintf(stderr, "usage: %s -s s_ip -d d_ip -P port list [-p payload]\n", name); |
fprintf(stderr, "usage: %s -s s_ip -d d_ip -P port list [-p payload]\n", name); |
} |
} |
|
|
/* EOF */ |
|