21 #define OPTION_LIST 0x80
29 extern struct dhcp_option options[];
30 extern int option_lengths[];
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);
40 extern char session_path[];
43 int createVIoption(int type, char *VIinfo);
44 int saveVIoption(char *option, u_int32_t ipAddr);
46 #define _PATH_RESOLV "/var/fyi/sys/dns"
47 #define _PATH_GW "/var/fyi/sys/gateway"
48 #define _PATH_SYS_DIR "/var/fyi/sys"
50 #define _PATH_WAN_DIR "/proc/var/fyi/wan"
51 #define _PATH_MSG "daemonstatus"
52 #define _PATH_IP "ipaddress"
53 #define _PATH_MASK "subnetmask"
54 #define _PATH_PID "pid"
56 /* option header: 2 bytes + subcode headers (6) + option data (64*2+6);
57 these are TR111 option data. Option can be longer. */
58 #define VENDOR_BRCM_ENTERPRISE_NUMBER 4413
59 #define VENDOR_ENTERPRISE_LEN 4 /* 4 bytes */
60 #define VENDOR_IDENTIFYING_INFO_LEN 142
61 #define VENDOR_IDENTIFYING_OPTION_CODE 125
62 #define VENDOR_OPTION_CODE_OFFSET 0
63 #define VENDOR_OPTION_LEN_OFFSET 1
64 #define VENDOR_OPTION_ENTERPRISE_OFFSET 2
65 #define VENDOR_OPTION_DATA_OFFSET 6
66 #define VENDOR_SUBCODE_AND_LEN_BYTES 2
67 #define VENDOR_DEVICE_OUI_SUBCODE 1
68 #define VENDOR_DEVICE_SERIAL_NUMBER_SUBCODE 2
69 #define VENDOR_DEVICE_PRODUCT_CLASS_SUBCODE 3
70 #define VENDOR_GATEWAY_OUI_SUBCODE 4
71 #define VENDOR_GATEWAY_SERIAL_NUMBER_SUBCODE 5
72 #define VENDOR_GATEWAY_PRODUCT_CLASS_SUBCODE 6
73 #define VENDOR_IDENTIFYING_FOR_GATEWAY 1
74 #define VENDOR_IDENTIFYING_FOR_DEVICE 2
75 #define VENDOR_GATEWAY_OUI_MAX_LEN 6
76 #define VENDOR_GATEWAY_SERIAL_NUMBER_MAX_LEN 64
77 #define VENDOR_GATEWAY_PRODUCT_CLASS_MAX_LEN 64