blob: 588504e5d84c736f6d0ac9cceee9209425a3f36f [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Mike Frysinger7031f622006-05-08 03:20:50 +00002/* options.h */
3#ifndef _OPTIONS_H
4#define _OPTIONS_H
5
Mike Frysinger7031f622006-05-08 03:20:50 +00006#define TYPE_MASK 0x0F
7
8enum {
9 OPTION_IP=1,
10 OPTION_IP_PAIR,
11 OPTION_STRING,
12 OPTION_BOOLEAN,
13 OPTION_U8,
14 OPTION_U16,
15 OPTION_S16,
16 OPTION_U32,
17 OPTION_S32
18};
19
20#define OPTION_REQ 0x10 /* have the client request this option */
21#define OPTION_LIST 0x20 /* There can be a list of 1 or more of these */
22
23struct dhcp_option {
Denis Vlasenkoe175ff22006-09-26 17:41:00 +000024 char name[12];
Mike Frysinger7031f622006-05-08 03:20:50 +000025 char flags;
26 uint8_t code;
27};
28
Denis Vlasenkoc90c3f32006-11-23 12:57:49 +000029extern const struct dhcp_option dhcp_options[];
30extern const unsigned char option_lengths[];
Mike Frysinger7031f622006-05-08 03:20:50 +000031
32uint8_t *get_option(struct dhcpMessage *packet, int code);
33int end_option(uint8_t *optionptr);
34int add_option_string(uint8_t *optionptr, uint8_t *string);
35int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data);
36
37#endif