add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})
endif(${EXT_PREFIX_CLASS})
+if(${EXT_CER_ID})
+ add_definitions(-DEXT_CER_ID=${EXT_CER_ID})
+endif(${EXT_CER_ID})
+
if(${EXT_BFD_PING})
add_definitions(-DEXT_BFD_PING)
set(BFD_SOURCE src/bfd.c)
g) Information-Refresh Options
h) Configurable SOL_MAX_RT
i) DS-Lite AFTR-Name Option
+ j) Prefix Class (experimental)
+ k) CER-ID (experimental)
4. Support for requesting and parsing Router Advertisements
a) parsing of prefixes, routes, MTU and RDNSS options
htons(DHCPV6_OPT_INF_MAX_RT),
#ifdef EXT_PREFIX_CLASS
htons(DHCPV6_OPT_PREFIX_CLASS),
+#endif
+#ifdef EXT_CER_ID
+ htons(DHCPV6_OPT_CER_ID),
#endif
};
odhcp6c_add_state(STATE_ORO, oro, sizeof(oro));
if (inf_max_rt >= DHCPV6_INF_MAX_RT_MIN &&
inf_max_rt <= DHCPV6_INF_MAX_RT_MAX)
dhcpv6_retx[DHCPV6_MSG_INFO_REQ].max_timeo = inf_max_rt;
- }else if (otype != DHCPV6_OPT_CLIENTID &&
+#ifdef EXT_CER_ID
+ } else if (otype == DHCPV6_OPT_CER_ID && olen == -4 +
+ sizeof(struct dhcpv6_cer_id)) {
+ struct dhcpv6_cer_id *cer_id = (void*)&odata[-4];
+ struct in6_addr any = IN6ADDR_ANY_INIT;
+ if (memcmp(&cer_id->addr, &any, sizeof(any)))
+ odhcp6c_add_state(STATE_CER, &cer_id->addr, sizeof(any));
+#endif
+ } else if (otype != DHCPV6_OPT_CLIENTID &&
otype != DHCPV6_OPT_SERVERID) {
odhcp6c_add_state(STATE_CUSTOM_OPTS,
&odata[-4], olen + 4);
/* draft-bhandari-dhc-class-based-prefix, not yet standardized */
DHCPV6_OPT_PREFIX_CLASS = EXT_PREFIX_CLASS,
#endif
+#ifdef EXT_CER_ID
+ /* draft-donley-dhc-cer-id-option-03 */
+ DHCPV6_OPT_CER_ID = EXT_CER_ID,
+#endif
};
enum dhcpv6_opt_npt {
uint8_t key[16];
} _packed;
+struct dhcpv6_cer_id {
+ uint16_t type;
+ uint16_t len;
+ uint16_t reserved;
+ uint16_t auth_type;
+ uint8_t auth[16];
+ struct in6_addr addr;
+} _packed;
+
#define dhcpv6_for_each_option(start, end, otype, olen, odata)\
for (uint8_t *_o = (uint8_t*)(start); _o + 4 <= (uint8_t*)(end) &&\
STATE_AFTR_NAME,
STATE_VENDORCLASS,
STATE_USERCLASS,
+ STATE_CER,
_STATE_MAX
};
void script_call(const char *status)
{
size_t dns_len, search_len, custom_len, sntp_ip_len, ntp_ip_len, ntp_dns_len;
- size_t sip_ip_len, sip_fqdn_len, aftr_name_len;
+ size_t sip_ip_len, sip_fqdn_len, aftr_name_len, cer_len;
odhcp6c_expire();
if (delayed_call) {
struct in6_addr *sip = odhcp6c_get_state(STATE_SIP_IP, &sip_ip_len);
uint8_t *sip_fqdn = odhcp6c_get_state(STATE_SIP_FQDN, &sip_fqdn_len);
uint8_t *aftr_name = odhcp6c_get_state(STATE_AFTR_NAME, &aftr_name_len);
+ struct in6_addr *cer = odhcp6c_get_state(STATE_CER, &cer_len);
size_t prefix_len, address_len, ra_pref_len, ra_route_len, ra_dns_len;
uint8_t *prefix = odhcp6c_get_state(STATE_IA_PD, &prefix_len);
fqdn_to_env("SIP_DOMAIN", sip_fqdn, sip_fqdn_len);
fqdn_to_env("AFTR", aftr_name, aftr_name_len);
fqdn_to_ip_env("AFTR_IP", aftr_name, aftr_name_len);
+ ipv6_to_env("CER", cer, cer_len / sizeof(*cer));
bin_to_env(custom, custom_len);
entry_to_env("PREFIXES", prefix, prefix_len, ENTRY_PREFIX);
entry_to_env("ADDRESSES", address, address_len, ENTRY_ADDRESS);