# BRCM_VERSION=3
[bcm963xx.git] / userapps / opensource / udhcp / options.h
1 /* options.h */
2 #ifndef _OPTIONS_H
3 #define _OPTIONS_H
4
5 #include "packet.h"
6
7 #define TYPE_MASK       0x0F
8
9 enum {
10         OPTION_IP=1,
11         OPTION_IP_PAIR,
12         OPTION_STRING,
13         OPTION_BOOLEAN,
14         OPTION_U8,
15         OPTION_U16,
16         OPTION_S16,
17         OPTION_U32,
18         OPTION_S32
19 };
20
21 #define OPTION_LIST     0x80
22
23 struct dhcp_option {
24         char name[10];
25         char flags;
26         char code;
27 };
28
29 extern struct dhcp_option options[];
30 extern int option_lengths[];
31
32 unsigned char *get_option(struct dhcpMessage *packet, int code);
33 int end_option(unsigned char *optionptr);
34 int add_option_string(unsigned char *optionptr, unsigned char *string);
35 int add_simple_option(unsigned char *optionptr, unsigned char code, u_int32_t data);
36 struct option_set *find_option(struct option_set *opt_list, char code);
37 void attach_option(struct option_set **opt_list, struct dhcp_option *option, char *buffer, int length);
38
39 // brcm
40 extern char session_path[];
41
42 // brcm
43 #define _PATH_RESOLV     "/var/fyi/sys/dns"
44 #define _PATH_GW         "/var/fyi/sys/gateway"
45 #define _PATH_SYS_DIR    "/var/fyi/sys"
46
47 #define _PATH_WAN_DIR   "/proc/var/fyi/wan"
48 #define _PATH_MSG       "daemonstatus"
49 #define _PATH_IP        "ipaddress"
50 #define _PATH_MASK      "subnetmask"
51 #define _PATH_PID       "pid"
52
53 #endif