From d2e247d8d87ecf8c60fcf0acdad05667bd379521 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Fri, 11 Jan 2019 15:02:11 +0100 Subject: [PATCH] odhcp6c: align further with RFC8415 Align acceptable options in the ORO list further with RFC8415; where appropriate add send option support for the newly added options. Signed-off-by: Hans Dedecker --- src/odhcp6c.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/odhcp6c.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 7e83778..19a86f2 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -95,15 +95,31 @@ static struct odhcp6c_opt opts[] = { { .code = DHCPV6_OPT_IA_PREFIX, .flags = OPT_INTERNAL, .str = NULL }, { .code = DHCPV6_OPT_SNTP_SERVERS, .flags = OPT_IP6 | OPT_ARRAY | OPT_ORO, .str = "sntpservers" }, { .code = DHCPV6_OPT_INFO_REFRESH, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO | OPT_ORO_STATELESS, .str = NULL }, + { .code = DHCPV6_OPT_REMOTE_ID, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_SUBSCRIBER_ID, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_FQDN, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO, .str = NULL }, + { .code = DHCPV6_OPT_ERO, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_LQ_QUERY, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_CLIENT_DATA, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_CLT_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_LQ_RELAY_DATA, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_LQ_CLIENT_LINK, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_RELAY_ID, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_NTP_SERVER, .flags = OPT_U8 | OPT_ORO, .str = "ntpserver" }, + { .code = DHCPV6_OPT_CLIENT_ARCH_TYPE, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_AFTR_NAME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO, .str = NULL }, + { .code = DHCPV6_OPT_RSOO, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_PD_EXCLUDE, .flags = OPT_INTERNAL | OPT_ORO | OPT_ORO_STATEFUL, .str = NULL }, + { .code = DHCPV6_OPT_VSS, .flags = OPT_U8, .str = "vss" }, + { .code = DHCPV6_OPT_LINK_LAYER_ADDRESS, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_LINK_ADDRESS, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_RADIUS, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_SOL_MAX_RT, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO | OPT_ORO_SOLICIT, .str = NULL }, { .code = DHCPV6_OPT_INF_MAX_RT, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO | OPT_ORO_STATELESS, .str = NULL }, #ifdef EXT_CER_ID { .code = DHCPV6_OPT_CER_ID, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, #endif + { .code = DHCPV6_OPT_DHCPV4_MSG, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_S46_RULE, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_S46_BR, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = DHCPV6_OPT_S46_DMR, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, @@ -112,6 +128,38 @@ static struct odhcp6c_opt opts[] = { { .code = DHCPV6_OPT_S46_CONT_MAPE, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO, .str = NULL }, { .code = DHCPV6_OPT_S46_CONT_MAPT, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO, .str = NULL }, { .code = DHCPV6_OPT_S46_CONT_LW, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU | OPT_ORO, .str = NULL }, + { .code = DHCPV6_OPT_LQ_BASE_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_LQ_START_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_LQ_END_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_ANI_ATT, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_ANI_NETWORK_NAME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_ANI_AP_NAME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_ANI_AP_BSSID, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_ANI_OPERATOR_ID, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_ANI_OPERATOR_REALM, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_MUD_URL_V6, .flags = OPT_STR | OPT_NO_PASSTHRU, .str = "mud_url_v6" }, + { .code = DHCPV6_OPT_F_BINDING_STATUS, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_CONNECT_FLAGS, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_DNS_REMOVAL_INFO, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_DNS_HOST_NAME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_DNS_ZONE_NAME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_DNS_FLAGS, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_EXPIRATION_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_MAX_UNACKED_BNDUPD, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_MCLT, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_PARTNER_LIFETIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_PARTNER_LIFETIME_SENT, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_PARTNER_DOWN_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_PARTNER_RAW_CLT_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_PROTOCOL_VERSION, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_KEEPALIVE_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_RECONFIGURE_DATA, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_RELATIONSHIP_NAME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_SERVER_FLAGS, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_SERVER_STATE, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_START_TIME_OF_STATE, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_F_STATE_EXPIRATION_TIME, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, + { .code = DHCPV6_OPT_RELAY_PORT, .flags = OPT_INTERNAL | OPT_NO_PASSTHRU, .str = NULL }, { .code = 0, .flags = 0, .str = NULL }, }; diff --git a/src/odhcp6c.h b/src/odhcp6c.h index 38a2ca7..40ce098 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -62,16 +62,32 @@ enum dhcvp6_opt { DHCPV6_OPT_IA_PREFIX = 26, DHCPV6_OPT_SNTP_SERVERS = 31, DHCPV6_OPT_INFO_REFRESH = 32, + DHCPV6_OPT_REMOTE_ID = 37, + DHCPV6_OPT_SUBSCRIBER_ID = 38, DHCPV6_OPT_FQDN = 39, + DHCPV6_OPT_ERO = 43, + DHCPV6_OPT_LQ_QUERY = 44, + DHCPV6_OPT_CLIENT_DATA = 45, + DHCPV6_OPT_CLT_TIME = 46, + DHCPV6_OPT_LQ_RELAY_DATA = 47, + DHCPV6_OPT_LQ_CLIENT_LINK = 48, + DHCPV6_OPT_RELAY_ID = 53, DHCPV6_OPT_NTP_SERVER = 56, + DHCPV6_OPT_CLIENT_ARCH_TYPE = 61, DHCPV6_OPT_AFTR_NAME = 64, + DHCPV6_OPT_RSOO = 66, DHCPV6_OPT_PD_EXCLUDE = 67, + DHCPV6_OPT_VSS = 68, + DHCPV6_OPT_LINK_LAYER_ADDRESS = 79, + DHCPV6_OPT_LINK_ADDRESS = 80, + DHCPV6_OPT_RADIUS = 81, DHCPV6_OPT_SOL_MAX_RT = 82, DHCPV6_OPT_INF_MAX_RT = 83, #ifdef EXT_CER_ID /* draft-donley-dhc-cer-id-option-03 */ DHCPV6_OPT_CER_ID = EXT_CER_ID, #endif + DHCPV6_OPT_DHCPV4_MSG = 87, /* draft-ietf-softwire-map-dhcp-08 */ DHCPV6_OPT_S46_RULE = 89, DHCPV6_OPT_S46_BR = 90, @@ -81,6 +97,38 @@ enum dhcvp6_opt { DHCPV6_OPT_S46_CONT_MAPE = 94, DHCPV6_OPT_S46_CONT_MAPT = 95, DHCPV6_OPT_S46_CONT_LW = 96, + DHCPV6_OPT_LQ_BASE_TIME = 100, + DHCPV6_OPT_LQ_START_TIME = 101, + DHCPV6_OPT_LQ_END_TIME = 102, + DHCPV6_OPT_ANI_ATT = 105, + DHCPV6_OPT_ANI_NETWORK_NAME = 106, + DHCPV6_OPT_ANI_AP_NAME = 107, + DHCPV6_OPT_ANI_AP_BSSID = 108, + DHCPV6_OPT_ANI_OPERATOR_ID = 109, + DHCPV6_OPT_ANI_OPERATOR_REALM = 110, + DHCPV6_OPT_MUD_URL_V6 = 112, + DHCPV6_OPT_F_BINDING_STATUS = 114, + DHCPV6_OPT_F_CONNECT_FLAGS = 115, + DHCPV6_OPT_F_DNS_REMOVAL_INFO = 116, + DHCPV6_OPT_F_DNS_HOST_NAME = 117, + DHCPV6_OPT_F_DNS_ZONE_NAME = 118, + DHCPV6_OPT_F_DNS_FLAGS = 119, + DHCPV6_OPT_F_EXPIRATION_TIME = 120, + DHCPV6_OPT_F_MAX_UNACKED_BNDUPD = 121, + DHCPV6_OPT_F_MCLT = 122, + DHCPV6_OPT_F_PARTNER_LIFETIME = 123, + DHCPV6_OPT_F_PARTNER_LIFETIME_SENT = 124, + DHCPV6_OPT_F_PARTNER_DOWN_TIME = 125, + DHCPV6_OPT_F_PARTNER_RAW_CLT_TIME = 126, + DHCPV6_OPT_F_PROTOCOL_VERSION = 127, + DHCPV6_OPT_F_KEEPALIVE_TIME = 128, + DHCPV6_OPT_F_RECONFIGURE_DATA = 129, + DHCPV6_OPT_F_RELATIONSHIP_NAME = 130, + DHCPV6_OPT_F_SERVER_FLAGS = 131, + DHCPV6_OPT_F_SERVER_STATE = 132, + DHCPV6_OPT_F_START_TIME_OF_STATE = 133, + DHCPV6_OPT_F_STATE_EXPIRATION_TIME = 134, + DHCPV6_OPT_RELAY_PORT = 135, }; enum dhcpv6_opt_npt { -- 2.25.1