tables.c
来自「open source dhcp server client etc...」· C语言 代码 · 共 1,250 行 · 第 1/3 页
C
1,250 行
/* tables.c Tables of information... *//* * Copyright (c) 1995-2001 Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of The Internet Software Consortium nor the names * of its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This software has been written for the Internet Software Consortium * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc. * To learn more about the Internet Software Consortium, see * ``http://www.isc.org/''. To learn more about Vixie Enterprises, * see ``http://www.vix.com''. To learn more about Nominum, Inc., see * ``http://www.nominum.com''. */#ifndef lintstatic char copyright[] ="$Id: tables.c,v 1.51.2.3 2001/06/21 23:50:51 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";#endif /* not lint */#include "dhcpd.h"/* XXXDPN: Moved here from hash.c, when it moved to libomapi. Not sure where these really belong. */HASH_FUNCTIONS (group, const char *, struct group_object)HASH_FUNCTIONS (universe, const char *, struct universe)HASH_FUNCTIONS (option, const char *, struct option)/* DHCP Option names, formats and codes, from RFC1533. Format codes: I - IP address l - 32-bit signed integer L - 32-bit unsigned integer s - 16-bit signed integer S - 16-bit unsigned integer b - 8-bit signed integer B - 8-bit unsigned integer t - ASCII text f - flag (true or false) A - array of whatever precedes (e.g., IA means array of IP addresses) a - array of the preceding character (e.g., IIa means two or more IP addresses) U - name of an option space (universe) F - implicit flag - the presence of the option indicates that the flag is true. o - the preceding value is optional. E - encapsulation, string or colon-seperated hex list (the latter two for parsing). E is followed by a text string containing the name of the option space to encapsulate, followed by a '.'. If the E is immediately followed by '.', the applicable vendor option space is used if one is defined. e - If an encapsulation directive is not the first thing in the string, the option scanner requires an efficient way to find the encapsulation. This is done by placing a 'e' at the beginning of the option. The 'e' has no other purpose, and is not required if 'E' is the first thing in the option. X - either an ASCII string or binary data. On output, the string is scanned to see if it's printable ASCII and, if so, output as a quoted string. If not, it's output as colon-seperated hex. On input, the option can be specified either as a quoted string or as a colon-seperated hex list. N - enumeration. N is followed by a text string containing the name of the set of enumeration values to parse or emit, followed by a '.'. The width of the data is specified in the named enumeration. Named enumerations are tracked in parse.c. d - Domain name (i.e., FOO or FOO.BAR).*/struct universe dhcp_universe;struct option dhcp_options [256] = { { "pad", "", &dhcp_universe, 0 }, { "subnet-mask", "I", &dhcp_universe, 1 }, { "time-offset", "l", &dhcp_universe, 2 }, { "routers", "IA", &dhcp_universe, 3 }, { "time-servers", "IA", &dhcp_universe, 4 }, { "ien116-name-servers", "IA", &dhcp_universe, 5 }, { "domain-name-servers", "IA", &dhcp_universe, 6 }, { "log-servers", "IA", &dhcp_universe, 7 }, { "cookie-servers", "IA", &dhcp_universe, 8 }, { "lpr-servers", "IA", &dhcp_universe, 9 }, { "impress-servers", "IA", &dhcp_universe, 10 }, { "resource-location-servers", "IA", &dhcp_universe, 11 }, { "host-name", "X", &dhcp_universe, 12 }, { "boot-size", "S", &dhcp_universe, 13 }, { "merit-dump", "t", &dhcp_universe, 14 }, { "domain-name", "t", &dhcp_universe, 15 }, { "swap-server", "I", &dhcp_universe, 16 }, { "root-path", "t", &dhcp_universe, 17 }, { "extensions-path", "t", &dhcp_universe, 18 }, { "ip-forwarding", "f", &dhcp_universe, 19 }, { "non-local-source-routing", "f", &dhcp_universe, 20 }, { "policy-filter", "IIA", &dhcp_universe, 21 }, { "max-dgram-reassembly", "S", &dhcp_universe, 22 }, { "default-ip-ttl", "B", &dhcp_universe, 23 }, { "path-mtu-aging-timeout", "L", &dhcp_universe, 24 }, { "path-mtu-plateau-table", "SA", &dhcp_universe, 25 }, { "interface-mtu", "S", &dhcp_universe, 26 }, { "all-subnets-local", "f", &dhcp_universe, 27 }, { "broadcast-address", "I", &dhcp_universe, 28 }, { "perform-mask-discovery", "f", &dhcp_universe, 29 }, { "mask-supplier", "f", &dhcp_universe, 30 }, { "router-discovery", "f", &dhcp_universe, 31 }, { "router-solicitation-address", "I", &dhcp_universe, 32 }, { "static-routes", "IIA", &dhcp_universe, 33 }, { "trailer-encapsulation", "f", &dhcp_universe, 34 }, { "arp-cache-timeout", "L", &dhcp_universe, 35 }, { "ieee802-3-encapsulation", "f", &dhcp_universe, 36 }, { "default-tcp-ttl", "B", &dhcp_universe, 37 }, { "tcp-keepalive-interval", "L", &dhcp_universe, 38 }, { "tcp-keepalive-garbage", "f", &dhcp_universe, 39 }, { "nis-domain", "t", &dhcp_universe, 40 }, { "nis-servers", "IA", &dhcp_universe, 41 }, { "ntp-servers", "IA", &dhcp_universe, 42 }, { "vendor-encapsulated-options", "E.", &dhcp_universe, 43 }, { "netbios-name-servers", "IA", &dhcp_universe, 44 }, { "netbios-dd-server", "IA", &dhcp_universe, 45 }, { "netbios-node-type", "B", &dhcp_universe, 46 }, { "netbios-scope", "t", &dhcp_universe, 47 }, { "font-servers", "IA", &dhcp_universe, 48 }, { "x-display-manager", "IA", &dhcp_universe, 49 }, { "dhcp-requested-address", "I", &dhcp_universe, 50 }, { "dhcp-lease-time", "L", &dhcp_universe, 51 }, { "dhcp-option-overload", "B", &dhcp_universe, 52 }, { "dhcp-message-type", "B", &dhcp_universe, 53 }, { "dhcp-server-identifier", "I", &dhcp_universe, 54 }, { "dhcp-parameter-request-list", "BA", &dhcp_universe, 55 }, { "dhcp-message", "t", &dhcp_universe, 56 }, { "dhcp-max-message-size", "S", &dhcp_universe, 57 }, { "dhcp-renewal-time", "L", &dhcp_universe, 58 }, { "dhcp-rebinding-time", "L", &dhcp_universe, 59 }, { "vendor-class-identifier", "X", &dhcp_universe, 60 }, { "dhcp-client-identifier", "X", &dhcp_universe, 61 }, { "nwip-domain", "X", &dhcp_universe, 62 }, { "nwip-suboptions", "Enwip.", &dhcp_universe, 63 }, { "nisplus-domain", "t", &dhcp_universe, 64 }, { "nisplus-servers", "IA", &dhcp_universe, 65 }, { "tftp-server-name", "t", &dhcp_universe, 66 }, { "bootfile-name", "t", &dhcp_universe, 67 }, { "mobile-ip-home-agent", "IA", &dhcp_universe, 68 }, { "smtp-server", "IA", &dhcp_universe, 69 }, { "pop-server", "IA", &dhcp_universe, 70 }, { "nntp-server", "IA", &dhcp_universe, 71 }, { "www-server", "IA", &dhcp_universe, 72 }, { "finger-server", "IA", &dhcp_universe, 73 }, { "irc-server", "IA", &dhcp_universe, 74 }, { "streettalk-server", "IA", &dhcp_universe, 75 }, { "streettalk-directory-assistance-server", "IA", &dhcp_universe, 76 }, { "user-class", "t", &dhcp_universe, 77 }, { "slp-directory-agent", "fIa", &dhcp_universe, 78 }, { "slp-service-scope", "fto", &dhcp_universe, 79 }, { "#80", "X", &dhcp_universe, 80 }, { "fqdn", "Efqdn.", &dhcp_universe, 81 }, { "relay-agent-information", "Eagent.", &dhcp_universe, 82 }, { "#83", "X", &dhcp_universe, 83 }, { "#84", "X", &dhcp_universe, 84 }, { "nds-servers", "IA", &dhcp_universe, 85 }, { "nds-tree-name", "X", &dhcp_universe, 86 }, { "nds-context", "X", &dhcp_universe, 87 }, { "#88", "X", &dhcp_universe, 88 }, { "#89", "X", &dhcp_universe, 89 }, { "#90", "X", &dhcp_universe, 90 }, { "#91", "X", &dhcp_universe, 91 }, { "#92", "X", &dhcp_universe, 92 }, { "#93", "X", &dhcp_universe, 93 }, { "#94", "X", &dhcp_universe, 94 }, { "#95", "X", &dhcp_universe, 95 }, { "#96", "X", &dhcp_universe, 96 }, { "#97", "X", &dhcp_universe, 97 }, { "uap-servers", "t", &dhcp_universe, 98 }, { "#99", "X", &dhcp_universe, 99 }, { "#100", "X", &dhcp_universe, 100 }, { "#101", "X", &dhcp_universe, 101 }, { "#102", "X", &dhcp_universe, 102 }, { "#103", "X", &dhcp_universe, 103 }, { "#104", "X", &dhcp_universe, 104 }, { "#105", "X", &dhcp_universe, 105 }, { "#106", "X", &dhcp_universe, 106 }, { "#107", "X", &dhcp_universe, 107 }, { "#108", "X", &dhcp_universe, 108 }, { "#109", "X", &dhcp_universe, 109 }, { "#110", "X", &dhcp_universe, 110 }, { "#111", "X", &dhcp_universe, 111 }, { "#112", "X", &dhcp_universe, 112 }, { "#113", "X", &dhcp_universe, 113 }, { "#114", "X", &dhcp_universe, 114 }, { "#115", "X", &dhcp_universe, 115 }, { "#116", "X", &dhcp_universe, 116 }, { "#117", "X", &dhcp_universe, 117 }, { "subnet-selection", "X", &dhcp_universe, 118 }, { "#119", "X", &dhcp_universe, 119 }, { "#120", "X", &dhcp_universe, 120 }, { "#121", "X", &dhcp_universe, 121 }, { "#122", "X", &dhcp_universe, 122 }, { "#123", "X", &dhcp_universe, 123 }, { "#124", "X", &dhcp_universe, 124 }, { "#125", "X", &dhcp_universe, 125 }, { "#126", "X", &dhcp_universe, 126 }, { "#127", "X", &dhcp_universe, 127 }, { "#128", "X", &dhcp_universe, 128 }, { "#129", "X", &dhcp_universe, 129 }, { "#130", "X", &dhcp_universe, 130 }, { "#131", "X", &dhcp_universe, 131 }, { "#132", "X", &dhcp_universe, 132 }, { "#133", "X", &dhcp_universe, 133 }, { "#134", "X", &dhcp_universe, 134 }, { "#135", "X", &dhcp_universe, 135 }, { "#136", "X", &dhcp_universe, 136 }, { "#137", "X", &dhcp_universe, 137 }, { "#138", "X", &dhcp_universe, 138 }, { "#139", "X", &dhcp_universe, 139 }, { "#140", "X", &dhcp_universe, 140 }, { "#141", "X", &dhcp_universe, 141 }, { "#142", "X", &dhcp_universe, 142 }, { "#143", "X", &dhcp_universe, 143 }, { "#144", "X", &dhcp_universe, 144 }, { "#145", "X", &dhcp_universe, 145 }, { "#146", "X", &dhcp_universe, 146 }, { "#147", "X", &dhcp_universe, 147 }, { "#148", "X", &dhcp_universe, 148 }, { "#149", "X", &dhcp_universe, 149 }, { "#150", "X", &dhcp_universe, 150 }, { "#151", "X", &dhcp_universe, 151 }, { "#152", "X", &dhcp_universe, 152 }, { "#153", "X", &dhcp_universe, 153 }, { "#154", "X", &dhcp_universe, 154 }, { "#155", "X", &dhcp_universe, 155 }, { "#156", "X", &dhcp_universe, 156 }, { "#157", "X", &dhcp_universe, 157 }, { "#158", "X", &dhcp_universe, 158 }, { "#159", "X", &dhcp_universe, 159 }, { "#160", "X", &dhcp_universe, 160 }, { "#161", "X", &dhcp_universe, 161 }, { "#162", "X", &dhcp_universe, 162 }, { "#163", "X", &dhcp_universe, 163 }, { "#164", "X", &dhcp_universe, 164 }, { "#165", "X", &dhcp_universe, 165 }, { "#166", "X", &dhcp_universe, 166 }, { "#167", "X", &dhcp_universe, 167 }, { "#168", "X", &dhcp_universe, 168 }, { "#169", "X", &dhcp_universe, 169 }, { "#170", "X", &dhcp_universe, 170 }, { "#171", "X", &dhcp_universe, 171 }, { "#172", "X", &dhcp_universe, 172 }, { "#173", "X", &dhcp_universe, 173 }, { "#174", "X", &dhcp_universe, 174 }, { "#175", "X", &dhcp_universe, 175 }, { "#176", "X", &dhcp_universe, 176 }, { "#177", "X", &dhcp_universe, 177 }, { "#178", "X", &dhcp_universe, 178 }, { "#179", "X", &dhcp_universe, 179 }, { "#180", "X", &dhcp_universe, 180 }, { "#181", "X", &dhcp_universe, 181 }, { "#182", "X", &dhcp_universe, 182 }, { "#183", "X", &dhcp_universe, 183 }, { "#184", "X", &dhcp_universe, 184 }, { "#185", "X", &dhcp_universe, 185 }, { "#186", "X", &dhcp_universe, 186 }, { "#187", "X", &dhcp_universe, 187 }, { "#188", "X", &dhcp_universe, 188 }, { "#189", "X", &dhcp_universe, 189 }, { "#190", "X", &dhcp_universe, 190 }, { "#191", "X", &dhcp_universe, 191 }, { "#192", "X", &dhcp_universe, 192 }, { "#193", "X", &dhcp_universe, 193 }, { "#194", "X", &dhcp_universe, 194 }, { "#195", "X", &dhcp_universe, 195 }, { "#196", "X", &dhcp_universe, 196 }, { "#197", "X", &dhcp_universe, 197 }, { "#198", "X", &dhcp_universe, 198 }, { "#199", "X", &dhcp_universe, 199 }, { "#200", "X", &dhcp_universe, 200 }, { "#201", "X", &dhcp_universe, 201 }, { "#202", "X", &dhcp_universe, 202 }, { "#203", "X", &dhcp_universe, 203 }, { "#204", "X", &dhcp_universe, 204 }, { "#205", "X", &dhcp_universe, 205 }, { "#206", "X", &dhcp_universe, 206 }, { "#207", "X", &dhcp_universe, 207 }, { "#208", "X", &dhcp_universe, 208 }, { "#209", "X", &dhcp_universe, 209 }, { "authenticate", "X", &dhcp_universe, 210 }, { "#211", "X", &dhcp_universe, 211 }, { "#212", "X", &dhcp_universe, 212 }, { "#213", "X", &dhcp_universe, 213 }, { "#214", "X", &dhcp_universe, 214 }, { "#215", "X", &dhcp_universe, 215 }, { "#216", "X", &dhcp_universe, 216 }, { "#217", "X", &dhcp_universe, 217 }, { "#218", "X", &dhcp_universe, 218 }, { "#219", "X", &dhcp_universe, 219 }, { "#220", "X", &dhcp_universe, 220 }, { "#221", "X", &dhcp_universe, 221 }, { "#222", "X", &dhcp_universe, 222 }, { "#223", "X", &dhcp_universe, 223 }, { "#224", "X", &dhcp_universe, 224 }, { "#225", "X", &dhcp_universe, 225 }, { "#226", "X", &dhcp_universe, 226 }, { "#227", "X", &dhcp_universe, 227 }, { "#228", "X", &dhcp_universe, 228 }, { "#229", "X", &dhcp_universe, 229 }, { "#230", "X", &dhcp_universe, 230 }, { "#231", "X", &dhcp_universe, 231 }, { "#232", "X", &dhcp_universe, 232 }, { "#233", "X", &dhcp_universe, 233 }, { "#234", "X", &dhcp_universe, 234 }, { "#235", "X", &dhcp_universe, 235 }, { "#236", "X", &dhcp_universe, 236 }, { "#237", "X", &dhcp_universe, 237 }, { "#238", "X", &dhcp_universe, 238 }, { "#239", "X", &dhcp_universe, 239 }, { "#240", "X", &dhcp_universe, 240 }, { "#241", "X", &dhcp_universe, 241 }, { "#242", "X", &dhcp_universe, 242 }, { "#243", "X", &dhcp_universe, 243 }, { "#244", "X", &dhcp_universe, 244 }, { "#245", "X", &dhcp_universe, 245 }, { "#246", "X", &dhcp_universe, 246 }, { "#247", "X", &dhcp_universe, 247 }, { "#248", "X", &dhcp_universe, 248 }, { "#249", "X", &dhcp_universe, 249 }, { "#250", "X", &dhcp_universe, 250 }, { "#251", "X", &dhcp_universe, 251 }, { "#252", "X", &dhcp_universe, 252 }, { "#253", "X", &dhcp_universe, 253 }, { "#254", "X", &dhcp_universe, 254 }, { "option-end", "e", &dhcp_universe, 255 },};struct universe nwip_universe;struct option nwip_options [256] = { { "pad", "", &nwip_universe, 0 }, { "illegal-1", "", &nwip_universe, 1 }, { "illegal-2", "", &nwip_universe, 2 }, { "illegal-3", "", &nwip_universe, 3 }, { "illegal-4", "", &nwip_universe, 4 }, { "nsq-broadcast", "f", &nwip_universe, 5 }, { "preferred-dss", "IA", &nwip_universe, 6 }, { "nearest-nwip-server", "IA", &nwip_universe, 7 }, { "autoretries", "B", &nwip_universe, 8 }, { "autoretry-secs", "B", &nwip_universe, 9 }, { "nwip-1-1", "f", &nwip_universe, 10 }, { "primary-dss", "I", &nwip_universe, 11 }, { "#12", "X", &nwip_universe, 12 }, { "#13", "X", &nwip_universe, 13 }, { "#14", "X", &nwip_universe, 14 }, { "#15", "X", &nwip_universe, 15 }, { "#16", "X", &nwip_universe, 16 }, { "#17", "X", &nwip_universe, 17 }, { "#18", "X", &nwip_universe, 18 }, { "#19", "X", &nwip_universe, 19 }, { "#20", "X", &nwip_universe, 20 }, { "#21", "X", &nwip_universe, 21 }, { "#22", "X", &nwip_universe, 22 }, { "#23", "X", &nwip_universe, 23 }, { "#24", "X", &nwip_universe, 24 }, { "#25", "X", &nwip_universe, 25 }, { "#26", "X", &nwip_universe, 26 }, { "#27", "X", &nwip_universe, 27 }, { "#28", "X", &nwip_universe, 28 }, { "#29", "X", &nwip_universe, 29 }, { "#30", "X", &nwip_universe, 30 }, { "#31", "X", &nwip_universe, 31 }, { "#32", "X", &nwip_universe, 32 }, { "#33", "X", &nwip_universe, 33 }, { "#34", "X", &nwip_universe, 34 }, { "#35", "X", &nwip_universe, 35 }, { "#36", "X", &nwip_universe, 36 }, { "#37", "X", &nwip_universe, 37 }, { "#38", "X", &nwip_universe, 38 }, { "#39", "X", &nwip_universe, 39 }, { "#40", "X", &nwip_universe, 40 }, { "#41", "X", &nwip_universe, 41 }, { "#42", "X", &nwip_universe, 42 }, { "#43", "X", &nwip_universe, 43 }, { "#44", "X", &nwip_universe, 44 }, { "#45", "X", &nwip_universe, 45 }, { "#46", "X", &nwip_universe, 46 }, { "#47", "X", &nwip_universe, 47 }, { "#48", "X", &nwip_universe, 48 }, { "#49", "X", &nwip_universe, 49 }, { "#50", "X", &nwip_universe, 50 }, { "#51", "X", &nwip_universe, 51 }, { "#52", "X", &nwip_universe, 52 }, { "#53", "X", &nwip_universe, 53 }, { "#54", "X", &nwip_universe, 54 }, { "#55", "X", &nwip_universe, 55 }, { "#56", "X", &nwip_universe, 56 },
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?