17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*8121d73fSseb * Common Development and Distribution License (the "License"). 6*8121d73fSseb * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*8121d73fSseb * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _NDPD_TABLES_H 277c478bd9Sstevel@tonic-gate #define _NDPD_TABLES_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifdef __cplusplus 327c478bd9Sstevel@tonic-gate extern "C" { 337c478bd9Sstevel@tonic-gate #endif 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate enum adv_states { NO_ADV = 0, REG_ADV, INIT_ADV, SOLICIT_ADV, FINAL_ADV }; 367c478bd9Sstevel@tonic-gate enum adv_events { ADV_OFF, START_INIT_ADV, START_FINAL_ADV, RECEIVED_SOLICIT, 377c478bd9Sstevel@tonic-gate ADV_TIMER }; 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate enum solicit_states { NO_SOLICIT = 0, INIT_SOLICIT, DONE_SOLICIT }; 407c478bd9Sstevel@tonic-gate enum solicit_events { SOLICIT_OFF, START_INIT_SOLICIT, SOL_TIMER, 417c478bd9Sstevel@tonic-gate SOLICIT_DONE }; 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate /* 447c478bd9Sstevel@tonic-gate * Data structures used to handle configuration variables set in ndpd.conf. 457c478bd9Sstevel@tonic-gate * cf_notdefault is set for variables explicitly set in ndpd.conf. 467c478bd9Sstevel@tonic-gate */ 477c478bd9Sstevel@tonic-gate struct confvar { 487c478bd9Sstevel@tonic-gate uint_t cf_value; 497c478bd9Sstevel@tonic-gate boolean_t cf_notdefault; 507c478bd9Sstevel@tonic-gate }; 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate extern struct confvar ifdefaults[]; 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate /* 557c478bd9Sstevel@tonic-gate * Interfaces configuration variable indicies 567c478bd9Sstevel@tonic-gate */ 577c478bd9Sstevel@tonic-gate #define I_DupAddrDetectTransmits 0 /* From RFC 2462 */ 587c478bd9Sstevel@tonic-gate #define I_AdvSendAdvertisements 1 597c478bd9Sstevel@tonic-gate #define I_MaxRtrAdvInterval 2 /* In seconds */ 607c478bd9Sstevel@tonic-gate #define I_MinRtrAdvInterval 3 /* In seconds */ 617c478bd9Sstevel@tonic-gate #define I_AdvManagedFlag 4 627c478bd9Sstevel@tonic-gate #define I_AdvOtherConfigFlag 5 637c478bd9Sstevel@tonic-gate #define I_AdvLinkMTU 6 647c478bd9Sstevel@tonic-gate #define I_AdvReachableTime 7 /* In milliseconds */ 657c478bd9Sstevel@tonic-gate #define I_AdvRetransTimer 8 /* In milliseconds */ 667c478bd9Sstevel@tonic-gate #define I_AdvCurHopLimit 9 677c478bd9Sstevel@tonic-gate #define I_AdvDefaultLifetime 10 /* In seconds */ 687c478bd9Sstevel@tonic-gate #define I_StatelessAddrConf 11 697c478bd9Sstevel@tonic-gate #define I_TmpAddrsEnabled 12 /* From RFC 3041 */ 707c478bd9Sstevel@tonic-gate #define I_TmpValidLifetime 13 /* In seconds */ 717c478bd9Sstevel@tonic-gate #define I_TmpPreferredLifetime 14 /* In seconds */ 727c478bd9Sstevel@tonic-gate #define I_TmpRegenAdvance 15 /* In seconds */ 737c478bd9Sstevel@tonic-gate #define I_TmpMaxDesyncFactor 16 /* In seconds */ 747c478bd9Sstevel@tonic-gate #define I_IFSIZE 17 /* # of variables */ 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate /* 777c478bd9Sstevel@tonic-gate * A doubly linked list of all physical interfaces that each contain a 787c478bd9Sstevel@tonic-gate * doubly linked list of prefixes (i.e. logical interfaces) and default 797c478bd9Sstevel@tonic-gate * routers. 807c478bd9Sstevel@tonic-gate */ 817c478bd9Sstevel@tonic-gate struct phyint { 827c478bd9Sstevel@tonic-gate struct phyint *pi_next; 837c478bd9Sstevel@tonic-gate struct phyint *pi_prev; 847c478bd9Sstevel@tonic-gate struct prefix *pi_prefix_list; /* Doubly linked prefixes */ 857c478bd9Sstevel@tonic-gate struct router *pi_router_list; /* Doubly linked routers */ 867c478bd9Sstevel@tonic-gate struct adv_prefix *pi_adv_prefix_list; /* Doubly linked adv.prefixes */ 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate uint_t pi_index; /* Identifier > 0 */ 897c478bd9Sstevel@tonic-gate char pi_name[LIFNAMSIZ]; /* Used to identify it */ 907c478bd9Sstevel@tonic-gate int pi_sock; /* For sending and receiving */ 917c478bd9Sstevel@tonic-gate struct in6_addr pi_ifaddr; /* Local address */ 927c478bd9Sstevel@tonic-gate uint_t pi_flags; /* IFF_* flags */ 937c478bd9Sstevel@tonic-gate uint_t pi_hdw_addr_len; 947c478bd9Sstevel@tonic-gate uchar_t pi_hdw_addr[ND_MAX_HDW_LEN]; 957c478bd9Sstevel@tonic-gate uint_t pi_mtu; /* From SIOCGLIFMTU */ 967c478bd9Sstevel@tonic-gate struct in6_addr pi_token; 977c478bd9Sstevel@tonic-gate uint_t pi_token_length; 987c478bd9Sstevel@tonic-gate struct in6_addr pi_tmp_token; /* For RFC3041 addrs */ 997c478bd9Sstevel@tonic-gate struct in6_addr pi_dst_token; /* For POINTOPOINT */ 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate uint_t pi_state; /* PI_* below */ 1027c478bd9Sstevel@tonic-gate uint_t pi_kernel_state; /* PI_* below */ 1037c478bd9Sstevel@tonic-gate uint_t pi_num_k_routers; /* # routers in kernel */ 1047c478bd9Sstevel@tonic-gate uint_t pi_reach_time_since_random; /* In milliseconds */ 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate /* Applies if pi_AdvSendAdvertisements */ 1077c478bd9Sstevel@tonic-gate uint_t pi_adv_time_left; /* In milliseconds */ 1087c478bd9Sstevel@tonic-gate uint_t pi_adv_time_since_sent; /* In milliseconds */ 1097c478bd9Sstevel@tonic-gate enum adv_states pi_adv_state; 1107c478bd9Sstevel@tonic-gate uint_t pi_adv_count; 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate /* Applies if not pi_AdvSendAdvertisements */ 1137c478bd9Sstevel@tonic-gate uint_t pi_sol_time_left; /* In milliseconds */ 1147c478bd9Sstevel@tonic-gate enum solicit_states pi_sol_state; 1157c478bd9Sstevel@tonic-gate uint_t pi_sol_count; 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate /* Interface specific configurable variables */ 1187c478bd9Sstevel@tonic-gate struct confvar pi_config[I_IFSIZE]; 1197c478bd9Sstevel@tonic-gate #define pi_DupAddrDetectTransmits pi_config[I_DupAddrDetectTransmits].cf_value 1207c478bd9Sstevel@tonic-gate #define pi_AdvSendAdvertisements pi_config[I_AdvSendAdvertisements].cf_value 1217c478bd9Sstevel@tonic-gate #define pi_MaxRtrAdvInterval pi_config[I_MaxRtrAdvInterval].cf_value 1227c478bd9Sstevel@tonic-gate #define pi_MinRtrAdvInterval pi_config[I_MinRtrAdvInterval].cf_value 1237c478bd9Sstevel@tonic-gate #define pi_AdvManagedFlag pi_config[I_AdvManagedFlag].cf_value 1247c478bd9Sstevel@tonic-gate #define pi_AdvOtherConfigFlag pi_config[I_AdvOtherConfigFlag].cf_value 1257c478bd9Sstevel@tonic-gate #define pi_AdvLinkMTU pi_config[I_AdvLinkMTU].cf_value 1267c478bd9Sstevel@tonic-gate #define pi_AdvReachableTime pi_config[I_AdvReachableTime].cf_value 1277c478bd9Sstevel@tonic-gate #define pi_AdvRetransTimer pi_config[I_AdvRetransTimer].cf_value 1287c478bd9Sstevel@tonic-gate #define pi_AdvCurHopLimit pi_config[I_AdvCurHopLimit].cf_value 1297c478bd9Sstevel@tonic-gate #define pi_AdvDefaultLifetime pi_config[I_AdvDefaultLifetime].cf_value 1307c478bd9Sstevel@tonic-gate #define pi_StatelessAddrConf pi_config[I_StatelessAddrConf].cf_value 1317c478bd9Sstevel@tonic-gate #define pi_TmpAddrsEnabled pi_config[I_TmpAddrsEnabled].cf_value 1327c478bd9Sstevel@tonic-gate #define pi_TmpValidLifetime pi_config[I_TmpValidLifetime].cf_value 1337c478bd9Sstevel@tonic-gate #define pi_TmpPreferredLifetime pi_config[I_TmpPreferredLifetime].cf_value 1347c478bd9Sstevel@tonic-gate #define pi_TmpRegenAdvance pi_config[I_TmpRegenAdvance].cf_value 1357c478bd9Sstevel@tonic-gate #define pi_TmpMaxDesyncFactor pi_config[I_TmpMaxDesyncFactor].cf_value 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gate /* Recorded variables for RFC3041 addresses */ 1387c478bd9Sstevel@tonic-gate uint_t pi_TmpDesyncFactor; /* In milliseconds */ 1397c478bd9Sstevel@tonic-gate uint_t pi_TmpRegenCountdown; /* In milliseconds */ 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gate /* Recorded variables on node/host */ 1427c478bd9Sstevel@tonic-gate uint_t pi_LinkMTU; 1437c478bd9Sstevel@tonic-gate uint_t pi_CurHopLimit; 1447c478bd9Sstevel@tonic-gate uint_t pi_BaseReachableTime; /* In milliseconds */ 1457c478bd9Sstevel@tonic-gate uint_t pi_ReachableTime; /* In milliseconds */ 1467c478bd9Sstevel@tonic-gate /* 1477c478bd9Sstevel@tonic-gate * The above value should be a uniformly-distributed random 1487c478bd9Sstevel@tonic-gate * value between ND_MIN_RANDOM_FACTOR and 1497c478bd9Sstevel@tonic-gate * ND_MAX_RANDOM_FACTOR times BaseReachableTime 1507c478bd9Sstevel@tonic-gate * milliseconds. A new random value should be 1517c478bd9Sstevel@tonic-gate * calculated when BaseReachableTime changes (due to 1527c478bd9Sstevel@tonic-gate * Router Advertisements) or at least every few hours 1537c478bd9Sstevel@tonic-gate * even if no Router Advertisements are received. 1547c478bd9Sstevel@tonic-gate * Tracked using pi_each_time_since_random. 1557c478bd9Sstevel@tonic-gate */ 1567c478bd9Sstevel@tonic-gate uint_t pi_RetransTimer; /* In milliseconds */ 1577c478bd9Sstevel@tonic-gate char *pi_group_name; 1587c478bd9Sstevel@tonic-gate }; 1597c478bd9Sstevel@tonic-gate 1607c478bd9Sstevel@tonic-gate /* 1617c478bd9Sstevel@tonic-gate * pi_state/pr_kernel_state values 1627c478bd9Sstevel@tonic-gate */ 1637c478bd9Sstevel@tonic-gate #define PI_PRESENT 0x01 1647c478bd9Sstevel@tonic-gate #define PI_JOINED_ALLNODES 0x02 /* allnodes multicast joined */ 1657c478bd9Sstevel@tonic-gate #define PI_JOINED_ALLROUTERS 0x04 /* allrouters multicast joined */ 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate /* 1687c478bd9Sstevel@tonic-gate * Prefix configuration variable indices 1697c478bd9Sstevel@tonic-gate */ 1707c478bd9Sstevel@tonic-gate #define I_AdvValidLifetime 0 /* In seconds */ 1717c478bd9Sstevel@tonic-gate #define I_AdvOnLinkFlag 1 1727c478bd9Sstevel@tonic-gate #define I_AdvPreferredLifetime 2 /* In seconds */ 1737c478bd9Sstevel@tonic-gate #define I_AdvAutonomousFlag 3 1747c478bd9Sstevel@tonic-gate #define I_AdvValidExpiration 4 /* Seconds left */ 1757c478bd9Sstevel@tonic-gate #define I_AdvPreferredExpiration 5 /* Seconds left */ 1767c478bd9Sstevel@tonic-gate #define I_PREFIXSIZE 6 /* # of variables */ 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate /* 1797c478bd9Sstevel@tonic-gate * A doubly linked list of prefixes for onlink and addrconf. 1807c478bd9Sstevel@tonic-gate */ 1817c478bd9Sstevel@tonic-gate struct prefix { 1827c478bd9Sstevel@tonic-gate struct prefix *pr_next; /* Next prefix for this physical */ 1837c478bd9Sstevel@tonic-gate struct prefix *pr_prev; /* Prev prefix for this physical */ 1847c478bd9Sstevel@tonic-gate struct phyint *pr_physical; /* Back pointer */ 1857c478bd9Sstevel@tonic-gate 1867c478bd9Sstevel@tonic-gate struct in6_addr pr_prefix; /* Used to indentify prefix */ 1877c478bd9Sstevel@tonic-gate uint_t pr_prefix_len; /* Num bits valid */ 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate char pr_name[LIFNAMSIZ]; 1907c478bd9Sstevel@tonic-gate struct in6_addr pr_address; 1917c478bd9Sstevel@tonic-gate uint64_t pr_flags; /* IFF_* flags */ 1927c478bd9Sstevel@tonic-gate 1937c478bd9Sstevel@tonic-gate uint_t pr_state; /* PR_ONLINK | PR_AUTO etc */ 1947c478bd9Sstevel@tonic-gate uint_t pr_kernel_state; /* PR_ONLINK | PR_AUTO etc */ 1957c478bd9Sstevel@tonic-gate boolean_t pr_in_use; /* To detect removed prefixes */ 1967c478bd9Sstevel@tonic-gate 1977c478bd9Sstevel@tonic-gate /* Recorded variables on node/host */ 1987c478bd9Sstevel@tonic-gate uint_t pr_ValidLifetime; /* In ms w/ 2 hour rule */ 1997c478bd9Sstevel@tonic-gate uint_t pr_PreferredLifetime; /* In millseconds */ 2007c478bd9Sstevel@tonic-gate uint_t pr_OnLinkLifetime; /* ms valid w/o 2 hour rule */ 2017c478bd9Sstevel@tonic-gate boolean_t pr_OnLinkFlag; 2027c478bd9Sstevel@tonic-gate boolean_t pr_AutonomousFlag; 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate uint_t pr_CreateTime; /* tmpaddr creation time */ 2057c478bd9Sstevel@tonic-gate /* in SECONDS */ 2067c478bd9Sstevel@tonic-gate }; 2077c478bd9Sstevel@tonic-gate 2087c478bd9Sstevel@tonic-gate /* 2097c478bd9Sstevel@tonic-gate * Flags used for pr_kernel_state and pr_state where the latter is 2107c478bd9Sstevel@tonic-gate * user-level state. 2117c478bd9Sstevel@tonic-gate */ 2127c478bd9Sstevel@tonic-gate #define PR_ONLINK 0x01 /* On-link */ 2137c478bd9Sstevel@tonic-gate #define PR_AUTO 0x02 /* Stateless addrconf */ 2147c478bd9Sstevel@tonic-gate #define PR_DEPRECATED 0x04 /* Address is deprecated */ 2157c478bd9Sstevel@tonic-gate #define PR_STATIC 0x08 /* Not created by ndpd */ 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate /* 2187c478bd9Sstevel@tonic-gate * The sum of all possible state string lengths, plus terminating 2197c478bd9Sstevel@tonic-gate * null character; if new states are added, this needs to be updated. 2207c478bd9Sstevel@tonic-gate * Useful for passing an appropriately sized buffer to prefix_print_state(). 2217c478bd9Sstevel@tonic-gate * 2227c478bd9Sstevel@tonic-gate * Current strings: "ONLINK ", "AUTO ", "DEPRECATED ", "STATIC ", "\n" 2237c478bd9Sstevel@tonic-gate * 7 + 5 + 11 + 7 + 1 2247c478bd9Sstevel@tonic-gate */ 2257c478bd9Sstevel@tonic-gate #define PREFIX_STATESTRLEN 31 2267c478bd9Sstevel@tonic-gate 2277c478bd9Sstevel@tonic-gate /* Prefix used for storing advertisement specific stuff */ 2287c478bd9Sstevel@tonic-gate struct adv_prefix { 2297c478bd9Sstevel@tonic-gate struct adv_prefix *adv_pr_next; /* Next prefix */ 2307c478bd9Sstevel@tonic-gate struct adv_prefix *adv_pr_prev; /* Prev prefix */ 2317c478bd9Sstevel@tonic-gate struct phyint *adv_pr_physical; /* Back pointer */ 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate struct in6_addr adv_pr_prefix; /* Used to indentify prefix */ 2347c478bd9Sstevel@tonic-gate uint_t adv_pr_prefix_len; /* Num bits valid */ 2357c478bd9Sstevel@tonic-gate 2367c478bd9Sstevel@tonic-gate /* Used when sending advertisements */ 2377c478bd9Sstevel@tonic-gate struct confvar adv_pr_config[I_PREFIXSIZE]; 2387c478bd9Sstevel@tonic-gate #define adv_pr_AdvValidLifetime adv_pr_config[I_AdvValidLifetime].cf_value 2397c478bd9Sstevel@tonic-gate #define adv_pr_AdvOnLinkFlag adv_pr_config[I_AdvOnLinkFlag].cf_value 2407c478bd9Sstevel@tonic-gate #define adv_pr_AdvPreferredLifetime \ 2417c478bd9Sstevel@tonic-gate adv_pr_config[I_AdvPreferredLifetime].cf_value 2427c478bd9Sstevel@tonic-gate #define adv_pr_AdvAutonomousFlag \ 2437c478bd9Sstevel@tonic-gate adv_pr_config[I_AdvAutonomousFlag].cf_value 2447c478bd9Sstevel@tonic-gate #define adv_pr_AdvValidExpiration \ 2457c478bd9Sstevel@tonic-gate adv_pr_config[I_AdvValidExpiration].cf_value 2467c478bd9Sstevel@tonic-gate #define adv_pr_AdvPreferredExpiration \ 2477c478bd9Sstevel@tonic-gate adv_pr_config[I_AdvPreferredExpiration].cf_value 2487c478bd9Sstevel@tonic-gate /* The two below are set if the timers decrement in real time */ 2497c478bd9Sstevel@tonic-gate #define adv_pr_AdvValidRealTime \ 2507c478bd9Sstevel@tonic-gate adv_pr_config[I_AdvValidExpiration].cf_notdefault 2517c478bd9Sstevel@tonic-gate #define adv_pr_AdvPreferredRealTime \ 2527c478bd9Sstevel@tonic-gate adv_pr_config[I_AdvPreferredExpiration].cf_notdefault 2537c478bd9Sstevel@tonic-gate }; 2547c478bd9Sstevel@tonic-gate 2557c478bd9Sstevel@tonic-gate /* 2567c478bd9Sstevel@tonic-gate * Doubly-linked list of default routers on a phyint. 2577c478bd9Sstevel@tonic-gate */ 2587c478bd9Sstevel@tonic-gate struct router { 2597c478bd9Sstevel@tonic-gate struct router *dr_next; /* Next router for this physical */ 2607c478bd9Sstevel@tonic-gate struct router *dr_prev; /* Prev router for this physical */ 2617c478bd9Sstevel@tonic-gate struct phyint *dr_physical; /* Back pointer */ 2627c478bd9Sstevel@tonic-gate 2637c478bd9Sstevel@tonic-gate struct in6_addr dr_address; /* Used to identify the router */ 2647c478bd9Sstevel@tonic-gate uint_t dr_lifetime; /* In milliseconds */ 2657c478bd9Sstevel@tonic-gate boolean_t dr_inkernel; /* Route added to kernel */ 2667c478bd9Sstevel@tonic-gate }; 2677c478bd9Sstevel@tonic-gate 2687c478bd9Sstevel@tonic-gate /* 2697c478bd9Sstevel@tonic-gate * Globals 2707c478bd9Sstevel@tonic-gate */ 2717c478bd9Sstevel@tonic-gate extern struct phyint *phyints; 2727c478bd9Sstevel@tonic-gate 2737c478bd9Sstevel@tonic-gate 2747c478bd9Sstevel@tonic-gate /* 2757c478bd9Sstevel@tonic-gate * Functions 2767c478bd9Sstevel@tonic-gate */ 2777c478bd9Sstevel@tonic-gate extern uint_t getcurrenttime(void); 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate extern struct phyint *phyint_lookup(char *name); 2807c478bd9Sstevel@tonic-gate extern struct phyint *phyint_lookup_on_index(uint_t ifindex); 2817c478bd9Sstevel@tonic-gate extern struct phyint *phyint_create(char *name); 2827c478bd9Sstevel@tonic-gate extern int phyint_init_from_k(struct phyint *pi); 2837c478bd9Sstevel@tonic-gate extern void phyint_delete(struct phyint *pi); 2847c478bd9Sstevel@tonic-gate extern uint_t phyint_timer(struct phyint *pi, uint_t elapsed); 2857c478bd9Sstevel@tonic-gate extern void phyint_print_all(void); 2867c478bd9Sstevel@tonic-gate extern void phyint_reach_random(struct phyint *pi, 2877c478bd9Sstevel@tonic-gate boolean_t set_needed); 2887c478bd9Sstevel@tonic-gate extern void phyint_cleanup(struct phyint *pi); 2897c478bd9Sstevel@tonic-gate 2907c478bd9Sstevel@tonic-gate extern boolean_t tmptoken_create(struct phyint *pi); 2917c478bd9Sstevel@tonic-gate extern void tmptoken_delete(struct phyint *pi); 2927c478bd9Sstevel@tonic-gate extern uint_t tmptoken_timer(struct phyint *pi, uint_t elapsed); 2937c478bd9Sstevel@tonic-gate extern boolean_t token_equal(struct in6_addr t1, struct in6_addr t2, 2947c478bd9Sstevel@tonic-gate int bits); 2957c478bd9Sstevel@tonic-gate 2967c478bd9Sstevel@tonic-gate extern struct prefix *prefix_create(struct phyint *pi, struct in6_addr addr, 2977c478bd9Sstevel@tonic-gate int addrlen, uint64_t flags); 2987c478bd9Sstevel@tonic-gate extern struct prefix *prefix_lookup_name(struct phyint *pi, char *name); 2997c478bd9Sstevel@tonic-gate extern struct prefix *prefix_lookup_addr_match(struct prefix *pr); 3007c478bd9Sstevel@tonic-gate extern struct prefix *prefix_create_name(struct phyint *pi, char *name); 3017c478bd9Sstevel@tonic-gate extern int prefix_init_from_k(struct prefix *pr); 3027c478bd9Sstevel@tonic-gate extern void prefix_delete(struct prefix *pr); 3037c478bd9Sstevel@tonic-gate extern boolean_t prefix_equal(struct in6_addr p1, struct in6_addr p2, 3047c478bd9Sstevel@tonic-gate int bits); 3057c478bd9Sstevel@tonic-gate extern void prefix_update_k(struct prefix *pr); 3067c478bd9Sstevel@tonic-gate extern uint_t prefix_timer(struct prefix *pr, uint_t elapsed); 3077c478bd9Sstevel@tonic-gate extern uint_t adv_prefix_timer(struct adv_prefix *adv_pr, 3087c478bd9Sstevel@tonic-gate uint_t elapsed); 3097c478bd9Sstevel@tonic-gate extern boolean_t prefix_token_match(struct phyint *pi, 3107c478bd9Sstevel@tonic-gate struct prefix *pr, uint64_t flags); 3117c478bd9Sstevel@tonic-gate extern struct prefix *prefix_lookup_addr(struct phyint *pi, 3127c478bd9Sstevel@tonic-gate struct in6_addr prefix); 3137c478bd9Sstevel@tonic-gate 3147c478bd9Sstevel@tonic-gate extern struct adv_prefix *adv_prefix_lookup(struct phyint *pi, 3157c478bd9Sstevel@tonic-gate struct in6_addr addr, int addrlen); 3167c478bd9Sstevel@tonic-gate extern struct adv_prefix *adv_prefix_create(struct phyint *pi, 3177c478bd9Sstevel@tonic-gate struct in6_addr addr, int addrlen); 3187c478bd9Sstevel@tonic-gate 3197c478bd9Sstevel@tonic-gate extern struct router *router_lookup(struct phyint *pi, struct in6_addr addr); 3207c478bd9Sstevel@tonic-gate extern struct router *router_create(struct phyint *pi, struct in6_addr addr, 3217c478bd9Sstevel@tonic-gate uint_t lifetime); 3227c478bd9Sstevel@tonic-gate extern void router_update_k(struct router *dr); 3237c478bd9Sstevel@tonic-gate extern uint_t router_timer(struct router *dr, uint_t elapsed); 3247c478bd9Sstevel@tonic-gate 3257c478bd9Sstevel@tonic-gate 3267c478bd9Sstevel@tonic-gate extern void logperror_pi(struct phyint *pi, char *str); 3277c478bd9Sstevel@tonic-gate extern void logperror_pr(struct prefix *pr, char *str); 3287c478bd9Sstevel@tonic-gate extern void check_to_advertise(struct phyint *pi, enum adv_events event); 3297c478bd9Sstevel@tonic-gate extern void check_to_solicit(struct phyint *pi, 3307c478bd9Sstevel@tonic-gate enum solicit_events event); 3317c478bd9Sstevel@tonic-gate extern uint_t advertise_event(struct phyint *pi, enum adv_events event, 3327c478bd9Sstevel@tonic-gate uint_t elapsed); 3337c478bd9Sstevel@tonic-gate extern uint_t solicit_event(struct phyint *pi, enum solicit_events event, 3347c478bd9Sstevel@tonic-gate uint_t elapsed); 3357c478bd9Sstevel@tonic-gate 3367c478bd9Sstevel@tonic-gate extern void print_route_sol(char *str, struct phyint *pi, 3377c478bd9Sstevel@tonic-gate struct nd_router_solicit *rs, int len, 3387c478bd9Sstevel@tonic-gate struct sockaddr_in6 *addr); 3397c478bd9Sstevel@tonic-gate extern void print_route_adv(char *str, struct phyint *pi, 3407c478bd9Sstevel@tonic-gate struct nd_router_advert *ra, int len, 3417c478bd9Sstevel@tonic-gate struct sockaddr_in6 *addr); 3427c478bd9Sstevel@tonic-gate extern void print_iflist(struct confvar *confvar); 3437c478bd9Sstevel@tonic-gate extern void print_prefixlist(struct confvar *confvar); 3447c478bd9Sstevel@tonic-gate 3457c478bd9Sstevel@tonic-gate extern void in_data(struct phyint *pi); 3467c478bd9Sstevel@tonic-gate 3477c478bd9Sstevel@tonic-gate extern void incoming_ra(struct phyint *pi, struct nd_router_advert *ra, 3487c478bd9Sstevel@tonic-gate int len, struct sockaddr_in6 *from, boolean_t loopback); 3497c478bd9Sstevel@tonic-gate 3507c478bd9Sstevel@tonic-gate extern boolean_t incoming_prefix_addrconf_process(struct phyint *pi, 3517c478bd9Sstevel@tonic-gate struct prefix *pr, uchar_t *opt, 3527c478bd9Sstevel@tonic-gate struct sockaddr_in6 *from, boolean_t loopback, 3537c478bd9Sstevel@tonic-gate boolean_t new_prefix); 3547c478bd9Sstevel@tonic-gate 3557c478bd9Sstevel@tonic-gate extern void incoming_prefix_onlink_process(struct prefix *pr, 3567c478bd9Sstevel@tonic-gate uchar_t *opt); 3577c478bd9Sstevel@tonic-gate 3587c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3597c478bd9Sstevel@tonic-gate } 3607c478bd9Sstevel@tonic-gate #endif 3617c478bd9Sstevel@tonic-gate 3627c478bd9Sstevel@tonic-gate #endif /* _NDPD_TABLES_H */ 363