dhcp-options-strings.c

来自「this is sample about DHCP-agent」· C语言 代码 · 共 203 行

C
203
字号
/* $Header: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-options-strings.c,v 1.6 2002/12/18 05:40:38 actmodern Exp $ *  * Copyright 2002 Thamer Alharbash <tmh@whitefang.com> *  * 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. The names of the authors may not be used to endorse or promote * products derived from this software without specific prior * written permission. *  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *  */#include "dhcp-local.h"#define MODULE_NAME "dhcp-option-strings"/* these we use to print out with. */static const char *dhcp_options_printable_strings[] = {    "Pad",                      /* 0 */    "Subnet Mask",              /* 1 */    "Time Offset",              /* 2 */    "Routers",                  /* 3 */    "Time Servers",             /* 4 */    "Name Servers",             /* 5 */    "Domain Name Servers",      /* 6 */    "Log Servers",              /* 7 */    "Cookie Servers",           /* 8 */    "LPR Servers",              /* 9 */    "Impress Servers",          /* 10 */    "RL servers",               /* 11 */    "Hostname",                 /* 12 */    "Boot File Size",           /* 13 */    "Merit Dump File",          /* 14 */    "Domain Name",              /* 15 */    "Swap Server",              /* 16 */    "Root Path",                /* 17 */    "Extensions Path",          /* 18 */    "IP Forwarding",            /* 19 */    "Source Routing",           /* 20 */    "Policy Filter",            /* 21 */    "Maximum DGRAM Reassmbly",  /* 22 */    "Default IP Time-to-live",  /* 23 */    "Path MTU Aging Timeout",   /* 24 */    "Path MTU Plateau Table",   /* 25 */    "Interface MTU",            /* 26 */    "All Subnets",              /* 27 */    "Broadcast Address",        /* 28 */    "Perform Mask Discovery",   /* 29 */    "Mask Supplier",            /* 30 */    "Perform Router Discovery", /* 31 */    "Router Solicitation Address", /* 32 */    "Static Route",             /* 33 */    "Trailer Encapsulation",    /* 34 */    "ARP Cache Timeout",        /* 35 */    "Ethernet Encapsulation",   /* 36 */    "TCP Default TTL",          /* 37 */    "TCP KeepAlive Interval",   /* 38 */    "TCP KeepAlive Garbage",    /* 39 */    "Network Information Service Domain", /* 40 */    "Network Information Servers", /* 41 */    "Network Time Protocol Servers", /* 42 */    "Vendor Specific Information", /* 43 */    "NetBIOS over TCP/IP Name Servers", /* 44 */    "NetBIOS over TCP/IP Datagram Distribution Servers", /* 45 */    "NetBIOS over TCP/IP Node Type", /* 46 */    "NetBIOS over TCP/IP Scope", /* 47 */    "X-Windows Font Servers",   /* 48 */    "X-Windows System Display Manager", /* 49 */    "Requested IP Address",     /* 50 */    "IP Address Lease Time",    /* 51 */    "Option Overload",          /* 52 */    "DHCP Message Type",        /* 53 */    "Server Identifier",        /* 54 */    "Parameter Request List",   /* 55 */    "Message",                  /* 56 */    "Max DHCP Message Size",    /* 57 */    "Renewal Time",             /* 58 */    "Rebinding Time",           /* 59 */    "Class ID",                 /* 60 */    "Client ID",                /* 61 */    "NIS+ Domain"   ,           /* 62 */    "NIS+ Servers",             /* 63 */    "TFTP Servers",             /* 64 */    "Boot File Name",           /* 65 */    "IP Home Agent",            /* 66 */    "SMTP Server",              /* 67 */    "POP Server",               /* 68 */    "NNTP Server",              /* 69 */    "Default WWW Server",       /* 70 */    "Default Finger Server",    /* 71 */    "Default IRC Server",       /* 72 */    "Default ST Server",        /* 73 */    "Default STDA Server"       /* 74 */};/* these we use for configuration: lowercase with hyphen. */static const char *dhcp_options_conf_strings[] = {    "pad",                      /* 0 */    "subnet-mask",              /* 1 */    "time-offset",              /* 2 */    "routers",                  /* 3 */    "time-servers",             /* 4 */    "name-servers",             /* 5 */    "domain-name-servers",      /* 6 */    "log-servers",              /* 7 */    "cookie-servers",           /* 8 */    "lpr-servers",              /* 9 */    "impress-servers",          /* 10 */    "rl-servers",               /* 11 */    "hostname",                 /* 12 */    "boot-file-size",           /* 13 */    "merit-dump-file",          /* 14 */    "domain-name",              /* 15 */    "swap-server",              /* 16 */    "root-path",                /* 17 */    "extensions-path",          /* 18 */    "ip-forwarding",            /* 19 */    "source-routing",           /* 20 */    "policy-filter",            /* 21 */    "maximum-dgram-reassmbly",  /* 22 */    "default-ip-time-to-live",  /* 23 */    "path-mtu-aging-timeout",   /* 24 */    "path-mtu-plateau-table",   /* 25 */    "interface-mtu",            /* 26 */    "all-subnets",              /* 27 */    "broadcast-address",        /* 28 */    "perform-mask-discovery",   /* 29 */    "mask-supplier",            /* 30 */    "perform-router-discovery", /* 31 */    "router-solicitation-address", /* 32 */    "static-route",             /* 33 */    "trailer-encapsulation",    /* 34 */    "arp-cache-timeout",        /* 35 */    "ethernet-encapsulation",   /* 36 */    "tcp-default-ttl",          /* 37 */    "tcp-keepalive-interval",   /* 38 */    "tcp-keepalive-garbage",    /* 39 */    "network-information-service-domain", /* 40 */    "network-information-servers", /* 41 */    "network-time-protocol-servers", /* 42 */    "vendor-specific-information", /* 43 */    "netbios-over-tcp-name servers", /* 44 */    "netbios-over-tcp-datagram-distribution-servers", /* 45 */    "netbios-over-tcp-node-type", /* 46 */    "netbios-over-tcp-scope", /* 47 */    "x-windows-font-servers",   /* 48 */    "x-windows-system-display-manager", /* 49 */    "requested-ip-address",     /* 50 */    "ip-address-lease-time",    /* 51 */    "option-overload",          /* 52 */    "dhcp-message-type",        /* 53 */    "server-identifier",        /* 54 */    "parameter-request-list",   /* 55 */    "message",                  /* 56 */    "max-dhcp-message-size",     /* 57 */    "renewal-time",             /* 58 */    "rebinding-time",           /* 59 */    "class-id",                 /* 60 */    "client-id",                /* 61 */    "nisplus-domain",           /* 62 */    "nisplus-servers",          /* 63 */    "tftp-server",              /* 64 */    "boot-file-name",           /* 65 */    "ip-home-agent",            /* 66 */    "smtp-server",              /* 67 */    "pop-server",               /* 68 */    "nntp-server",              /* 69 */    "default-www-server",       /* 70 */    "default-finger-server",    /* 71 */    "default-irc-server",       /* 72 */    "default-st-server",        /* 73 */    "default-stda-server"       /* 74 */};/* accessors. */const char *dhcp_option_printable_string_get(int index){    return dhcp_options_printable_strings[index];}const char *dhcp_option_conf_string_get(int index){    return dhcp_options_conf_strings[index];}/* retrieve entire array for configuration strings. */const char **dhcp_option_conf_string_get_array(void){    return dhcp_options_conf_strings;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?