1 /** 2 * Copyright (C) 2012-2013 Steven Barth <steven@midlink.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License v2 as published by 6 * the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 */ 14 15 #ifndef _ODHCPD_H_ 16 #define _ODHCPD_H_ 17 18 #include <netinet/in.h> 19 #include <netinet/icmp6.h> 20 #include <netinet/ether.h> 21 #include <stdbool.h> 22 #include <syslog.h> 23 24 #include <libubox/avl.h> 25 #include <libubox/blobmsg.h> 26 #include <libubox/list.h> 27 #include <libubox/uloop.h> 28 #include <libubox/avl.h> 29 #include <libubox/ustream.h> 30 #include <libubox/vlist.h> 31 32 #define min(a, b) (((a) < (b)) ? (a) : (b)) 33 #define max(a, b) (((a) > (b)) ? (a) : (b)) 34 35 /* RFC 1035, §2.3.4, with one extra byte for buffers */ 36 #define DNS_MAX_NAME_LEN 256 37 #define DNS_MAX_LABEL_LEN 63 38 39 // RFC 6106 defines this router advertisement option 40 #define ND_OPT_ROUTE_INFO 24 41 #define ND_OPT_RECURSIVE_DNS 25 42 #define ND_OPT_DNS_SEARCH 31 43 44 // RFC 8910 defines captive portal option 45 #define ND_OPT_CAPTIVE_PORTAL 37 46 47 // RFC 8781 defines PREF64 option 48 #define ND_OPT_PREF64 38 49 50 // RFC9096 defines recommended option lifetimes configuration values 51 #define ND_PREFERRED_LIMIT 2700 52 #define ND_VALID_LIMIT 5400 53 54 // RFC 9463 - Discovery of Network-designated Resolvers (DNR) 55 #define ND_OPT_DNR 144 56 57 #define INFINITE_VALID(x) ((x) == 0) 58 59 #ifndef _o_fallthrough 60 #define _o_fallthrough __attribute__((__fallthrough__)) 61 #endif /* _o_fallthrough */ 62 63 #ifndef _o_packed 64 #define _o_packed __attribute__((packed)) 65 #endif /* _o_packed */ 66 67 #ifndef _o_unused 68 #define _o_unused __attribute__((unused)) 69 #endif /* _o_unused */ 70 71 #ifndef _o_noreturn 72 #define _o_noreturn __attribute__((__noreturn__)) 73 #endif /* _o_noreturn */ 74 75 #define ALL_IPV6_NODES "ff02::1" 76 #define ALL_IPV6_ROUTERS "ff02::2" 77 78 #define NTP_SUBOPTION_SRV_ADDR 1 79 #define NTP_SUBOPTION_MC_ADDR 2 80 #define NTP_SUBOPTION_SRV_FQDN 3 81 #define IPV6_ADDR_LEN 16 82 83 #define IN6_IS_ADDR_ULA(a) (((a)->s6_addr32[0] & htonl(0xfe000000)) == htonl(0xfc000000)) 84 85 #define ADDR_MATCH_PIO_FILTER(_addr, iface) (odhcpd_bmemcmp(&(_addr)->addr, \ 86 &(iface)->pio_filter_addr, \ 87 (iface)->pio_filter_length) != 0 || \ 88 (_addr)->prefix_len < (iface)->pio_filter_length) 89 90 struct interface; 91 struct nl_sock; 92 extern struct config config; 93 extern struct sys_conf sys_conf; 94 95 void __iflog(int lvl, const char *fmt, ...); 96 #define debug(fmt, ...) __iflog(LOG_DEBUG, fmt __VA_OPT__(, ) __VA_ARGS__) 97 #define info(fmt, ...) __iflog(LOG_INFO, fmt __VA_OPT__(, ) __VA_ARGS__) 98 #define notice(fmt, ...) __iflog(LOG_NOTICE, fmt __VA_OPT__(, ) __VA_ARGS__) 99 #define warn(fmt, ...) __iflog(LOG_WARNING, fmt __VA_OPT__(, ) __VA_ARGS__) 100 #define error(fmt, ...) __iflog(LOG_ERR, fmt __VA_OPT__(, ) __VA_ARGS__) 101 #define critical(fmt, ...) __iflog(LOG_CRIT, fmt __VA_OPT__(, ) __VA_ARGS__) 102 #define alert(fmt, ...) __iflog(LOG_ALERT, fmt __VA_OPT__(, ) __VA_ARGS__) 103 #define emergency(fmt, ...) __iflog(LOG_EMERG, fmt __VA_OPT__(, ) __VA_ARGS__) 104 105 106 struct odhcpd_event { 107 struct uloop_fd uloop; 108 void (*handle_dgram)(void *addr, void *data, size_t len, 109 struct interface *iface, void *dest_addr); 110 void (*handle_error)(struct odhcpd_event *e, int error); 111 void (*recv_msgs)(struct odhcpd_event *e); 112 }; 113 114 typedef ssize_t (*send_reply_cb_t)(struct iovec *iov, size_t iov_len, 115 struct sockaddr *dest, socklen_t dest_len, 116 void *opaque); 117 118 union in46_addr { 119 struct in_addr in; 120 struct in6_addr in6; 121 }; 122 123 struct netevent_handler_info { 124 struct interface *iface; 125 union { 126 struct { 127 union in46_addr dst; 128 uint8_t dst_len; 129 union in46_addr gateway; 130 } rt; 131 struct { 132 union in46_addr dst; 133 uint16_t state; 134 uint8_t flags; 135 } neigh; 136 struct { 137 struct odhcpd_ipaddr *addrs; 138 size_t len; 139 } addrs_old; 140 union in46_addr addr; 141 }; 142 }; 143 144 enum netevents { 145 NETEV_IFINDEX_CHANGE, 146 NETEV_ADDR_ADD, 147 NETEV_ADDR_DEL, 148 NETEV_ADDRLIST_CHANGE, 149 NETEV_ADDR6_ADD, 150 NETEV_ADDR6_DEL, 151 NETEV_ADDR6LIST_CHANGE, 152 NETEV_ROUTE6_ADD, 153 NETEV_ROUTE6_DEL, 154 NETEV_NEIGH6_ADD, 155 NETEV_NEIGH6_DEL, 156 }; 157 158 struct netevent_handler { 159 struct list_head head; 160 void (*cb) (unsigned long event, struct netevent_handler_info *info); 161 }; 162 163 struct odhcpd_ipaddr { 164 union in46_addr addr; 165 uint8_t prefix_len; 166 uint32_t preferred_lt; 167 uint32_t valid_lt; 168 169 union { 170 /* IPv6 only */ 171 struct { 172 uint8_t dprefix_len; 173 bool tentative; 174 }; 175 176 /* IPv4 only */ 177 struct { 178 struct in_addr broadcast; 179 in_addr_t netmask; 180 }; 181 }; 182 }; 183 184 enum odhcpd_mode { 185 MODE_DISABLED, 186 MODE_SERVER, 187 MODE_RELAY, 188 MODE_HYBRID 189 }; 190 191 192 enum odhcpd_assignment_flags { 193 OAF_DHCPV6_NA = (1 << 0), 194 OAF_DHCPV6_PD = (1 << 1), 195 }; 196 197 #define DHCPV6_OPT_HDR_SIZE 4 198 199 /* 2-byte type + 128-byte DUID, RFC8415, §11.1 */ 200 #define DUID_MAX_LEN 130 201 /* In theory, 2 (type only), or 7 (DUID-EN + 1-byte data), but be reasonable */ 202 #define DUID_MIN_LEN 10 203 #define DUID_HEXSTRLEN (DUID_MAX_LEN * 2 + 1) 204 205 enum duid_type { 206 DUID_TYPE_LLT = 1, 207 DUID_TYPE_EN = 2, 208 DUID_TYPE_LL = 3, 209 DUID_TYPE_UUID = 4, 210 }; 211 212 struct config { 213 bool enable_tz; 214 bool main_dhcpv4; 215 char *dhcp_cb; 216 bool use_ubus; 217 218 char *dhcp_statefile; 219 int dhcp_statedir_fd; 220 char *dhcp_hostsdir; 221 int dhcp_hostsdir_fd; 222 223 char *ra_piodir; 224 int ra_piodir_fd; 225 226 char *uci_cfgdir; 227 int log_level; 228 bool log_level_cmdline; 229 bool log_syslog; 230 231 uint8_t default_duid[DUID_MAX_LEN]; 232 size_t default_duid_len; 233 }; 234 235 struct sys_conf { 236 uint8_t *posix_tz; 237 size_t posix_tz_len; 238 uint8_t *tzdb_tz; 239 size_t tzdb_tz_len; 240 }; 241 242 struct duid { 243 uint8_t len; 244 uint8_t id[DUID_MAX_LEN]; 245 uint32_t iaid; 246 bool iaid_set; 247 }; 248 249 struct odhcpd_ref_ip; 250 251 struct dhcpv4_lease { 252 struct avl_node iface_avl; // struct interface->dhcpv4_leases 253 254 struct interface *iface; // assignment interface, non-null 255 struct lease_cfg *lease_cfg; // host lease cfg, nullable 256 257 struct in_addr ipv4; // client IPv4 address 258 bool bound; // the lease has been accepted by the client 259 time_t valid_until; // CLOCK_MONOTONIC time, 0 = inf 260 char *hostname; // client hostname 261 bool hostname_valid; // is the hostname one or more valid DNS labels? 262 size_t hwaddr_len; // hwaddr length 263 uint8_t hwaddr[ETH_ALEN]; // hwaddr (only MAC supported) 264 265 // ForceRenew Nonce - RFC6704 §3.1.2 266 struct uloop_timeout fr_timer; // FR message transmission timer 267 bool accept_fr_nonce; // FR client support 268 unsigned fr_cnt; // FR messages sent 269 uint8_t key[16]; // FR nonce 270 struct odhcpd_ref_ip *fr_ip; // FR message old serverid/IP 271 272 // RFC4361 273 uint32_t iaid; 274 uint8_t duid_len; 275 uint8_t duid[]; 276 }; 277 278 struct dhcpv6_lease { 279 struct list_head head; 280 struct list_head lease_cfg_list; 281 282 struct interface *iface; 283 struct lease_cfg *lease_cfg; 284 285 struct sockaddr_in6 peer; 286 time_t valid_until; 287 time_t preferred_until; 288 289 // ForceRenew Nonce - RFC8415 §20.4, §21.11 290 struct uloop_timeout fr_timer; 291 bool accept_fr_nonce; 292 int fr_cnt; 293 uint8_t key[16]; 294 295 union { 296 uint64_t assigned_host_id; 297 uint32_t assigned_subnet_id; 298 }; 299 uint8_t length; // length == 128 -> IA_NA, length <= 64 -> IA_PD 300 301 unsigned int flags; 302 bool bound; // the lease has been accepted by the client 303 uint32_t leasetime; 304 char *hostname; 305 bool hostname_valid; // is the hostname one or more valid DNS labels? 306 307 uint32_t iaid; 308 uint16_t duid_len; 309 uint8_t duid[]; 310 }; 311 312 /* This corresponds to a UCI host section, i.e. a static lease cfg */ 313 struct lease_cfg { 314 struct vlist_node node; 315 struct list_head dhcpv6_leases; 316 struct dhcpv4_lease *dhcpv4_lease; 317 struct in_addr ipv4; 318 uint64_t hostid; 319 size_t mac_count; 320 struct ether_addr *macs; 321 size_t duid_count; 322 struct duid *duids; 323 uint32_t leasetime; // duration of granted leases, UINT32_MAX = inf 324 char *hostname; 325 bool ignore4; 326 bool ignore6; 327 }; 328 329 // DNR - RFC9463 330 struct dnr_options { 331 uint16_t priority; 332 333 uint32_t lifetime; 334 bool lifetime_set; 335 336 uint8_t *adn; 337 uint16_t adn_len; 338 339 struct in_addr *addr4; 340 size_t addr4_cnt; 341 struct in6_addr *addr6; 342 size_t addr6_cnt; 343 344 uint8_t *svc; 345 uint16_t svc_len; 346 }; 347 348 349 // RA PIO - RFC9096 350 struct ra_pio { 351 struct in6_addr prefix; 352 uint8_t length; 353 time_t lifetime; 354 }; 355 356 357 struct interface { 358 struct avl_node avl; 359 360 int ifflags; 361 int ifindex; 362 char *ifname; 363 const char *name; 364 uint32_t if_mtu; 365 bool update_statefile; 366 367 // IPv6 runtime data 368 struct odhcpd_ipaddr *addr6; 369 size_t addr6_len; 370 371 // RA runtime data 372 struct odhcpd_event router_event; 373 struct uloop_timeout timer_rs; 374 uint32_t ra_sent; 375 376 // DHCPv6 runtime data 377 struct odhcpd_event dhcpv6_event; 378 struct list_head ia_assignments; 379 380 // NDP runtime data 381 struct odhcpd_event ndp_event; 382 int ndp_ping_fd; 383 384 // IPv4 runtime data 385 struct odhcpd_ipaddr *oaddrs4; // IPv4 addresses assigned to this interface 386 size_t oaddrs4_cnt; // Number of IPv4 addresses assigned to this interface 387 388 // DHCPv4 runtime data 389 struct odhcpd_event dhcpv4_event; 390 struct avl_tree dhcpv4_leases; 391 struct list_head dhcpv4_fr_ips; 392 393 /* NOTE: everything from this point is zeroed on odhcpd_reload() */ 394 395 // Services 396 enum odhcpd_mode ra; 397 enum odhcpd_mode dhcpv6; 398 enum odhcpd_mode ndp; 399 enum odhcpd_mode dhcpv4; 400 401 // Config 402 bool inuse; 403 bool external; 404 bool master; 405 bool ignore; 406 bool always_rewrite_dns; 407 bool dns_service; 408 409 // NDP 410 int learn_routes; 411 bool ndp_from_link_local; 412 struct in6_addr cached_linklocal_addr; 413 bool cached_linklocal_valid; 414 415 // RA 416 uint8_t ra_flags; 417 bool ra_slaac; 418 bool ra_not_onlink; 419 bool ra_advrouter; 420 bool ra_dns; 421 uint8_t pref64_length; 422 uint8_t pref64_plc; 423 uint32_t pref64_prefix[3]; 424 bool no_dynamic_dhcp; 425 bool have_link_local; 426 uint8_t pio_filter_length; 427 struct in6_addr pio_filter_addr; 428 int default_router; 429 int route_preference; 430 uint32_t ra_maxinterval; 431 uint32_t ra_mininterval; 432 uint32_t ra_lifetime; 433 uint32_t ra_reachabletime; 434 uint32_t ra_retranstime; 435 uint32_t ra_hoplimit; 436 uint32_t ra_mtu; 437 uint32_t max_preferred_lifetime; 438 uint32_t max_valid_lifetime; 439 440 // DHCP 441 uint32_t dhcp_leasetime; 442 443 // DHCPv4 444 uint32_t dhcpv4_pool_start; // Offset to first dynamic address 445 uint32_t dhcpv4_pool_end; // Offset to last dynamic address 446 struct in_addr dhcpv4_start_ip; 447 struct in_addr dhcpv4_end_ip; 448 struct odhcpd_ipaddr dhcpv4_own_ip; 449 struct in_addr *dhcpv4_routers; // IPv4 addresses for routers on this subnet 450 size_t dhcpv4_routers_cnt; // Count of router addresses 451 bool dhcpv4_forcereconf; 452 uint32_t dhcpv4_v6only_wait; // V6ONLY_WAIT for the IPv6-only preferred option (RFC8925) 453 454 // DNS 455 struct in_addr *dns_addrs4; // IPv4 DNS server addresses to announce 456 size_t dns_addrs4_cnt; // Count of IPv4 DNS addresses 457 struct in6_addr *dns_addrs6; // IPv6 DNS server addresses to announce 458 size_t dns_addrs6_cnt; // Count of IPv6 DNS addresses 459 uint8_t *dns_search; // DNS domain search list to announce (concatenated) 460 size_t dns_search_len; // Length of the DNS domain search list (bytes) 461 462 // DHCPV6 463 void *dhcpv6_raw; 464 size_t dhcpv6_raw_len; 465 bool dhcpv6_assignall; 466 bool dhcpv6_pd; 467 bool dhcpv6_pd_preferred; 468 bool dhcpv6_na; 469 uint32_t dhcpv6_hostid_len; 470 uint32_t dhcpv6_pd_min_len; // minimum delegated prefix length 471 struct in6_addr *dhcpv6_relay_server_addrs6; 472 size_t dhcpv6_relay_server_addrs6_cnt; 473 474 char *upstream; 475 size_t upstream_len; 476 477 // NTP 478 struct in_addr *dhcpv4_ntp; 479 size_t dhcpv4_ntp_cnt; 480 uint8_t *dhcpv6_ntp; 481 uint16_t dhcpv6_ntp_len; 482 size_t dhcpv6_ntp_cnt; 483 484 // SNTP 485 struct in6_addr *dhcpv6_sntp; 486 size_t dhcpv6_sntp_cnt; 487 488 // DNR 489 struct dnr_options *dnr; 490 size_t dnr_cnt; 491 492 // RA PIO - RFC9096 493 struct ra_pio *pios; 494 size_t pio_cnt; 495 bool pio_update; 496 497 // RFC8910 498 char *captive_portal_uri; 499 size_t captive_portal_uri_len; 500 }; 501 502 extern struct avl_tree interfaces; 503 504 enum { 505 LEASE_CFG_ATTR_IPV4, 506 LEASE_CFG_ATTR_MAC, 507 LEASE_CFG_ATTR_DUID, 508 LEASE_CFG_ATTR_HOSTID, 509 LEASE_CFG_ATTR_LEASETIME, 510 LEASE_CFG_ATTR_NAME, 511 LEASE_CFG_ATTR_MAX 512 }; 513 extern const struct blobmsg_policy lease_cfg_attrs[LEASE_CFG_ATTR_MAX]; 514 515 inline static bool ra_pio_expired(const struct ra_pio *pio, time_t now) 516 { 517 return pio->lifetime && (now > pio->lifetime); 518 } 519 520 inline static uint32_t ra_pio_lifetime(const struct ra_pio *pio, time_t now) 521 { 522 if (!pio->lifetime || now > pio->lifetime) 523 return 0; 524 525 return (uint32_t) (pio->lifetime - now); 526 } 527 528 inline static bool ra_pio_stale(const struct ra_pio *pio) 529 { 530 return !!pio->lifetime; 531 } 532 533 // Exported main functions 534 int odhcpd_register(struct odhcpd_event *event); 535 int odhcpd_deregister(struct odhcpd_event *event); 536 void odhcpd_process(struct odhcpd_event *event); 537 538 ssize_t odhcpd_send_with_src(int socket, struct sockaddr_in6 *dest, 539 struct iovec *iov, size_t iov_len, 540 const struct interface *iface, const struct in6_addr *src_addr); 541 ssize_t odhcpd_send(int socket, struct sockaddr_in6 *dest, 542 struct iovec *iov, size_t iov_len, 543 const struct interface *iface); 544 ssize_t odhcpd_try_send_with_src(int socket, struct sockaddr_in6 *dest, 545 struct iovec *iov, size_t iov_len, 546 struct interface *iface); 547 int odhcpd_get_interface_dns_addr6(struct interface *iface, 548 struct in6_addr *dns_addr6); 549 int odhcpd_get_interface_linklocal_addr(struct interface *iface, 550 struct in6_addr *addr); 551 int odhcpd_get_interface_config(const char *ifname, const char *what); 552 int odhcpd_get_mac(const struct interface *iface, uint8_t mac[6]); 553 int odhcpd_get_flags(const struct interface *iface); 554 struct interface* odhcpd_get_interface_by_index(int ifindex); 555 void odhcpd_urandom(void *data, size_t len); 556 557 int odhcpd_run(void); 558 time_t odhcpd_time(void); 559 ssize_t odhcpd_unhexlify(uint8_t *dst, size_t len, const char *src); 560 void odhcpd_hexlify(char *dst, const uint8_t *src, size_t len); 561 const char *odhcpd_print_mac(const uint8_t *mac, const size_t len); 562 563 int odhcpd_bmemcmp(const void *av, const void *bv, size_t bits); 564 void odhcpd_bmemcpy(void *av, const void *bv, size_t bits); 565 566 typedef void (*odhcpd_enum_addr6_cb_t)(struct dhcpv6_lease *lease, 567 struct in6_addr *addr, uint8_t prefix_len, 568 uint32_t pref, uint32_t valid, 569 void *arg); 570 void odhcpd_enum_addr6(struct interface *iface, struct dhcpv6_lease *lease, 571 time_t now, odhcpd_enum_addr6_cb_t func, void *arg); 572 int odhcpd_parse_addr6_prefix(const char *str, struct in6_addr *addr, uint8_t *prefix); 573 bool odhcpd_hostname_valid(const char *name); 574 575 int config_parse_interface(void *data, size_t len, const char *iname, bool overwrite); 576 struct lease_cfg *config_find_lease_cfg_by_duid_and_iaid(const uint8_t *duid, 577 const uint16_t len, 578 const uint32_t iaid); 579 struct lease_cfg *config_find_lease_cfg_by_mac(const uint8_t *mac); 580 struct lease_cfg *config_find_lease_cfg_by_hostid(const uint64_t hostid); 581 struct lease_cfg *config_find_lease_cfg_by_ipv4(const struct in_addr ipv4); 582 int config_set_lease_cfg_from_blobmsg(struct blob_attr *ba); 583 584 #ifdef WITH_UBUS 585 int ubus_init(void); 586 const char* ubus_get_ifname(const char *name); 587 void ubus_apply_network(void); 588 bool ubus_has_prefix(const char *name, const char *ifname); 589 void ubus_bcast_dhcpv4_event(const char *type, const char *iface, 590 const struct dhcpv4_lease *lease); 591 #else 592 static inline int ubus_init(void) 593 { 594 return 0; 595 } 596 597 static inline const char *ubus_get_ifname(const char *name) 598 { 599 return NULL; 600 } 601 602 static inline void ubus_apply_network(void) 603 { 604 return; 605 } 606 607 static inline bool ubus_has_prefix(const char *name, const char *ifname) 608 { 609 return false; 610 } 611 612 static inline 613 void ubus_bcast_dhcpv4_event(const char *type, const char *iface, 614 const struct dhcpv4_lease *lease) 615 { 616 return; 617 } 618 #endif /* WITH_UBUS */ 619 620 ssize_t dhcpv6_ia_handle_IAs(uint8_t *buf, size_t buflen, struct interface *iface, 621 const struct sockaddr_in6 *addr, const void *data, const uint8_t *end); 622 int dhcpv6_ia_init(void); 623 int dhcpv6_ia_setup_interface(struct interface *iface, bool enable); 624 void dhcpv6_free_lease(struct dhcpv6_lease *lease); 625 626 int netlink_add_netevent_handler(struct netevent_handler *hdlr); 627 ssize_t netlink_get_interface_addrs(const int ifindex, bool v6, 628 struct odhcpd_ipaddr **oaddrs); 629 ssize_t netlink_get_interface_linklocal(int ifindex, struct odhcpd_ipaddr **oaddrs); 630 int netlink_get_interface_proxy_neigh(int ifindex, const struct in6_addr *addr); 631 int netlink_setup_route(const struct in6_addr *addr, const int prefixlen, 632 const int ifindex, const struct in6_addr *gw, 633 const uint32_t metric, const bool add); 634 int netlink_setup_proxy_neigh(const struct in6_addr *addr, 635 const int ifindex, const bool add); 636 int netlink_setup_addr(struct odhcpd_ipaddr *oaddr, 637 const int ifindex, const bool v6, const bool add); 638 void netlink_dump_neigh_table(const bool proxy); 639 void netlink_dump_addr_table(const bool v6); 640 641 // Exported module initializers 642 int netlink_init(void); 643 int router_init(void); 644 int dhcpv6_init(void); 645 int ndp_init(void); 646 647 #ifdef DHCPV4_SUPPORT 648 int dhcpv4_init(void); 649 void dhcpv4_free_lease(struct dhcpv4_lease *a); 650 bool dhcpv4_setup_interface(struct interface *iface, bool enable); 651 void dhcpv4_handle_msg(void *addr, void *data, size_t len, 652 struct interface *iface, _o_unused void *dest_addr, 653 send_reply_cb_t send_reply, void *opaque); 654 #else 655 static inline bool dhcpv4_setup_interface(struct interface *iface, bool enable) { 656 return true; 657 } 658 659 static inline void dhcpv4_free_lease(struct dhcpv4_lease *lease) { 660 if (!lease) 661 return; 662 error("Trying to free IPv4 assignment 0x%p", lease); 663 } 664 #endif /* DHCPV4_SUPPORT */ 665 666 int router_setup_interface(struct interface *iface, bool enable); 667 int dhcpv6_setup_interface(struct interface *iface, bool enable); 668 int ndp_setup_interface(struct interface *iface, bool enable); 669 void reload_services(struct interface *iface); 670 671 void odhcpd_reload(void); 672 673 #endif /* _ODHCPD_H_ */ 674
This page was automatically generated by LXR 0.3.1. • OpenWrt