#!/bin/false
# PODNAME: Net::DHCP::Constants
# Author: Dean Hamstead, Stephan Hadinger
# ABSTRACT: Constants for DHCP codes and options
use strict;
use warnings FATAL => 'uninitialized';
use 5.8.0;

package Net::DHCP::Constants;
$Net::DHCP::Constants::VERSION = '0.9';
use Exporter 'import';

our @EXPORT = qw(MAGIC_COOKIE);

# Constants
our ( %DHO_CODES,        %REV_DHO_CODES );
our ( %DHCP_MESSAGE,     %REV_DHCP_MESSAGE );
our ( %BOOTP_CODES,      %REV_BOOTP_CODES );
our ( %HTYPE_CODES,      %REV_HTYPE_CODES );
our ( %NWIP_CODES,       %REV_NWIP_CODES );
our ( %NWIP_FORMATS,     %REV_NWIP_FORMATS );
our ( %CCC_CODES,        %REV_CCC_CODES );
our ( %CCC_FORMATS,      %REV_CCC_FORMATS );
our ( %GEOCONF_CODES,    %REV_GEOCONF_CODES );
our ( %GEOCONF_FORMATS,  %REV_GEOCONF_FORMATS );
our ( %RELAYAGENT_CODES, %REV_RELAYAGENT_CODES );
our ( %RELAYAGENT_FORMATS, %REV_RELAYAGENT_FORMATS );
our ( %VENDOR43_CODES,   %REV_VENDOR43_CODES );
our ( %VENDOR43_FORMATS, %REV_VENDOR43_FORMATS );
our ( %SUBOPTION_CODES,  %REV_SUBOPTION_CODES );

our %EXPORT_TAGS = (
    dho_codes     => [ keys %DHO_CODES ],
    dhcp_message  => [ keys %DHCP_MESSAGE ],
    bootp_codes   => [ keys %BOOTP_CODES ],
    htype_codes   => [ keys %HTYPE_CODES ],
    nwip_codes    => [ keys %NWIP_CODES ],
    ccc_codes     => [ keys %CCC_CODES ],
    geoconf_codes => [ keys %GEOCONF_CODES ],
    ra_codes      => [ keys %RELAYAGENT_CODES ],
    vendor43_codes => [ keys %VENDOR43_CODES ],
    dhcp_hashes   => [
        qw(
          %DHO_CODES %REV_DHO_CODES
          %DHCP_MESSAGE %REV_DHCP_MESSAGE
          %BOOTP_CODES %REV_BOOTP_CODES
          %NWIP_CODES %REV_NWIP_CODES
          %NWIP_FORMATS %REV_NWIP_FORMATS
          %CCC_CODES %REV_CCC_CODES
          %CCC_FORMATS %REV_CCC_FORMATS
          %HTYPE_CODES %REV_HTYPE_CODES
          %GEOCONF_CODES %REV_GEOCONF_CODES
          %GEOCONF_FORMATS %REV_GEOCONF_FORMATS
          %RELAYAGENT_CODES %REV_RELAYAGENT_CODES
          %VENDOR43_CODES %REV_VENDOR43_CODES
          %VENDOR43_FORMATS %REV_VENDOR43_FORMATS
          %SUBOPTION_CODES %REV_SUBOPTION_CODES
          )
    ],
    dhcp_other => [
        qw(MAGIC_COOKIE MAGIC_COOKIE_LEN DHCP_UDP_OVERHEAD DHCP_MAX_MTU BOOTP_MIN_LEN BOOTP_ABSOLUTE_MIN_LEN DHCP_MIN_LEN
           ETHERNET_MAC_LEN ETHERNET_HEADER_LEN IP_HEADER_LEN UDP_HEADER_LEN
           MAX_OPTION_DATA_LEN IPV4_MAX_PREFIX_LEN BITS_PER_BYTE
           CLIENTID_TYPE_ETHER CLIENTID_TYPE_FQDN
           SIPSERV_TYPE_IPV4 SIPSERV_TYPE_FQDN)
    ]
);

our @EXPORT_OK = qw(
  %DHO_CODES %REV_DHO_CODES
  %DHCP_MESSAGE %REV_DHCP_MESSAGE
  %BOOTP_CODES %REV_BOOTP_CODES
  %NWIP_CODES %REV_NWIP_CODES
  %NWIP_FORMATS %REV_NWIP_FORMATS
  %HTYPE_CODES %REV_HTYPE_CODES
  %CCC_CODES %REV_CCC_CODES
  %CCC_FORMATS %REV_CCC_FORMATS
  %DHO_FORMATS
  %SUBOPTION_FORMATS
  %GEOCONF_CODES %REV_GEOCONF_CODES
  %GEOCONF_FORMATS %REV_GEOCONF_FORMATS
  %RELAYAGENT_CODES %REV_RELAYAGENT_CODES
  %VENDOR43_CODES %REV_VENDOR43_CODES
  %VENDOR43_FORMATS %REV_VENDOR43_FORMATS
  %SUBOPTION_CODES  %REV_SUBOPTION_CODES
  %REV_SUBOPTION_FORMATS

);
Exporter::export_tags('dho_codes');
Exporter::export_tags('dhcp_message');
Exporter::export_tags('bootp_codes');
Exporter::export_tags('htype_codes');
Exporter::export_tags('nwip_codes');
Exporter::export_tags('ccc_codes');
Exporter::export_tags('geoconf_codes');
Exporter::export_tags('vendor43_codes');
Exporter::export_ok_tags('dhcp_other');
Exporter::export_ok_tags('ra_codes');

# MAGIC_COOKIE for DHCP (otherwise it is BOOTP)
use constant MAGIC_COOKIE     => "\x63\x82\x53\x63";
use constant MAGIC_COOKIE_LEN => 4;

use constant ETHERNET_HEADER_LEN  => 14;
use constant IP_HEADER_LEN        => 20;
use constant UDP_HEADER_LEN       => 8;
use constant DHCP_UDP_OVERHEAD    => ( ETHERNET_HEADER_LEN + IP_HEADER_LEN + UDP_HEADER_LEN );
use constant DHCP_MAX_MTU           => 1500;
use constant BOOTP_ABSOLUTE_MIN_LEN => 236;
use constant BOOTP_MIN_LEN          => 300;
use constant DHCP_MIN_LEN           => 548;

use constant ETHERNET_MAC_LEN     => 6;
use constant MAX_OPTION_DATA_LEN  => 255;
use constant IPV4_MAX_PREFIX_LEN  => 32;
use constant BITS_PER_BYTE        => 8;
use constant CLIENTID_TYPE_FQDN   => 0;
use constant CLIENTID_TYPE_ETHER  => 1;
use constant SIPSERV_TYPE_FQDN    => 0;
use constant SIPSERV_TYPE_IPV4    => 1;

BEGIN {
    %BOOTP_CODES = (
        'BOOTREQUEST' => 1,
        'BOOTREPLY'   => 2,
    );

    %HTYPE_CODES = (
        'HTYPE_ETHER'   => 1,
        'HTYPE_IEEE802' => 6,
        'HTYPE_FDDI'    => 8,
        'HTYPE_INFINIBAND' => 32,
    );

    %DHO_CODES = (    # RFC 2132
        'DHO_PAD'                                  => 0,
        'DHO_SUBNET_MASK'                          => 1,
        'DHO_TIME_OFFSET'                          => 2,
        'DHO_ROUTERS'                              => 3,
        'DHO_TIME_SERVERS'                         => 4,
        'DHO_NAME_SERVERS'                         => 5,
        'DHO_DOMAIN_NAME_SERVERS'                  => 6,
        'DHO_LOG_SERVERS'                          => 7,
        'DHO_COOKIE_SERVERS'                       => 8,
        'DHO_LPR_SERVERS'                          => 9,
        'DHO_IMPRESS_SERVERS'                      => 10,
        'DHO_RESOURCE_LOCATION_SERVERS'            => 11,
        'DHO_HOST_NAME'                            => 12,
        'DHO_BOOT_SIZE'                            => 13,
        'DHO_MERIT_DUMP'                           => 14,
        'DHO_DOMAIN_NAME'                          => 15,
        'DHO_SWAP_SERVER'                          => 16,
        'DHO_ROOT_PATH'                            => 17,
        'DHO_EXTENSIONS_PATH'                      => 18,
        'DHO_IP_FORWARDING'                        => 19,
        'DHO_NON_LOCAL_SOURCE_ROUTING'             => 20,
        'DHO_POLICY_FILTER'                        => 21,
        'DHO_MAX_DGRAM_REASSEMBLY'                 => 22,
        'DHO_DEFAULT_IP_TTL'                       => 23,
        'DHO_PATH_MTU_AGING_TIMEOUT'               => 24,
        'DHO_PATH_MTU_PLATEAU_TABLE'               => 25,
        'DHO_INTERFACE_MTU'                        => 26,
        'DHO_ALL_SUBNETS_LOCAL'                    => 27,
        'DHO_BROADCAST_ADDRESS'                    => 28,
        'DHO_PERFORM_MASK_DISCOVERY'               => 29,
        'DHO_MASK_SUPPLIER'                        => 30,
        'DHO_ROUTER_DISCOVERY'                     => 31,
        'DHO_ROUTER_SOLICITATION_ADDRESS'          => 32,
        'DHO_STATIC_ROUTES'                        => 33,
        'DHO_TRAILER_ENCAPSULATION'                => 34,
        'DHO_ARP_CACHE_TIMEOUT'                    => 35,
        'DHO_IEEE802_3_ENCAPSULATION'              => 36,
        'DHO_DEFAULT_TCP_TTL'                      => 37,
        'DHO_TCP_KEEPALIVE_INTERVAL'               => 38,
        'DHO_TCP_KEEPALIVE_GARBAGE'                => 39,
        'DHO_NIS_DOMAIN'                           => 40,
        'DHO_NIS_SERVERS'                          => 41,
        'DHO_NTP_SERVERS'                          => 42,
        'DHO_VENDOR_ENCAPSULATED_OPTIONS'          => 43,
        'DHO_NETBIOS_NAME_SERVERS'                 => 44,
        'DHO_NETBIOS_DD_SERVER'                    => 45,
        'DHO_NETBIOS_NODE_TYPE'                    => 46,
        'DHO_NETBIOS_SCOPE'                        => 47,
        'DHO_FONT_SERVERS'                         => 48,
        'DHO_X_DISPLAY_MANAGER'                    => 49,
        'DHO_DHCP_REQUESTED_ADDRESS'               => 50,
        'DHO_DHCP_LEASE_TIME'                      => 51,
        'DHO_DHCP_OPTION_OVERLOAD'                 => 52,
        'DHO_DHCP_MESSAGE_TYPE'                    => 53,
        'DHO_DHCP_SERVER_IDENTIFIER'               => 54,
        'DHO_DHCP_PARAMETER_REQUEST_LIST'          => 55,
        'DHO_DHCP_MESSAGE'                         => 56,
        'DHO_DHCP_MAX_MESSAGE_SIZE'                => 57,
        'DHO_DHCP_RENEWAL_TIME'                    => 58,
        'DHO_DHCP_REBINDING_TIME'                  => 59,
        'DHO_VENDOR_CLASS_IDENTIFIER'              => 60,
        'DHO_DHCP_CLIENT_IDENTIFIER'               => 61,
        'DHO_NWIP_DOMAIN_NAME'                     => 62,
        'DHO_NWIP_SUBOPTIONS'                      => 63,
        'DHO_NISV3_DOMAIN'                         => 64,
        'DHO_NISV3_SERVER'                         => 65,
        'DHO_TFTP_SERVER'                          => 66, # actually named 'server name' by IANA
        'DHO_BOOTFILE'                             => 67,
        'DHO_MOBILE_IP_HOME_AGENT'                 => 68,
        'DHO_SMTP_SERVER'                          => 69,
        'DHO_POP3_SERVER'                          => 70,
        'DHO_NNTP_SERVER'                          => 71,
        'DHO_WWW_SERVER'                           => 72,
        'DHO_FINGER_SERVER'                        => 73,
        'DHO_IRC_SERVER'                           => 74,
        'DHO_STREETTALK_SERVER'                    => 75,
        'DHO_STDA_SERVER'                          => 76,
        'DHO_USER_CLASS'                           => 77,
        'DHO_DIRECTORY_AGENT'                      => 78,
        'DHO_SERVICE_SCOPE'                        => 79,
        'DHO_RAPID_COMMIT'                         => 80,
        'DHO_FQDN'                                 => 81,
        'DHO_DHCP_AGENT_OPTIONS'                   => 82,
        'DHO_ISNS'                                 => 83,
        'DHO_NDS_SERVERS'                          => 85,
        'DHO_NDS_TREE_NAME'                        => 86,
        'DHO_NDS_CONTEXT'                          => 87,
        'DHO_BCMCS_CONTROLLER_DOMAIN_NAME_LIST'    => 88,
        'DHO_BCMCS_CONTROLLER_IPV4_ADDRESS'        => 89,
        'DHO_AUTHENTICATION'                       => 90,
        'DHO_CLIENT_LAST_TRANSACTION_TIME'         => 91,
        'DHO_ASSOCIATED_IP'                        => 92,
        'DHO_CLIENT_SYSTEM'                        => 93,
        'DHO_CLIENT_NDI'                           => 94,
        'DHO_LDAP'                                 => 95,
        'DHO_UUID_GUID'                            => 97,
        'DHO_USER_AUTHENTICATION_PROTOCOL'         => 98,
        'DHO_GEOCONF_CIVIC'                        => 99,
        'DHO_PCODE'                                => 100,
        'DHO_TCODE'                                => 101,
        'DHO_NETINFO_ADDRESS'                      => 112,
        'DHO_NETINFO_TAG'                          => 113,
        'DHO_URL'                                  => 114,
        'DHO_AUTO_CONFIGURE'                       => 116,
        'DHO_NAME_SERVICE_SEARCH'                  => 117,
        'DHO_SUBNET_SELECTION'                     => 118,
        'DHO_DOMAIN_SEARCH'                        => 119,
        'DHO_SIP_SERVERS'                          => 120,
        'DHO_CLASSLESS_STATIC_ROUTE'               => 121,
        'DHO_CCC'                                  => 122,
        'DHO_GEOCONF'                              => 123,
        'DHO_VI_VENDOR_CLASS'                      => 124,
        'DHO_VI_VENDOR_SPECIFIC_INFOMATION'        => 125,
        'DHO_DOCSIS_FULL_SECURITY_SERVER_ADDRESS'  => 128,
        'DHO_TFTP_SERVER_IPPHONE'                  => 128,
        'DHO_ETHERBOOT_SIGNATURE'                  => 128,
        'DHO_CALL_SERVER_ADDRESS'                  => 129,
        'DHO_KERNEL_OPTIONS'                       => 129,
        'DHO_DISCRIMINATION_STRING'                => 130,
        'DHO_ETHERNET_INTERFACE'                   => 130,
        'DHO_REMOTE_STATISTICS_SERVER'             => 131,
        'DHO_VLAN_ID'                              => 132,
        'DHO_L2_PRIORITY'                          => 133,
        'DHO_DSCP'                                 => 134,
        'DHO_PXE'                                  => 135,
        'DHO_HTTP_PROXY_FORPHONES'                 => 135,

        'DHO_OPTION_PANA_AGENT'                    => 136,
        'DHO_OPTION_PANA_V4_LOST'                  => 137,
        'DHO_OPTION_CAPWAP_AC_V4'                  => 138,
        'DHO_OPTION_IPV4_ADDRESS_MOS'              => 139,
        'DHO_OPTION_IPV4_FQDN_MOS'                 => 140,
        'DHO_SIP_UA_CONFIGURATION_SERVICE_DOMAINS' => 141,
        'DHO_GRUB_CONF_PATH'                       => 150,
        'DHO_TFTP_SERVER_ADDRESS'                  => 150,    # not to be confused with 66
        'DHO_ETHERBOOT'                            => 150,
        'DHO_IP_TELEPHONE'                         => 176,
        'DHO_PACKETCABLE_DEPRECATED'               => 177,
        'DHO_ETHERBOOT_TENTATIVE'                  => 177,
        'DHO_PXELINUX_MAGIC'                       => 208,
        'DHO_CONFIGURATION_FILE'                   => 209,
        'DHO_PATH_PREFIX'                          => 210,
        'DHO_REBOOT_TIME'                          => 211,
        'DHO_OPTION_6RD'                           => 212,
        'DHO_OPTION_V4_ACCESS_DOMAIN'              => 213,
        'DHO_SUBNET_ALLOCATION'                    => 220,
        'DHO_VIRTUAL_SUBNET'                       => 221,

        'DHO_CLASSLESS_STATIC_ROUTE_MS'            => 249,

        'DHO_END' => 255
    );

    # Type 53 codes...
    %DHCP_MESSAGE = (

        # RFC2132
        'DHCPDISCOVER'   => 1,
        'DHCPOFFER'      => 2,
        'DHCPREQUEST'    => 3,
        'DHCPDECLINE'    => 4,
        'DHCPACK'        => 5,
        'DHCPNAK'        => 6,
        'DHCPRELEASE'    => 7,
        'DHCPINFORM'     => 8,
        'DHCPFORCERENEW' => 9,

        # RFC4388
        'DHCPLEASEQUERY'      => 10
        , # This is now ratified in RFC4388. If you have an old crappy CMTS you might need to change it with 13
        'DHCPLEASEUNASSIGNED' => 11,
        'DHCPLEASEUNKNOWN'    => 12,
        'DHCPLEASEACTIVE'     => 13,

    );

    # Type 63 sub-option codes...
    %NWIP_CODES = (
        'NWIP_DOES_NOT_EXIST'        => 1,
        'NWIP_EXIST_IN_OPTIONS_AREA' => 2,
        'NWIP_EXIST_IN_SNAME_FILE'   => 3,
        'NWIP_EXIST_BUT_TOO_BIG'     => 4,
        'NWIP_NSQ_BROADCAST'         => 5,
        'NWIP_PREFERRED_DSS'         => 6,
        'NWIP_NEAREST_NWIP_SERVER'   => 7,
        'NWIP_AUTORETRIES'           => 8,
        'NWIP_AUTORETRY_SECS'        => 9,
        'NWIP_1_1'                   => 10,
        'NWIP_PRIMARY_DSS'           => 11,

        #'Unassigned' => '12-255'
    );

    # Type 122 sub option codes
    %CCC_CODES = (
        'CCC_PRIMARY_DHCP_SERVER'        => 1,
        'CCC_SECONDARY_DHCP_SERVER'      => 2,
        'CCC_PROVISIONING_SERVER'        => 3,
        'CCC_AS_REQ_AS_REP_BACKOFFRETRY' => 4,
        'CCC_AP_REQ_AS_REP_BACKOFFRETRY' => 5,
        'CCC_KERBEROS_REALM'             => 6,
        'CCC_TICKET_SERVER_UTILIZATION'  => 7,
        'CCC_PROVISIONING_TIMER'         => 8,
        'CCC_SECURITY_TICKET_CONTROL'    => 9,
        'CCC_KDC_SERVER'                 => 10,
    );

    # CableLabs DOCSIS sub-option codes for option 43 (vendor encapsulated)
    %VENDOR43_CODES = (
        'VENDOR43_DEVICE_TYPE'           => 2,
        'VENDOR43_ECM'                   => 3,
        'VENDOR43_SERIAL_NUMBER'         => 4,
        'VENDOR43_HW_VERSION'            => 5,
        'VENDOR43_SW_VERSION'            => 6,
        'VENDOR43_BOOT_ROM_VERSION'      => 7,
        'VENDOR43_OUI'                   => 8,
        'VENDOR43_MODEL_NUMBER'          => 9,
        'VENDOR43_VENDOR_NAME'           => 10,
        'VENDOR43_PS_WAN_MAN_DATA'       => 11,
        'VENDOR43_CM_PS_SYSTEM_DESC'     => 12,
        'VENDOR43_CM_PS_FIRMWARE_REV'    => 13,
        'VENDOR43_FIREWALL_POLICY_FILE'  => 14,
        'VENDOR43_ESAFES'                => 15,
        'VENDOR43_DEVICE_TPID'           => 16,
        'VENDOR43_DEVICE_SMID'           => 17,
        'VENDOR43_VIDEOSECURITYELEMENT'  => 18,
        'VENDOR43_MTA_MAC_ADDRESS'       => 31,
        'VENDOR43_MTA_CORRELATION_ID'    => 32,
        'VENDOR43_CARD_VENDOR_NAME'      => 51,
        'VENDOR43_CARD_CAPABILITY'       => 52,
        'VENDOR43_CARD_VENDOR_DEVICE_ID' => 53,
        'VENDOR43_CARD_ID'               => 54,
    );

    # Type 123 sub option codes (there are more, but im not sure how to deal with them)
    %GEOCONF_CODES = (
        'GEO_METERS' => 1,
        'GEO_FLOORS' => 2,
    );

    # Type 82 sub option codes
    %RELAYAGENT_CODES = (
        'RAI_CIRCUIT_ID'         => 1,
        'RAI_REMOTE_ID'          => 2,
        'RAI_AGENT_ID'           => 3,
        'RAI_DOCSIS_CLASS'       => 4,
        'RAI_LINK_SELECTION'     => 5,
        'RAI_SUBSCRIBER_ID'      => 6,
        'RAI_RADIUS_ATTRIBUTES'  => 7,
        'RAI_AUTHENTICATION'     => 8,
        'RAI_VENDOR_INFO'        => 9,
        'RAI_FLAGS'              => 10,
        'RAI_SERVER_ID_OVERRIDE' => 11,
        'RAI_DHCPV4_VIRTUAL_SUBNET_SELECTION' => 151, # rfc 6607
        'RAI_DHCPV4_VIRTUAL_SUBNET_SELECTION_CONTROL' => 152, # rfc 6607
    );
}

use constant \%DHO_CODES;
%REV_DHO_CODES = reverse %DHO_CODES;

use constant \%DHCP_MESSAGE;
%REV_DHCP_MESSAGE = reverse %DHCP_MESSAGE;

use constant \%BOOTP_CODES;
%REV_BOOTP_CODES = reverse %BOOTP_CODES;    # for reverse lookup

use constant \%HTYPE_CODES;
%REV_HTYPE_CODES = reverse %HTYPE_CODES;    # for reverse lookup

use constant \%NWIP_CODES;
%REV_NWIP_CODES = reverse %NWIP_CODES;

%NWIP_FORMATS = (
    NWIP_DOES_NOT_EXIST()        => 'byte',
    NWIP_EXIST_IN_OPTIONS_AREA() => 'byte',
    NWIP_EXIST_IN_SNAME_FILE()   => 'byte',
    NWIP_EXIST_BUT_TOO_BIG()     => 'byte',
    NWIP_NSQ_BROADCAST()         => 'byte',
    NWIP_PREFERRED_DSS()         => 'inet',
    NWIP_NEAREST_NWIP_SERVER()   => 'inet',
    NWIP_AUTORETRIES()           => 'byte',
    NWIP_AUTORETRY_SECS()        => 'byte',
    NWIP_1_1()                   => 'byte',
    NWIP_PRIMARY_DSS()           => 'inet',
);
%REV_NWIP_FORMATS = reverse %NWIP_FORMATS;

use constant \%CCC_CODES;
%REV_CCC_CODES = reverse %CCC_CODES;

use constant \%GEOCONF_CODES;
%REV_GEOCONF_CODES = reverse %GEOCONF_CODES;

use constant \%RELAYAGENT_CODES;
%REV_RELAYAGENT_CODES = reverse %RELAYAGENT_CODES;

use constant \%RELAYAGENT_FORMATS;

#
# Format of DHCP options : for pretty-printing
#   void : no parameter
#   inet : 4 bytes IP address
#   inets : list of 4 bytes IP addresses
#   inets2 : list of 4 bytes IP addresses pairs (multiple of 8 bytes)
#   int : 4 bytes integer
#   short : 2 bytes integer
#   shorts : list of 2 bytes integers
#   byte : 1 byte int
#   bytes : list of 1 byte code
#   string : char* (just kidding)
#   relays : DHCP sub-options (rfc 3046)
#   ids : client identifier : byte (htype) + string (chaddr)
#   csr : classless static routes (rfc 3442)
#   suboptions : hex encoded sub options
#
our %DHO_FORMATS = (
    DHO_PAD()                         => 'void',
    DHO_SUBNET_MASK()                 => 'inet',
    DHO_TIME_OFFSET()                 => 'int',
    DHO_ROUTERS()                     => 'inets',
    DHO_TIME_SERVERS()                => 'inets',
    DHO_NAME_SERVERS()                => 'inets',
    DHO_DOMAIN_NAME_SERVERS()         => 'inets',
    DHO_LOG_SERVERS()                 => 'inets',
    DHO_COOKIE_SERVERS()              => 'inets',
    DHO_LPR_SERVERS()                 => 'inets',
    DHO_IMPRESS_SERVERS()             => 'inets',
    DHO_RESOURCE_LOCATION_SERVERS()   => 'inets',
    DHO_HOST_NAME()                   => 'string',
    DHO_BOOT_SIZE()                   => 'short',
    DHO_MERIT_DUMP()                  => 'string',
    DHO_DOMAIN_NAME()                 => 'string',
    DHO_SWAP_SERVER()                 => 'inet',
    DHO_ROOT_PATH()                   => 'string',
    DHO_EXTENSIONS_PATH()             => 'string',
    DHO_IP_FORWARDING()               => 'byte',
    DHO_NON_LOCAL_SOURCE_ROUTING()    => 'byte',
    DHO_POLICY_FILTER()               => 'inets2',
    DHO_MAX_DGRAM_REASSEMBLY()        => 'short',
    DHO_DEFAULT_IP_TTL()              => 'byte',
    DHO_PATH_MTU_AGING_TIMEOUT()      => 'int',
    DHO_PATH_MTU_PLATEAU_TABLE()      => 'shorts',
    DHO_INTERFACE_MTU()               => 'short',
    DHO_ALL_SUBNETS_LOCAL()           => 'byte',
    DHO_BROADCAST_ADDRESS()           => 'inet',
    DHO_PERFORM_MASK_DISCOVERY()      => 'byte',
    DHO_MASK_SUPPLIER()               => 'byte',
    DHO_ROUTER_DISCOVERY()            => 'byte',
    DHO_ROUTER_SOLICITATION_ADDRESS() => 'inet',
    DHO_STATIC_ROUTES()               => 'inets2',
    DHO_TRAILER_ENCAPSULATION()       => 'byte',
    DHO_ARP_CACHE_TIMEOUT()           => 'int',
    DHO_IEEE802_3_ENCAPSULATION()     => 'byte',
    DHO_DEFAULT_TCP_TTL()             => 'byte',
    DHO_TCP_KEEPALIVE_INTERVAL()      => 'int',
    DHO_TCP_KEEPALIVE_GARBAGE()       => 'byte',
    DHO_NIS_DOMAIN()                  => 'string',
    DHO_NIS_SERVERS()                 => 'inets',
    DHO_NTP_SERVERS()                 => 'inets',

    DHO_VENDOR_ENCAPSULATED_OPTIONS() => 'suboptions',
    DHO_NETBIOS_NAME_SERVERS()        => 'inets',
    DHO_NETBIOS_DD_SERVER()           => 'inets',
    DHO_NETBIOS_NODE_TYPE()           => 'byte',
    DHO_NETBIOS_SCOPE()               => 'string',
    DHO_FONT_SERVERS()                => 'inets',
    DHO_X_DISPLAY_MANAGER()           => 'inets',
    DHO_DHCP_REQUESTED_ADDRESS()      => 'inet',
    DHO_DHCP_LEASE_TIME()             => 'int',
    DHO_DHCP_OPTION_OVERLOAD()        => 'byte',
    DHO_DHCP_MESSAGE_TYPE()           => 'byte',
    DHO_DHCP_SERVER_IDENTIFIER()      => 'inet',
    DHO_DHCP_PARAMETER_REQUEST_LIST() => 'bytes',
    DHO_DHCP_MESSAGE()                => 'string',
    DHO_DHCP_MAX_MESSAGE_SIZE()       => 'short',
    DHO_DHCP_RENEWAL_TIME()           => 'int',
    DHO_DHCP_REBINDING_TIME()         => 'int',
    DHO_VENDOR_CLASS_IDENTIFIER()     => 'string',

    DHO_DHCP_CLIENT_IDENTIFIER()      => 'clientid',  # rfc 2132 section 9.14
    DHO_NWIP_DOMAIN_NAME()            => 'string',    # rfc 2242

    DHO_NWIP_SUBOPTIONS()             => 'suboptions',                    # rfc 2242
    DHO_NISV3_DOMAIN()                => 'string',
    DHO_NISV3_SERVER()                => 'string',
    DHO_TFTP_SERVER()                 => 'string',
    DHO_BOOTFILE()                    => 'string', # 67
    DHO_MOBILE_IP_HOME_AGENT()        => 'inets',
    DHO_SMTP_SERVER()                 => 'inets',
    DHO_POP3_SERVER()                 => 'inets',
    DHO_NNTP_SERVER()                 => 'inets',
    DHO_WWW_SERVER()                  => 'inets',
    DHO_FINGER_SERVER()               => 'inets',
    DHO_IRC_SERVER()                  => 'inets',
    DHO_STREETTALK_SERVER()           => 'inets',
    DHO_STDA_SERVER()                 => 'inets',

    DHO_SIP_SERVERS()                 => 'sipserv',
    DHO_CLASSLESS_STATIC_ROUTE()      => 'csr',        # rfc 3442
    DHO_CCC()                         => 'suboptions', # 122
    DHO_GEOCONF()                     => 'suboptions', # rfc 6225

    DHO_USER_CLASS()                  => 'userclass',  # rfc 3004
#    DHO_FQDN()  => '',                              # draft-ietf-dhc-fqdn-option-10.txt
    DHO_DHCP_AGENT_OPTIONS()           => 'suboptions', # rfc 3046
#    DHO_DHCP_AGENT_OPTIONS()           => 'string',    # rfc 3046
    DHO_NDS_SERVERS()                  => 'inets',     # rfc 2241
    DHO_NDS_TREE_NAME()                => 'string',    # rfc 2241
    DHO_USER_AUTHENTICATION_PROTOCOL() => 'string',    # rfc 2485
    DHO_AUTO_CONFIGURE()               => 'byte',      # rfc 2563
    DHO_NAME_SERVICE_SEARCH()          => 'shorts',    # rfc 2937
    DHO_SUBNET_SELECTION()             => 'inet',      # rfc 3011

    DHO_CLASSLESS_STATIC_ROUTE_MS()   => 'csr',
    DHO_PACKETCABLE_DEPRECATED()       => 'hexa',      # rfc 3495
);

%RELAYAGENT_FORMATS = (
        RAI_CIRCUIT_ID()                              => 'circuit_id',
        RAI_REMOTE_ID()                               => 'remote_id',
        RAI_AGENT_ID()                                => 'hexa',
        RAI_DOCSIS_CLASS()                            => 'hexa',
        RAI_LINK_SELECTION()                          => 'inet',
        RAI_SUBSCRIBER_ID()                           => 'string',
        RAI_RADIUS_ATTRIBUTES()                       => 'hexa',
        RAI_AUTHENTICATION()                          => 'hexa',
        RAI_VENDOR_INFO()                             => 'hexa',
        RAI_FLAGS()                                   => 'byte',
        RAI_SERVER_ID_OVERRIDE()                      => 'inet',
        RAI_DHCPV4_VIRTUAL_SUBNET_SELECTION()         => 'hexa',
        RAI_DHCPV4_VIRTUAL_SUBNET_SELECTION_CONTROL() => 'hexa',
),

%REV_RELAYAGENT_FORMATS = reverse %RELAYAGENT_FORMATS;

%GEOCONF_FORMATS = (
    GEO_METERS() => 'int',   # altitude in meters (u32)
    GEO_FLOORS() => 'byte',  # floor number
);

%REV_GEOCONF_FORMATS = reverse %GEOCONF_FORMATS;

%CCC_FORMATS = (
    CCC_PRIMARY_DHCP_SERVER()        => 'inet',    # rfc 3495
    CCC_SECONDARY_DHCP_SERVER()      => 'inet',
    CCC_PROVISIONING_SERVER()        => 'inet',
    CCC_AS_REQ_AS_REP_BACKOFFRETRY() => 'hexa',    # two u16 values
    CCC_AP_REQ_AS_REP_BACKOFFRETRY() => 'hexa',    # two u16 values
    CCC_KERBEROS_REALM()             => 'string',
    CCC_TICKET_SERVER_UTILIZATION()  => 'byte',
    CCC_PROVISIONING_TIMER()         => 'int',      # seconds (u32)
    CCC_SECURITY_TICKET_CONTROL()    => 'byte',
    CCC_KDC_SERVER()                 => 'inet',
);

%REV_CCC_FORMATS = reverse %CCC_FORMATS;

use constant \%VENDOR43_CODES;
%REV_VENDOR43_CODES = reverse %VENDOR43_CODES;

%VENDOR43_FORMATS = (
    VENDOR43_DEVICE_TYPE()           => 'byte',
    VENDOR43_ECM()                   => 'byte',
    VENDOR43_SERIAL_NUMBER()         => 'string',
    VENDOR43_HW_VERSION()            => 'string',
    VENDOR43_SW_VERSION()            => 'string',
    VENDOR43_BOOT_ROM_VERSION()      => 'string',
    VENDOR43_OUI()                   => 'hexa',
    VENDOR43_MODEL_NUMBER()          => 'string',
    VENDOR43_VENDOR_NAME()           => 'string',
    VENDOR43_PS_WAN_MAN_DATA()       => 'hexa',
    VENDOR43_CM_PS_SYSTEM_DESC()     => 'string',
    VENDOR43_CM_PS_FIRMWARE_REV()    => 'string',
    VENDOR43_FIREWALL_POLICY_FILE()  => 'string',
    VENDOR43_ESAFES()                => 'hexa',
    VENDOR43_DEVICE_TPID()           => 'hexa',
    VENDOR43_DEVICE_SMID()           => 'hexa',
    VENDOR43_VIDEOSECURITYELEMENT()  => 'hexa',
    VENDOR43_MTA_MAC_ADDRESS()       => 'hexa',
    VENDOR43_MTA_CORRELATION_ID()    => 'string',
    VENDOR43_CARD_VENDOR_NAME()      => 'string',
    VENDOR43_CARD_CAPABILITY()       => 'hexa',
    VENDOR43_CARD_VENDOR_DEVICE_ID() => 'hexa',
    VENDOR43_CARD_ID()               => 'string',
);
%REV_VENDOR43_FORMATS = reverse %VENDOR43_FORMATS;

our %SUBOPTION_FORMATS = (
    $DHO_CODES{'DHO_DHCP_AGENT_OPTIONS'}    => \%RELAYAGENT_FORMATS,
    $DHO_CODES{'DHO_GEOCONF'}               => \%GEOCONF_FORMATS,
    $DHO_CODES{'DHO_NWIP_SUBOPTIONS'}        => \%NWIP_FORMATS,
    $DHO_CODES{'DHO_CCC'}                    => \%CCC_FORMATS,
    $DHO_CODES{'DHO_VENDOR_ENCAPSULATED_OPTIONS'} => \%VENDOR43_FORMATS,
);

our %REV_SUBOPTION_FORMATS = (
    $DHO_CODES{'DHO_DHCP_AGENT_OPTIONS'}    => \%REV_RELAYAGENT_FORMATS,
    $DHO_CODES{'DHO_GEOCONF'}               => \%REV_GEOCONF_FORMATS,
    $DHO_CODES{'DHO_NWIP_SUBOPTIONS'}        => \%REV_NWIP_FORMATS,
    $DHO_CODES{'DHO_CCC'}                    => \%REV_CCC_FORMATS,
    $DHO_CODES{'DHO_VENDOR_ENCAPSULATED_OPTIONS'} => \%REV_VENDOR43_FORMATS,
);

# Links option codes with their suboption values
%SUBOPTION_CODES = (
    $DHO_CODES{'DHO_NWIP_SUBOPTIONS'}    => \%NWIP_CODES, # option 63
    $DHO_CODES{'DHO_DHCP_AGENT_OPTIONS'} => \%RELAYAGENT_CODES, # option 82
    $DHO_CODES{'DHO_CCC'}                => \%CCC_CODES,  # option 122
    $DHO_CODES{'DHO_GEOCONF'}            => \%GEOCONF_CODES, # option 123
    $DHO_CODES{'DHO_VENDOR_ENCAPSULATED_OPTIONS'} => \%VENDOR43_CODES, # option 43
);

# Links option codes with their reverse suboption values
%REV_SUBOPTION_CODES = (
    $DHO_CODES{'DHO_NWIP_SUBOPTIONS'}    => \%REV_NWIP_CODES, # option 63
    $DHO_CODES{'DHO_DHCP_AGENT_OPTIONS'} => \%REV_RELAYAGENT_CODES, # option 82
    $DHO_CODES{'DHO_CCC'}                => \%REV_CCC_CODES,  # option 122
    $DHO_CODES{'DHO_GEOCONF'}            => \%REV_GEOCONF_CODES, # option 123
    $DHO_CODES{'DHO_VENDOR_ENCAPSULATED_OPTIONS'} => \%REV_VENDOR43_CODES, # option 43
);

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

Net::DHCP::Constants - Constants for DHCP codes and options

=head1 VERSION

version 0.9

=head1 SYNOPSIS

    use Net::DHCP::Constants;
    print "DHCP option SUBNET_MASK is ", DHO_SUBNET_MASK();

=head1 DESCRIPTION

Represents constants used in DHCP protocol, defined in RFC 1533, RFC 2132,
RFC 2241, RFC 2485, RFC 2563, RFC 2937, RFC 3004, RFC 3011, RFC 3046.

=head1 TAGS

Constants can either be imported individually or in sets grouped by tag names.
The tag names are:

=over 4

=item * bootp_codes

Imports all of the basic I<BOOTP> constants.

    (01) BOOTREQUEST
    (02) BOOTREPLY

=item * htype_codes

Imports all I<HTYPE> (hardware address type) codes.

    (01) HTYPE_ETHER
    (06) HTYPE_IEEE802
    (08) HTYPE_FDDI

Most common value is HTYPE_ETHER for C<Ethernet>.

=item * dhcp_message

Import all DHCP Message codes.

(rfc2132)

    (01) DHCPDISCOVER
    (02) DHCPOFFER
    (03) DHCPREQUEST
    (04) DHCPDECLINE
    (05) DHCPACK
    (06) DHCPNAK
    (07) DHCPRELEASE
    (08) DHCPINFORM
    (09) DHCPFORCERENEW

(rfc4388)

    (10) DHCPLEASEQUERY
    (11) DHCPLEASEUNASSIGNED
    (12) DHCPLEASEUNKNOWN
    (13) DHCPLEASEACTIVE

Nb. Previously Cisco used 13 for DHCPLEASEQUERY. If you need to decode
or encode packets to communicate with such a system, you might simply
use the integer rather than the constant - or use the updated constant
and comment in your code appropriately.

=item * nwip_codes

Import all NWIP suboption codes for option 63 (rfc 2242).
Format types are shown in parentheses.

    (001) NWIP_DOES_NOT_EXIST        (byte)
    (002) NWIP_EXIST_IN_OPTIONS_AREA (byte)
    (003) NWIP_EXIST_IN_SNAME_FILE   (byte)
    (004) NWIP_EXIST_BUT_TOO_BIG     (byte)
    (005) NWIP_NSQ_BROADCAST         (byte)
    (006) NWIP_PREFERRED_DSS         (inet)
    (007) NWIP_NEAREST_NWIP_SERVER   (inet)
    (008) NWIP_AUTORETRIES           (byte)
    (009) NWIP_AUTORETRY_SECS        (byte)
    (010) NWIP_1_1                   (byte)
    (011) NWIP_PRIMARY_DSS           (inet)

=item * geoconf_codes

Import all GEOCONF suboption codes for option 123 (rfc 6225).
Format types are shown in parentheses.

    (001) GEO_METERS (int)
    (002) GEO_FLOORS (byte)

=item * dho_codes

Import all DHCP option codes.

    (000) DHO_PAD
    (001) DHO_SUBNET_MASK
    (002) DHO_TIME_OFFSET
    (003) DHO_ROUTERS
    (004) DHO_TIME_SERVERS
    (005) DHO_NAME_SERVERS
    (006) DHO_DOMAIN_NAME_SERVERS
    (007) DHO_LOG_SERVERS
    (008) DHO_COOKIE_SERVERS
    (009) DHO_LPR_SERVERS
    (010) DHO_IMPRESS_SERVERS
    (011) DHO_RESOURCE_LOCATION_SERVERS
    (012) DHO_HOST_NAME
    (013) DHO_BOOT_SIZE
    (014) DHO_MERIT_DUMP
    (015) DHO_DOMAIN_NAME
    (016) DHO_SWAP_SERVER
    (017) DHO_ROOT_PATH
    (018) DHO_EXTENSIONS_PATH
    (019) DHO_IP_FORWARDING
    (020) DHO_NON_LOCAL_SOURCE_ROUTING
    (021) DHO_POLICY_FILTER
    (022) DHO_MAX_DGRAM_REASSEMBLY
    (023) DHO_DEFAULT_IP_TTL
    (024) DHO_PATH_MTU_AGING_TIMEOUT
    (025) DHO_PATH_MTU_PLATEAU_TABLE
    (026) DHO_INTERFACE_MTU
    (027) DHO_ALL_SUBNETS_LOCAL
    (028) DHO_BROADCAST_ADDRESS
    (029) DHO_PERFORM_MASK_DISCOVERY
    (030) DHO_MASK_SUPPLIER
    (031) DHO_ROUTER_DISCOVERY
    (032) DHO_ROUTER_SOLICITATION_ADDRESS
    (033) DHO_STATIC_ROUTES
    (034) DHO_TRAILER_ENCAPSULATION
    (035) DHO_ARP_CACHE_TIMEOUT
    (036) DHO_IEEE802_3_ENCAPSULATION
    (037) DHO_DEFAULT_TCP_TTL
    (038) DHO_TCP_KEEPALIVE_INTERVAL
    (039) DHO_TCP_KEEPALIVE_GARBAGE
    (040) DHO_NIS_DOMAIN
    (041) DHO_NIS_SERVERS
    (042) DHO_NTP_SERVERS
    (043) DHO_VENDOR_ENCAPSULATED_OPTIONS
    (044) DHO_NETBIOS_NAME_SERVERS
    (045) DHO_NETBIOS_DD_SERVER
    (046) DHO_NETBIOS_NODE_TYPE
    (047) DHO_NETBIOS_SCOPE
    (048) DHO_FONT_SERVERS
    (049) DHO_X_DISPLAY_MANAGER
    (050) DHO_DHCP_REQUESTED_ADDRESS
    (051) DHO_DHCP_LEASE_TIME
    (052) DHO_DHCP_OPTION_OVERLOAD
    (053) DHO_DHCP_MESSAGE_TYPE
    (054) DHO_DHCP_SERVER_IDENTIFIER
    (055) DHO_DHCP_PARAMETER_REQUEST_LIST
    (056) DHO_DHCP_MESSAGE
    (057) DHO_DHCP_MAX_MESSAGE_SIZE
    (058) DHO_DHCP_RENEWAL_TIME
    (059) DHO_DHCP_REBINDING_TIME
    (060) DHO_VENDOR_CLASS_IDENTIFIER
    (061) DHO_DHCP_CLIENT_IDENTIFIER
    (062) DHO_NWIP_DOMAIN_NAME
    (063) DHO_NWIP_SUBOPTIONS
    (064) DHO_NISV3_DOMAIN
    (065) DHO_NISV3_SERVER
    (066) DHO_TFTP_SERVER
    (067) DHO_BOOTFILE
    (068) DHO_MOBILE_IP_HOME_AGENT
    (069) DHO_SMTP_SERVER
    (070) DHO_POP3_SERVER
    (071) DHO_NNTP_SERVER
    (072) DHO_WWW_SERVER
    (073) DHO_FINGER_SERVER
    (074) DHO_IRC_SERVER
    (075) DHO_STREETTALK_SERVER
    (076) DHO_STDA_SERVER
    (077) DHO_USER_CLASS
    (078) DHO_DIRECTORY_AGENT
    (079) DHO_SERVICE_SCOPE
    (080) DHO_RAPID_COMMIT
    (081) DHO_FQDN
    (082) DHO_DHCP_AGENT_OPTIONS
    (083) DHO_ISNS
    (085) DHO_NDS_SERVERS
    (086) DHO_NDS_TREE_NAME
    (087) DHO_NDS_CONTEXT
    (088) DHO_BCMCS_CONTROLLER_DOMAIN_NAME_LIST
    (089) DHO_BCMCS_CONTROLLER_IPV4_ADDRESS
    (090) DHO_AUTHENTICATION
    (091) DHO_CLIENT_LAST_TRANSACTION_TIME
    (092) DHO_ASSOCIATED_IP
    (093) DHO_CLIENT_SYSTEM
    (094) DHO_CLIENT_NDI
    (095) DHO_LDAP
    (097) DHO_UUID_GUID
    (098) DHO_USER_AUTHENTICATION_PROTOCOL
    (099) DHO_GEOCONF_CIVIC
    (100) DHO_PCODE
    (101) DHO_TCODE
    (112) DHO_NETINFO_ADDRESS
    (113) DHO_NETINFO_TAG
    (114) DHO_URL
    (116) DHO_AUTO_CONFIGURE
    (117) DHO_NAME_SERVICE_SEARCH
    (118) DHO_SUBNET_SELECTION
    (119) DHO_DOMAIN_SEARCH
    (120) DHO_SIP_SERVERS
    (121) DHO_CLASSLESS_STATIC_ROUTE
    (122) DHO_CCC
    (123) DHO_GEOCONF
    (124) DHO_VI_VENDOR_CLASS
    (125) DHO_VI_VENDOR_SPECIFIC_INFOMATION
    (128) DHO_ETHERBOOT_SIGNATURE
    (129) DHO_CALL_SERVER_ADDRESS
    (130) DHO_DISCRIMINATION_STRING
    (131) DHO_REMOTE_STATISTICS_SERVER
    (132) DHO_VLAN_ID
    (133) DHO_L2_PRIORITY
    (134) DHO_DSCP
    (135) DHO_HTTP_PROXY_FORPHONES
    (136) DHO_OPTION_PANA_AGENT
    (137) DHO_OPTION_PANA_V4_LOST
    (138) DHO_OPTION_CAPWAP_AC_V4
    (139) DHO_OPTION_IPV4_ADDRESS_MOS
    (140) DHO_OPTION_IPV4_FQDN_MOS
    (141) DHO_SIP_UA_CONFIGURATION_SERVICE_DOMAINS
    (150) DHO_ETHERBOOT
    (176) DHO_IP_TELEPHONE
    (177) DHO_PACKETCABLE_DEPRECATED
    (208) DHO_PXELINUX_MAGIC
    (209) DHO_CONFIGURATION_FILE
    (210) DHO_PATH_PREFIX
    (211) DHO_REBOOT_TIME
    (212) DHO_OPTION_6RD
    (213) DHO_OPTION_V4_ACCESS_DOMAIN
    (220) DHO_SUBNET_ALLOCATION
    (221) DHO_VIRTUAL_SUBNET
    (249) DHO_CLASSLESS_STATIC_ROUTE_MS
    (255) DHO_END

=item * ccc_codes

Import all CableLabs Client Configuration (CCC) suboption codes
for option 122. Format types are shown in parentheses.

    (001) CCC_PRIMARY_DHCP_SERVER        (inet)
    (002) CCC_SECONDARY_DHCP_SERVER      (inet)
    (003) CCC_PROVISIONING_SERVER        (inet)
    (004) CCC_AS_REQ_AS_REP_BACKOFFRETRY (hexa)
    (005) CCC_AP_REQ_AS_REP_BACKOFFRETRY (hexa)
    (006) CCC_KERBEROS_REALM             (string)
    (007) CCC_TICKET_SERVER_UTILIZATION  (byte)
    (008) CCC_PROVISIONING_TIMER         (int)
    (009) CCC_SECURITY_TICKET_CONTROL    (byte)
    (010) CCC_KDC_SERVER                 (inet)

=item * ra_codes

Import all DHCP Agent (Relay Agent) suboption codes for option 82.
Format types are shown in parentheses.

    (001) RAI_CIRCUIT_ID                              (circuit_id)
    (002) RAI_REMOTE_ID                               (remote_id)
    (003) RAI_AGENT_ID                                (hexa)
    (004) RAI_DOCSIS_CLASS                            (hexa)
    (005) RAI_LINK_SELECTION                          (inet)
    (006) RAI_SUBSCRIBER_ID                           (string)
    (007) RAI_RADIUS_ATTRIBUTES                       (hexa)
    (008) RAI_AUTHENTICATION                          (hexa)
    (009) RAI_VENDOR_INFO                             (hexa)
    (010) RAI_FLAGS                                   (byte)
    (011) RAI_SERVER_ID_OVERRIDE                      (inet)
    (151) RAI_DHCPV4_VIRTUAL_SUBNET_SELECTION         (hexa)
    (152) RAI_DHCPV4_VIRTUAL_SUBNET_SELECTION_CONTROL (hexa)

=item * vendor43_codes

Import all CableLabs DOCSIS suboption codes for option 43 (vendor
encapsulated options). Format types are shown in parentheses.

    (002) VENDOR43_DEVICE_TYPE       (byte)
    (003) VENDOR43_ECM               (byte)
    (004) VENDOR43_SERIAL_NUMBER     (string)
    (005) VENDOR43_HW_VERSION        (string)
    (006) VENDOR43_SW_VERSION        (string)
    (007) VENDOR43_BOOT_ROM_VERSION  (string)
    (008) VENDOR43_OUI               (hexa)
    (009) VENDOR43_MODEL_NUMBER      (string)
    (010) VENDOR43_VENDOR_NAME       (string)
    (011) VENDOR43_PS_WAN_MAN_DATA   (hexa)
    (012) VENDOR43_CM_PS_SYSTEM_DESC (string)
    (013) VENDOR43_CM_PS_FIRMWARE_REV(string)
    (014) VENDOR43_FIREWALL_POLICY_FILE(string)
    (015) VENDOR43_ESAFES            (hexa)
    (016) VENDOR43_DEVICE_TPID       (hexa)
    (017) VENDOR43_DEVICE_SMID       (hexa)
    (018) VENDOR43_VIDEOSECURITYELEMENT(hexa)
    (031) VENDOR43_MTA_MAC_ADDRESS   (hexa)
    (032) VENDOR43_MTA_CORRELATION_ID(string)
    (051) VENDOR43_CARD_VENDOR_NAME  (string)
    (052) VENDOR43_CARD_CAPABILITY   (hexa)
    (053) VENDOR43_CARD_VENDOR_DEVICE_ID(hexa)
    (054) VENDOR43_CARD_ID           (string)

=back

=head1 DHO_FORMATS

Format strings used by the option code to format mapping
in C<%DHO_FORMATS>. Each key is a DHCP option code; each
value describes how that option is encoded on the wire.

The following formats are supported:

=over

=item B<userclass>

Encodes/decodes option 77 (C<DHO_USER_CLASS>) per RFC 3004.
Each C<[len][data]> block represents one user class identifier.
C<setOptionValue> accepts either a scalar (single class) or
an arrayref (multiple classes):

    $packet->setOptionValue(77, 'ipxe');
    # wire: \x04ipxe

    $packet->setOptionValue(77, ['ipxe', 'BIOS']);
    # wire: \x04ipxe\x04BIOS

C<getOptionValue> returns a comma-separated string of all
decoded blocks.

To supply pre-encoded RFC 3004 data, use C<setOptionRaw>.

=back

=head1 TO DO, LIMITATIONS

DHO_AUTHENTICATION (code 90, rfc 3118) has a structured format
(protocol/algorithm/RDM/replay/auth-info) and is not parsed — returns raw bytes.

=head1 SEE ALSO

L<Net::DHCP::Packet>, L<Net::DHCP::Options>

=head1 AUTHOR

Dean Hamstead <dean@fragfest.com.au>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Dean Hamstead.

This is free software, licensed under:

  The MIT (X11) License

=cut
