forked from IPv4v6/isic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisic.h
37 lines (29 loc) · 812 Bytes
/
isic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <strings.h>
#ifndef __FAVOR_BSD
# define __FAVOR_BSD
#endif
#include <libnet.h>
#include <netinet/ip_icmp.h>
#include <netinet/icmp6.h>
#include <netinet/ip6.h>
#include <netinet/if_ether.h>
#include <netinet/ether.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#ifndef ETHER_FRAME_SIZE
#define ETHER_FRAME_SIZE 1500
#endif
#define IP_H 20
#define UDP_H 8
#define IP6_H 40
#define IP6_FRAGH 8
#define ICMP6_H 8
/* We want a random function that returns 0 to 0x7fff */
#if ( RAND_MAX != 2147483647 ) /* expect signed long */
#error Random IP generation broken: unexpected RAND_MAX.
#endif
#define RAND8 ((u_int8_t)(rand() & 0xff))
#define RAND16 ((u_int16_t)(rand() & 0xffff))
#define RAND32 ((u_int32_t)((RAND16 << 16) + RAND16))
void usage(char *);
void sighandler(int);