1/*
2 * Copyright (C) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef OHOS_DHCP_IPV4_H
17#define OHOS_DHCP_IPV4_H
18
19// See: RFC 2132        DHCP Options and BOOTP Vendor Extensions      March 1997
20enum DhcpOptions {
21    /*
22     * 3. RFC 1497 Vendor Extensions
23     * This section lists the vendor extensions as defined in RFC 1497.
24     * They are defined here for completeness.
25     */
26    PAD_OPTION = 0,
27    END_OPTION = 255,
28
29    SUBNET_MASK_OPTION = 1,
30    TIME_OFFSET_OPTION = 2,
31    ROUTER_OPTION = 3,
32    TIME_SERVER_OPTION = 4,
33    NAME_SERVER_OPTION = 5,
34    DOMAIN_NAME_SERVER_OPTION = 6,
35    LOG_SERVER_OPTION = 7,
36    COOKIE_SERVER_OPTION = 8,
37    LPR_SERVER_OPTION = 9,
38    IMPRESS_SERVER_OPTION = 10,
39    RESOURCE_LOCATION_SERVER_OPTION = 11,
40    HOST_NAME_OPTION = 12,
41    BOOT_FILE_SIZE_OPTION = 13,
42    MERIT_DUMP_FILE_OPTION = 14,
43    DOMAIN_NAME_OPTION = 15,
44    SWAP_SERVER_OPTION = 16,
45    ROOT_PATH_OPTION = 17,
46    EXTENSIONS_PATH_OPTION = 18,
47
48    /*
49     * IP Layer Parameters per Host
50     * This section details the options that affect the operation of the IP layer on a per-host basis.
51     */
52    IP_FORWARDING_OPTION = 19,
53    NON_LOCAL_SOURCE_ROUTING_OPTION = 20,
54    POLICY_FILTER_OPTION = 21,
55    MAXIMUM_DATAGRAM_REASSEMBLY_SIZE_OPTION = 22,
56    DEFAULT_IP_TIME_TO_LIVE_OPTION = 23,
57    PATH_MTU_AGING_TIMEOUT_OPTION = 24,
58    PATH_MTU_PLATEAU_TABLE_OPTION = 25,
59
60    /*
61     * 5. IP Layer Parameters per Interface
62     * This section details the options that affect the operation of the IP layer on a per-interface basis.  It is
63     * expected that a client can issue multiple requests, one per interface, in order to configure interfaces with
64     * their specific parameters.
65     */
66    INTERFACE_MTU_OPTION = 26,
67    ALL_SUBNETS_ARE_LOCAL_OPTION = 27,
68    BROADCAST_ADDRESS_OPTION = 28,
69    PERFORM_MASK_DISCOVERY_OPTION = 29,
70    MASK_SUPPLIER_OPTION = 30,
71    PERFORM_ROUTER_DISCOVERY_OPTION = 31,
72    ROUTER_SOLICITATION_ADDRESS_OPTION = 32,
73    STATIC_ROUTE_OPTION = 33,
74
75    /*
76     * 6. Link Layer Parameters per Interface
77     * This section lists the options that affect the operation of the data link layer on a per-interface basis.
78     */
79    TRAILER_ENCAPSULATION_OPTION = 34,   // 6.1. Trailer Encapsulation Option
80    ARP_CACHE_TIMEOUT_OPTION = 35,       // 6.2. ARP Cache Timeout Option
81    ETHERNET_ENCAPSULATION_OPTION = 36,  // 6.3. Ethernet Encapsulation Option
82
83    /*
84     * 7. TCP Parameters
85     * This section lists the options that affect the operation of the TCP layer on a per-interface basis.
86     */
87    TCP_DEFAULT_TTL_OPTION = 37,         // 7.1. TCP Default TTL Option
88    TCP_KEEPALIVE_INTERVAL_OPTION = 38,  // 7.2. TCP Keepalive Interval Option
89    TCP_KEEPALIVE_GARBAGE_OPTION = 39,   // 7.3. TCP Keepalive Garbage Option
90
91    /*
92     * 8. Application and Service Parameters
93     * This section details some miscellaneous options used to configure miscellaneous applications and services.
94     */
95    NETWORK_INFO_SERVICE_DOMAIN_OPTION = 40,           // 8.1. Network Information Service Domain Option
96    NETWORK_INFO_SERVERS_OPTION = 41,                  // 8.2. Network Information Servers Option
97    NETWORK_TIME_PROTOCOL_SERVERS_OPTION = 42,         // 8.3. Network Time Protocol Servers Option
98    VENDOR_SPECIFIC_INFO_OPTION = 43,                  // 8.4. Vendor Specific Information
99    NETBIOS_OVER_IP_NAME_SERVER_OPTION = 44,           // 8.5. NetBIOS over TCP/IP Name Server Option
100    NETBIOS_OVER_IP_DATAGRAM_DIST_SERVER_OPTION = 45,  // 8.6. NetBIOS over TCP/IP Datagram Distribution Server Option
101    NETBIOS_OVER_IP_NODE_TYPE_OPTION = 46,             // 8.7. NetBIOS over TCP/IP Node Type Option
102    NETBIOS_OVER_IP_SCOPE_OPTION = 47,                 // 8.8. NetBIOS over TCP/IP Scope Option
103    X_WINDOW_SYSTEM_FONT_SERVER_OPTION = 48,           // 8.9. X Window System Font Server Option
104    X_WINDOW_SYSTEM_DISPLAY_MANAGER_OPTION = 49,       // 8.10. X Window System Display Manager Option
105    NETWORK_INFO_SERVICE_PLUS_DOMAIN_OPTION = 64,      // 8.11. Network Information Service+ Domain Option
106    NETWORK_INFO_SERVICE_PLUS_SERVERS_OPTION = 65,     // 8.12. Network Information Service+ Servers Option
107    MOBILE_IP_HOME_AGENT_OPTION = 68,                  // 8.13. Mobile IP Home Agent option
108    SMTP_SERVER_OPTION = 69,                           // 8.14. Simple Mail Transport Protocol (SMTP) Server Option
109    POP3_SERVER_OPTION = 70,                           // 8.15. Post Office Protocol (POP3) Server Option
110    NNTP_SERVER_OPTION = 71,                           // 8.16. Network News Transport Protocol (NNTP) Server Option
111    DEFAULT_WEB_SERVER_OPTION = 72,                    // 8.17. Default World Wide Web (WWW) Server Option
112    DEFAULT_FINGER_SERVER_OPTION = 73,                 // 8.18. Default Finger Server Option
113    DEFAULT_IRC_SERVER_OPTION = 74,                    // 8.19. Default Internet Relay Chat (IRC) Server Option
114    STREETTALK_SERVER_OPTION = 75,                     // 8.20. StreetTalk Server Option
115    STDA_SERVER_OPTION = 76,                           // 8.21. StreetTalk Directory Assistance (STDA) Server Option
116
117    /*
118     * 9. DHCP Extensions
119     * This section details the options that are specific to DHCP.
120     */
121    REQUESTED_IP_ADDRESS_OPTION = 50,
122    IP_ADDRESS_LEASE_TIME_OPTION = 51,
123    OPTION_OVERLOAD_OPTION = 52,
124    TFTP_SERVER_NAME_OPTION = 66,
125    BOOTFILE_NAME_OPTION = 67,
126    DHCP_MESSAGE_TYPE_OPTION = 53,
127    SERVER_IDENTIFIER_OPTION = 54,
128    PARAMETER_REQUEST_LIST_OPTION = 55,
129    MESSAGE_OPTION = 56,
130    MAXIMUM_DHCP_MESSAGE_SIZE_OPTION = 57,
131    RENEWAL_TIME_VALUE_OPTION = 58,
132    REBINDING_TIME_VALUE_OPTION = 59,
133    VENDOR_CLASS_IDENTIFIER_OPTION = 60,
134    CLIENT_IDENTIFIER_OPTION = 61,
135    USER_CLASS_OPTION = 77,
136    RAPID_COMMIT_OPTION = 80,
137    IPV6_ONLY_PREFERRED_OPTION = 108,
138    CAPTIVE_PORTAL_OPTION = 114
139};
140
141#endif