OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / sendip / ripng.h
1 /* ripng.h
2  */
3 #ifndef _SENDIP_RIPNG_H
4 #define _SENDIP_RIPNG_H
5
6 /* RIP PACKET STRUCTURES
7  */
8 typedef struct {
9         u_int8_t command;
10         u_int8_t version;
11         u_int16_t res;
12 } ripng_header;
13
14 typedef struct {
15         struct in6_addr prefix;
16         u_int16_t tag;
17         u_int8_t len;
18         u_int8_t metric;
19 } ripng_entry;
20
21 /* Defines for which parts have been modified
22  */
23 #define RIPNG_MOD_COMMAND   1
24 #define RIPNG_MOD_VERSION   1<<1
25 #define RIPNG_MOD_RESERVED  1<<2
26 //#define RIP_MOD_ADDRFAM   1<<2
27 //#define RIP_MOD_ROUTETAG  1<<3
28 //#define RIP_IS_AUTH       1<<4
29
30 /* Options
31  */
32 sendip_option rip_opts[] = {
33         {"v",1,"RIPng version","1"},
34         {"c",1,"RIPng command (1=request, 2=response)","1"},
35         {"r",1,"RIPng reserved field (should be 0)","0"},
36         {"e",1,"Add a RIPng entry.  Format is: Address/route tag/address/len/metric","::/0/128/1, any option my be left out to use the default"},
37         {"d",0,"RIPng default request - get router's entire routing table; do not use any other RIPng options on this RIPng header",NULL}
38 };
39
40 /* Helpful macros */
41 #define RIPNG_NUM_ENTRIES(d) (((d)->alloc_len-sizeof(ripng_header))/sizeof(ripng_entry))
42 #define RIPNG_ADD_ENTRY(d) { (d)->data = realloc((d)->data,(d)->alloc_len+sizeof(ripng_entry)); (d)->alloc_len+=sizeof(ripng_entry); }
43 #define RIPNG_ENTRY(d) ((ripng_entry *)((u_int32_t *)((d)->data)+((d)->alloc_len>>2)-(sizeof(ripng_entry)>>2)))
44 #endif  /* _SENDIP_RIPNG_H */