diff options
-rw-r--r-- | dhcpv4/dhcpv4.go | 7 | ||||
-rw-r--r-- | dhcpv4/types.go | 301 | ||||
-rw-r--r-- | dhcpv6/duid.go | 8 | ||||
-rw-r--r-- | dhcpv6/option_archtype.go | 20 | ||||
-rw-r--r-- | dhcpv6/option_nii.go | 12 | ||||
-rw-r--r-- | dhcpv6/option_types.go | 147 | ||||
-rw-r--r-- | dhcpv6/types.go | 35 |
7 files changed, 266 insertions, 264 deletions
diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go index 182d4a4..31bdd47 100644 --- a/dhcpv4/dhcpv4.go +++ b/dhcpv4/dhcpv4.go @@ -139,7 +139,12 @@ func NewDiscoveryForInterface(ifname string) (*DHCPv4, error) { }) d.AddOption(Option{ Code: OptionParameterRequestList, - Data: []byte{OptionSubnetMask, OptionRouter, OptionDomainName, OptionDomainNameServer}, + Data: []byte{ + byte(OptionSubnetMask), + byte(OptionRouter), + byte(OptionDomainName), + byte(OptionDomainNameServer), + }, }) // the End option has to be added explicitly d.AddOption(Option{Code: OptionEnd}) diff --git a/dhcpv4/types.go b/dhcpv4/types.go index 6ec4d9b..91126d9 100644 --- a/dhcpv4/types.go +++ b/dhcpv4/types.go @@ -23,9 +23,8 @@ type OpcodeType uint8 // constants that represent valid values for OpcodeType const ( - _ OpcodeType = iota // skip 0 - OpcodeBootRequest - OpcodeBootReply + OpcodeBootRequest OpcodeType = 1 + OpcodeBootReply OpcodeType = 2 ) // OpcodeToString maps an OpcodeType to its mnemonic name @@ -37,165 +36,165 @@ var OpcodeToString = map[OpcodeType]string{ // DHCPv4 Options const ( OptionPad OptionCode = 0 - OptionSubnetMask = 1 - OptionTimeOffset = 2 - OptionRouter = 3 - OptionTimeServer = 4 - OptionNameServer = 5 - OptionDomainNameServer = 6 - OptionLogServer = 7 - OptionQuoteServer = 8 - OptionLPRServer = 9 - OptionImpressServer = 10 - OptionResourceLocationServer = 11 - OptionHostName = 12 - OptionBootFileSize = 13 - OptionMeritDumpFile = 14 - OptionDomainName = 15 - OptionSwapServer = 16 - OptionRootPath = 17 - OptionExtensionsPath = 18 - OptionIPForwarding = 19 - OptionNonLocalSourceRouting = 20 - OptionPolicyFilter = 21 - OptionMaximumDatagramAssemblySize = 22 - OptionDefaultIPTTL = 23 - OptionPathMTUAgingTimeout = 24 - OptionPathMTUPlateauTable = 25 - OptionInterfaceMTU = 26 - OptionAllSubnetsAreLocal = 27 - OptionBroadcastAddress = 28 - OptionPerformMaskDiscovery = 29 - OptionMaskSupplier = 30 - OptionPerformRouterDiscovery = 31 - OptionRouterSolicitationAddress = 32 - OptionStaticRoutingTable = 33 - OptionTrailerEncapsulation = 34 - OptionArpCacheTimeout = 35 - OptionEthernetEncapsulation = 36 - OptionDefaulTCPTTL = 37 - OptionTCPKeepaliveInterval = 38 - OptionTCPKeepaliveGarbage = 39 - OptionNetworkInformationServiceDomain = 40 - OptionNetworkInformationServers = 41 - OptionNTPServers = 42 - OptionVendorSpecificInformation = 43 - OptionNetBIOSOverTCPIPNameServer = 44 - OptionNetBIOSOverTCPIPDatagramDistributionServer = 45 - OptionNetBIOSOverTCPIPNodeType = 46 - OptionNetBIOSOverTCPIPScope = 47 - OptionXWindowSystemFontServer = 48 - OptionXWindowSystemDisplayManger = 49 - OptionRequestedIPAddress = 50 - OptionIPAddressLeaseTime = 51 - OptionOptionOverload = 52 - OptionDHCPMessageType = 53 - OptionServerIdentifier = 54 - OptionParameterRequestList = 55 - OptionMessage = 56 - OptionMaximumDHCPMessageSize = 57 - OptionRenewTimeValue = 58 - OptionRebindingTimeValue = 59 - OptionClassIdentifier = 60 - OptionClientIdentifier = 61 - OptionNetWareIPDomainName = 62 - OptionNetWareIPInformation = 63 - OptionNetworkInformationServicePlusDomain = 64 - OptionNetworkInformationServicePlusServers = 65 - OptionTFTPServerName = 66 - OptionBootfileName = 67 - OptionMobileIPHomeAgent = 68 - OptionSimpleMailTransportProtocolServer = 69 - OptionPostOfficeProtocolServer = 70 - OptionNetworkNewsTransportProtocolServer = 71 - OptionDefaultWorldWideWebServer = 72 - OptionDefaultFingerServer = 73 - OptionDefaultInternetRelayChatServer = 74 - OptionStreetTalkServer = 75 - OptionStreetTalkDirectoryAssistanceServer = 76 - OptionUserClassInformation = 77 - OptionSLPDirectoryAgent = 78 - OptionSLPServiceScope = 79 - OptionRapidCommit = 80 - OptionFQDN = 81 - OptionRelayAgentInformation = 82 - OptionInternetStorageNameService = 83 + OptionSubnetMask OptionCode = 1 + OptionTimeOffset OptionCode = 2 + OptionRouter OptionCode = 3 + OptionTimeServer OptionCode = 4 + OptionNameServer OptionCode = 5 + OptionDomainNameServer OptionCode = 6 + OptionLogServer OptionCode = 7 + OptionQuoteServer OptionCode = 8 + OptionLPRServer OptionCode = 9 + OptionImpressServer OptionCode = 10 + OptionResourceLocationServer OptionCode = 11 + OptionHostName OptionCode = 12 + OptionBootFileSize OptionCode = 13 + OptionMeritDumpFile OptionCode = 14 + OptionDomainName OptionCode = 15 + OptionSwapServer OptionCode = 16 + OptionRootPath OptionCode = 17 + OptionExtensionsPath OptionCode = 18 + OptionIPForwarding OptionCode = 19 + OptionNonLocalSourceRouting OptionCode = 20 + OptionPolicyFilter OptionCode = 21 + OptionMaximumDatagramAssemblySize OptionCode = 22 + OptionDefaultIPTTL OptionCode = 23 + OptionPathMTUAgingTimeout OptionCode = 24 + OptionPathMTUPlateauTable OptionCode = 25 + OptionInterfaceMTU OptionCode = 26 + OptionAllSubnetsAreLocal OptionCode = 27 + OptionBroadcastAddress OptionCode = 28 + OptionPerformMaskDiscovery OptionCode = 29 + OptionMaskSupplier OptionCode = 30 + OptionPerformRouterDiscovery OptionCode = 31 + OptionRouterSolicitationAddress OptionCode = 32 + OptionStaticRoutingTable OptionCode = 33 + OptionTrailerEncapsulation OptionCode = 34 + OptionArpCacheTimeout OptionCode = 35 + OptionEthernetEncapsulation OptionCode = 36 + OptionDefaulTCPTTL OptionCode = 37 + OptionTCPKeepaliveInterval OptionCode = 38 + OptionTCPKeepaliveGarbage OptionCode = 39 + OptionNetworkInformationServiceDomain OptionCode = 40 + OptionNetworkInformationServers OptionCode = 41 + OptionNTPServers OptionCode = 42 + OptionVendorSpecificInformation OptionCode = 43 + OptionNetBIOSOverTCPIPNameServer OptionCode = 44 + OptionNetBIOSOverTCPIPDatagramDistributionServer OptionCode = 45 + OptionNetBIOSOverTCPIPNodeType OptionCode = 46 + OptionNetBIOSOverTCPIPScope OptionCode = 47 + OptionXWindowSystemFontServer OptionCode = 48 + OptionXWindowSystemDisplayManger OptionCode = 49 + OptionRequestedIPAddress OptionCode = 50 + OptionIPAddressLeaseTime OptionCode = 51 + OptionOptionOverload OptionCode = 52 + OptionDHCPMessageType OptionCode = 53 + OptionServerIdentifier OptionCode = 54 + OptionParameterRequestList OptionCode = 55 + OptionMessage OptionCode = 56 + OptionMaximumDHCPMessageSize OptionCode = 57 + OptionRenewTimeValue OptionCode = 58 + OptionRebindingTimeValue OptionCode = 59 + OptionClassIdentifier OptionCode = 60 + OptionClientIdentifier OptionCode = 61 + OptionNetWareIPDomainName OptionCode = 62 + OptionNetWareIPInformation OptionCode = 63 + OptionNetworkInformationServicePlusDomain OptionCode = 64 + OptionNetworkInformationServicePlusServers OptionCode = 65 + OptionTFTPServerName OptionCode = 66 + OptionBootfileName OptionCode = 67 + OptionMobileIPHomeAgent OptionCode = 68 + OptionSimpleMailTransportProtocolServer OptionCode = 69 + OptionPostOfficeProtocolServer OptionCode = 70 + OptionNetworkNewsTransportProtocolServer OptionCode = 71 + OptionDefaultWorldWideWebServer OptionCode = 72 + OptionDefaultFingerServer OptionCode = 73 + OptionDefaultInternetRelayChatServer OptionCode = 74 + OptionStreetTalkServer OptionCode = 75 + OptionStreetTalkDirectoryAssistanceServer OptionCode = 76 + OptionUserClassInformation OptionCode = 77 + OptionSLPDirectoryAgent OptionCode = 78 + OptionSLPServiceScope OptionCode = 79 + OptionRapidCommit OptionCode = 80 + OptionFQDN OptionCode = 81 + OptionRelayAgentInformation OptionCode = 82 + OptionInternetStorageNameService OptionCode = 83 // Option 84 returned in RFC 3679 - OptionNDSServers = 85 - OptionNDSTreeName = 86 - OptionNDSContext = 87 - OptionBCMCSControllerDomainNameList = 88 - OptionBCMCSControllerIPv4AddressList = 89 - OptionAuthentication = 90 - OptionClientLastTransactionTime = 91 - OptionAssociatedIP = 92 - OptionClientSystemArchitectureType = 93 - OptionClientNetworkInterfaceIdentifier = 94 - OptionLDAP = 95 + OptionNDSServers OptionCode = 85 + OptionNDSTreeName OptionCode = 86 + OptionNDSContext OptionCode = 87 + OptionBCMCSControllerDomainNameList OptionCode = 88 + OptionBCMCSControllerIPv4AddressList OptionCode = 89 + OptionAuthentication OptionCode = 90 + OptionClientLastTransactionTime OptionCode = 91 + OptionAssociatedIP OptionCode = 92 + OptionClientSystemArchitectureType OptionCode = 93 + OptionClientNetworkInterfaceIdentifier OptionCode = 94 + OptionLDAP OptionCode = 95 // Option 96 returned in RFC 3679 - OptionClientMachineIdentifier = 97 - OptionOpenGroupUserAuthentication = 98 - OptionGeoConfCivic = 99 - OptionIEEE10031TZString = 100 - OptionReferenceToTZDatabase = 101 + OptionClientMachineIdentifier OptionCode = 97 + OptionOpenGroupUserAuthentication OptionCode = 98 + OptionGeoConfCivic OptionCode = 99 + OptionIEEE10031TZString OptionCode = 100 + OptionReferenceToTZDatabase OptionCode = 101 // Options 102-111 returned in RFC 3679 - OptionNetInfoParentServerAddress = 112 - OptionNetInfoParentServerTag = 113 - OptionURL = 114 + OptionNetInfoParentServerAddress OptionCode = 112 + OptionNetInfoParentServerTag OptionCode = 113 + OptionURL OptionCode = 114 // Option 115 returned in RFC 3679 - OptionAutoConfigure = 116 - OptionNameServiceSearch = 117 - OptionSubnetSelection = 118 - OptionDNSDomainSearchList = 119 - OptionSIPServersDHCPOption = 120 - OptionClasslessStaticRouteOption = 121 - OptionCCC = 122 - OptionGeoConf = 123 - OptionVendorIdentifyingVendorClass = 124 - OptionVendorIdentifyingVendorSpecific = 125 + OptionAutoConfigure OptionCode = 116 + OptionNameServiceSearch OptionCode = 117 + OptionSubnetSelection OptionCode = 118 + OptionDNSDomainSearchList OptionCode = 119 + OptionSIPServersDHCPOption OptionCode = 120 + OptionClasslessStaticRouteOption OptionCode = 121 + OptionCCC OptionCode = 122 + OptionGeoConf OptionCode = 123 + OptionVendorIdentifyingVendorClass OptionCode = 124 + OptionVendorIdentifyingVendorSpecific OptionCode = 125 // Options 126-127 returned in RFC 3679 - OptionTFTPServerIPAddress = 128 - OptionCallServerIPAddress = 129 - OptionDiscriminationString = 130 - OptionRemoteStatisticsServerIPAddress = 131 - Option8021PVLANID = 132 - Option8021QL2Priority = 133 - OptionDiffservCodePoint = 134 - OptionHTTPProxyForPhoneSpecificApplications = 135 - OptionPANAAuthenticationAgent = 136 - OptionLoSTServer = 137 - OptionCAPWAPAccessControllerAddresses = 138 - OptionOPTIONIPv4AddressMoS = 139 - OptionOPTIONIPv4FQDNMoS = 140 - OptionSIPUAConfigurationServiceDomains = 141 - OptionOPTIONIPv4AddressANDSF = 142 - OptionOPTIONIPv6AddressANDSF = 143 + OptionTFTPServerIPAddress OptionCode = 128 + OptionCallServerIPAddress OptionCode = 129 + OptionDiscriminationString OptionCode = 130 + OptionRemoteStatisticsServerIPAddress OptionCode = 131 + Option8021PVLANID OptionCode = 132 + Option8021QL2Priority OptionCode = 133 + OptionDiffservCodePoint OptionCode = 134 + OptionHTTPProxyForPhoneSpecificApplications OptionCode = 135 + OptionPANAAuthenticationAgent OptionCode = 136 + OptionLoSTServer OptionCode = 137 + OptionCAPWAPAccessControllerAddresses OptionCode = 138 + OptionOPTIONIPv4AddressMoS OptionCode = 139 + OptionOPTIONIPv4FQDNMoS OptionCode = 140 + OptionSIPUAConfigurationServiceDomains OptionCode = 141 + OptionOPTIONIPv4AddressANDSF OptionCode = 142 + OptionOPTIONIPv6AddressANDSF OptionCode = 143 // Options 144-149 returned in RFC 3679 - OptionTFTPServerAddress = 150 - OptionStatusCode = 151 - OptionBaseTime = 152 - OptionStartTimeOfState = 153 - OptionQueryStartTime = 154 - OptionQueryEndTime = 155 - OptionDHCPState = 156 - OptionDataSource = 157 + OptionTFTPServerAddress OptionCode = 150 + OptionStatusCode OptionCode = 151 + OptionBaseTime OptionCode = 152 + OptionStartTimeOfState OptionCode = 153 + OptionQueryStartTime OptionCode = 154 + OptionQueryEndTime OptionCode = 155 + OptionDHCPState OptionCode = 156 + OptionDataSource OptionCode = 157 // Options 158-174 returned in RFC 3679 - OptionEtherboot = 175 - OptionIPTelephone = 176 - OptionEtherbootPacketCableAndCableHome = 177 + OptionEtherboot OptionCode = 175 + OptionIPTelephone OptionCode = 176 + OptionEtherbootPacketCableAndCableHome OptionCode = 177 // Options 178-207 returned in RFC 3679 - OptionPXELinuxMagicString = 208 - OptionPXELinuxConfigFile = 209 - OptionPXELinuxPathPrefix = 210 - OptionPXELinuxRebootTime = 211 - OptionOPTION6RD = 212 - OptionOPTIONv4AccessDomain = 213 + OptionPXELinuxMagicString OptionCode = 208 + OptionPXELinuxConfigFile OptionCode = 209 + OptionPXELinuxPathPrefix OptionCode = 210 + OptionPXELinuxRebootTime OptionCode = 211 + OptionOPTION6RD OptionCode = 212 + OptionOPTIONv4AccessDomain OptionCode = 213 // Options 214-219 returned in RFC 3679 - OptionSubnetAllocation = 220 - OptionVirtualSubnetAllocation = 221 + OptionSubnetAllocation OptionCode = 220 + OptionVirtualSubnetAllocation OptionCode = 221 // Options 222-223 returned in RFC 3679 // Options 224-254 are reserved for private use - OptionEnd = 255 + OptionEnd OptionCode = 255 ) // OptionCodeToString maps an OptionCode to its mnemonic name diff --git a/dhcpv6/duid.go b/dhcpv6/duid.go index e3da8ff..112412d 100644 --- a/dhcpv6/duid.go +++ b/dhcpv6/duid.go @@ -3,16 +3,16 @@ package dhcpv6 import ( "encoding/binary" "fmt" + "github.com/insomniacslk/dhcp/iana" ) type DuidType uint16 const ( - _ DuidType = iota - DUID_LLT - DUID_EN - DUID_LL + DUID_LLT DuidType = 1 + DUID_EN DuidType = 2 + DUID_LL DuidType = 3 ) var DuidTypeToString = map[DuidType]string{ diff --git a/dhcpv6/option_archtype.go b/dhcpv6/option_archtype.go index 71f67ff..734d89e 100644 --- a/dhcpv6/option_archtype.go +++ b/dhcpv6/option_archtype.go @@ -12,16 +12,16 @@ type ArchType uint16 // see rfc4578 const ( - INTEL_X86PC ArchType = iota - NEC_PC98 - EFI_ITANIUM - DEC_ALPHA - ARC_X86 - INTEL_LEAN_CLIENT - EFI_IA32 - EFI_BC - EFI_XSCALE - EFI_X86_64 + INTEL_X86PC ArchType = 0 + NEC_PC98 ArchType = 1 + EFI_ITANIUM ArchType = 2 + DEC_ALPHA ArchType = 3 + ARC_X86 ArchType = 4 + INTEL_LEAN_CLIENT ArchType = 5 + EFI_IA32 ArchType = 6 + EFI_BC ArchType = 7 + EFI_XSCALE ArchType = 8 + EFI_X86_64 ArchType = 9 ) var ArchTypeToStringMap = map[ArchType]string{ diff --git a/dhcpv6/option_nii.go b/dhcpv6/option_nii.go index 85c9d4b..3a838ee 100644 --- a/dhcpv6/option_nii.go +++ b/dhcpv6/option_nii.go @@ -10,12 +10,12 @@ import ( // see rfc4578 const ( - NII_LANDESK_NOPXE = iota - NII_PXE_GEN_I - NII_PXE_GEN_II - NII_UNDI_NOEFI - NII_UNDI_EFI_GEN_I - NII_UNDI_EFI_GEN_II + NII_LANDESK_NOPXE = 0 + NII_PXE_GEN_I = 1 + NII_PXE_GEN_II = 2 + NII_UNDI_NOEFI = 3 + NII_UNDI_EFI_GEN_I = 4 + NII_UNDI_EFI_GEN_II = 5 ) var NIIToStringMap = map[uint8]string{ diff --git a/dhcpv6/option_types.go b/dhcpv6/option_types.go index 0229b86..d3b9d7f 100644 --- a/dhcpv6/option_types.go +++ b/dhcpv6/option_types.go @@ -2,80 +2,79 @@ package dhcpv6 // FIXME: rename all the options to have a consistent name, e.g. OPT_<NAME> const ( - _ OptionCode = iota // skip 0 - OPTION_CLIENTID - OPTION_SERVERID - OPTION_IA_NA - OPTION_IA_TA - OPTION_IAADDR - OPTION_ORO - OPTION_PREFERENCE - OPTION_ELAPSED_TIME - OPTION_RELAY_MSG - _ // skip 10 - OPTION_AUTH - OPTION_UNICAST - OPTION_STATUS_CODE - OPTION_RAPID_COMMIT - OPTION_USER_CLASS - OPTION_VENDOR_CLASS - OPTION_VENDOR_OPTS - OPTION_INTERFACE_ID - OPTION_RECONF_MSG - OPTION_RECONF_ACCEPT - SIP_SERVERS_DOMAIN_NAME_LIST - SIP_SERVERS_IPV6_ADDRESS_LIST - DNS_RECURSIVE_NAME_SERVER - DOMAIN_SEARCH_LIST - OPTION_IA_PD - OPTION_IAPREFIX - OPTION_NIS_SERVERS - OPTION_NISP_SERVERS - OPTION_NIS_DOMAIN_NAME - OPTION_NISP_DOMAIN_NAME - SNTP_SERVER_LIST - INFORMATION_REFRESH_TIME - BCMCS_CONTROLLER_DOMAIN_NAME_LIST - BCMCS_CONTROLLER_IPV6_ADDRESS_LIST - _ // skip 35 - OPTION_GEOCONF_CIVIC - OPTION_REMOTE_ID - RELAY_AGENT_SUBSCRIBER_ID - FQDN - PANA_AUTHENTICATION_AGENT - OPTION_NEW_POSIX_TIMEZONE - OPTION_NEW_TZDB_TIMEZONE - ECHO_REQUEST - OPTION_LQ_QUERY - OPTION_CLIENT_DATA - OPTION_CLT_TIME - OPTION_LQ_RELAY_DATA - OPTION_LQ_CLIENT_LINK - MIPV6_HOME_NETWORK_ID_FQDN - MIPV6_VISITED_HOME_NETWORK_INFORMATION - LOST_SERVER - CAPWAP_ACCESS_CONTROLLER_ADDRESSES - RELAY_ID - OPTION_IPV6_ADDRESS_MOS - OPTION_IPV6_FQDN_MOS - OPTION_NTP_SERVER - OPTION_V6_ACCESS_DOMAIN - OPTION_SIP_UA_CS_LIST - OPT_BOOTFILE_URL - OPT_BOOTFILE_PARAM - OPTION_CLIENT_ARCH_TYPE - OPTION_NII - OPTION_GEOLOCATION - OPTION_AFTR_NAME - OPTION_ERP_LOCAL_DOMAIN_NAME - OPTION_RSOO - OPTION_PD_EXCLUDE - VIRTUAL_SUBNET_SELECTION - MIPV6_IDENTIFIED_HOME_NETWORK_INFORMATION - MIPV6_UNRESTRICTED_HOME_NETWORK_INFORMATION - MIPV6_HOME_NETWORK_PREFIX - MIPV6_HOME_AGENT_ADDRESS - MIPV6_HOME_AGENT_FQDN + OPTION_CLIENTID OptionCode = 1 + OPTION_SERVERID OptionCode = 2 + OPTION_IA_NA OptionCode = 3 + OPTION_IA_TA OptionCode = 4 + OPTION_IAADDR OptionCode = 5 + OPTION_ORO OptionCode = 6 + OPTION_PREFERENCE OptionCode = 7 + OPTION_ELAPSED_TIME OptionCode = 8 + OPTION_RELAY_MSG OptionCode = 9 + _ // skip 10 + OPTION_AUTH OptionCode = 11 + OPTION_UNICAST OptionCode = 12 + OPTION_STATUS_CODE OptionCode = 13 + OPTION_RAPID_COMMIT OptionCode = 14 + OPTION_USER_CLASS OptionCode = 15 + OPTION_VENDOR_CLASS OptionCode = 16 + OPTION_VENDOR_OPTS OptionCode = 17 + OPTION_INTERFACE_ID OptionCode = 18 + OPTION_RECONF_MSG OptionCode = 19 + OPTION_RECONF_ACCEPT OptionCode = 20 + SIP_SERVERS_DOMAIN_NAME_LIST OptionCode = 21 + SIP_SERVERS_IPV6_ADDRESS_LIST OptionCode = 22 + DNS_RECURSIVE_NAME_SERVER OptionCode = 23 + DOMAIN_SEARCH_LIST OptionCode = 24 + OPTION_IA_PD OptionCode = 25 + OPTION_IAPREFIX OptionCode = 26 + OPTION_NIS_SERVERS OptionCode = 27 + OPTION_NISP_SERVERS OptionCode = 28 + OPTION_NIS_DOMAIN_NAME OptionCode = 29 + OPTION_NISP_DOMAIN_NAME OptionCode = 30 + SNTP_SERVER_LIST OptionCode = 31 + INFORMATION_REFRESH_TIME OptionCode = 32 + BCMCS_CONTROLLER_DOMAIN_NAME_LIST OptionCode = 33 + BCMCS_CONTROLLER_IPV6_ADDRESS_LIST OptionCode = 34 + _ // skip 35 + OPTION_GEOCONF_CIVIC OptionCode = 36 + OPTION_REMOTE_ID OptionCode = 37 + RELAY_AGENT_SUBSCRIBER_ID OptionCode = 38 + FQDN OptionCode = 39 + PANA_AUTHENTICATION_AGENT OptionCode = 40 + OPTION_NEW_POSIX_TIMEZONE OptionCode = 41 + OPTION_NEW_TZDB_TIMEZONE OptionCode = 42 + ECHO_REQUEST OptionCode = 43 + OPTION_LQ_QUERY OptionCode = 44 + OPTION_CLIENT_DATA OptionCode = 45 + OPTION_CLT_TIME OptionCode = 46 + OPTION_LQ_RELAY_DATA OptionCode = 47 + OPTION_LQ_CLIENT_LINK OptionCode = 48 + MIPV6_HOME_NETWORK_ID_FQDN OptionCode = 49 + MIPV6_VISITED_HOME_NETWORK_INFORMATION OptionCode = 50 + LOST_SERVER OptionCode = 51 + CAPWAP_ACCESS_CONTROLLER_ADDRESSES OptionCode = 52 + RELAY_ID OptionCode = 53 + OPTION_IPV6_ADDRESS_MOS OptionCode = 54 + OPTION_IPV6_FQDN_MOS OptionCode = 55 + OPTION_NTP_SERVER OptionCode = 56 + OPTION_V6_ACCESS_DOMAIN OptionCode = 57 + OPTION_SIP_UA_CS_LIST OptionCode = 58 + OPT_BOOTFILE_URL OptionCode = 59 + OPT_BOOTFILE_PARAM OptionCode = 60 + OPTION_CLIENT_ARCH_TYPE OptionCode = 61 + OPTION_NII OptionCode = 62 + OPTION_GEOLOCATION OptionCode = 63 + OPTION_AFTR_NAME OptionCode = 64 + OPTION_ERP_LOCAL_DOMAIN_NAME OptionCode = 65 + OPTION_RSOO OptionCode = 66 + OPTION_PD_EXCLUDE OptionCode = 67 + VIRTUAL_SUBNET_SELECTION OptionCode = 68 + MIPV6_IDENTIFIED_HOME_NETWORK_INFORMATION OptionCode = 69 + MIPV6_UNRESTRICTED_HOME_NETWORK_INFORMATION OptionCode = 70 + MIPV6_HOME_NETWORK_PREFIX OptionCode = 71 + MIPV6_HOME_AGENT_ADDRESS OptionCode = 72 + MIPV6_HOME_AGENT_FQDN OptionCode = 73 ) var OptionCodeToString = map[OptionCode]string{ diff --git a/dhcpv6/types.go b/dhcpv6/types.go index e0ea6f0..bbe4c5b 100644 --- a/dhcpv6/types.go +++ b/dhcpv6/types.go @@ -5,24 +5,23 @@ package dhcpv6 type MessageType uint8 const ( - _ MessageType = iota // skip 0 - SOLICIT - ADVERTISE - REQUEST - CONFIRM - RENEW - REBIND - REPLY - RELEASE - DECLINE - RECONFIGURE - INFORMATION_REQUEST - RELAY_FORW - RELAY_REPL - LEASEQUERY - LEASEQUERY_REPLY - LEASEQUERY_DONE - LEASEQUERY_DATA + SOLICIT MessageType = 1 + ADVERTISE MessageType = 2 + REQUEST MessageType = 3 + CONFIRM MessageType = 4 + RENEW MessageType = 5 + REBIND MessageType = 6 + REPLY MessageType = 7 + RELEASE MessageType = 8 + DECLINE MessageType = 9 + RECONFIGURE MessageType = 10 + INFORMATION_REQUEST MessageType = 11 + RELAY_FORW MessageType = 12 + RELAY_REPL MessageType = 13 + LEASEQUERY MessageType = 14 + LEASEQUERY_REPLY MessageType = 15 + LEASEQUERY_DONE MessageType = 16 + LEASEQUERY_DATA MessageType = 17 ) func MessageTypeToString(t MessageType) string { |