Print this page
3245 in.ndp daemon should not be session leader
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/defs.h
+++ new/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/defs.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #ifndef _NDPD_DEFS_H
27 27 #define _NDPD_DEFS_H
28 28
29 29 #include <stdio.h>
30 30 #include <stdlib.h>
31 31 #include <strings.h>
32 32 #include <errno.h>
33 33 #include <sys/types.h>
34 34 #include <fcntl.h>
35 35 #include <signal.h>
36 36 #include <poll.h>
37 37 #include <unistd.h>
38 38 #include <time.h>
39 39 #include <stdarg.h>
40 40 #include <syslog.h>
41 41
42 42 #include <sys/param.h>
43 43 #include <sys/socket.h>
44 44 #include <arpa/inet.h>
45 45 #include <netdb.h>
46 46
47 47 #include <sys/ioctl.h>
48 48 #include <sys/sockio.h>
49 49 #include <net/if.h>
50 50 #include <sys/stropts.h>
51 51
52 52 #include <string.h>
53 53 #include <ctype.h>
54 54
55 55 #include <netinet/in_systm.h>
56 56 #include <netinet/in.h>
57 57 #include <netinet/ip.h>
58 58 #include <netinet/ip_icmp.h>
59 59 #include <netinet/if_ether.h>
60 60 #include <netinet/ip6.h>
61 61 #include <netinet/icmp6.h>
62 62 #include <net/route.h>
63 63 #include <libipadm.h>
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
64 64 #include <ipadm_ndpd.h>
65 65
66 66 #include "tables.h"
67 67
68 68 #ifdef __cplusplus
69 69 extern "C" {
70 70 #endif
71 71
72 72 #define CURHOP_UNSPECIFIED 0
73 73 #define PATH_NDPD_CONF "/etc/inet/ndpd.conf"
74 -#define PATH_PID "/var/run/in.ndpd.pid"
75 74
76 75 extern int debug, no_loopback;
77 76
78 77 extern struct in6_addr all_nodes_mcast;
79 78 extern struct in6_addr all_routers_mcast;
80 79
81 80 extern int rtsock;
82 81 extern struct rt_msghdr *rt_msg;
83 82 extern struct sockaddr_in6 *rta_gateway;
84 83 extern struct sockaddr_dl *rta_ifp;
85 84
86 85 /* Debug flags */
87 86 #define D_ALL 0xffff
88 87 #define D_DEFAULTS 0x0001 /* Default values in config file */
89 88 #define D_CONFIG 0x0002 /* Config file */
90 89 #define D_PHYINT 0x0004 /* phyint table */
91 90 #define D_PREFIX 0x0008 /* prefix table */
92 91 #define D_ROUTER 0x0010 /* router table */
93 92 #define D_STATE 0x0020 /* RS/RA state machine */
94 93 #define D_IFSCAN 0x0040 /* Scan of kernel interfaces */
95 94 #define D_TIMER 0x0080 /* Timer mechanism */
96 95 #define D_PARSE 0x0100 /* config file parser */
97 96 #define D_PKTIN 0x0200 /* Received packet */
98 97 #define D_PKTBAD 0x0400 /* Malformed packet */
99 98 #define D_PKTOUT 0x0800 /* Sent packet */
100 99 #define D_TMP 0x1000 /* RFC3041 mechanism */
101 100 #define D_DHCP 0x2000 /* RFC3315 DHCPv6 (stateful addrs) */
102 101
103 102 #define IF_SEPARATOR ':'
104 103 #define IPV6_MAX_HOPS 255
105 104 #define IPV6_MIN_MTU (1024+256)
106 105 #define IPV6_ABITS 128
107 106 #define TMP_TOKEN_BITS 64
108 107 #define TMP_TOKEN_BYTES (TMP_TOKEN_BITS / 8)
109 108 #define MAX_DAD_FAILURES 5
110 109
111 110 /* Return a random number from a an range inclusive of the endpoints */
112 111 #define GET_RANDOM(LOW, HIGH) (random() % ((HIGH) - (LOW) + 1) + (LOW))
113 112
114 113 #define TIMER_INFINITY 0xFFFFFFFFU /* Never time out */
115 114 #define PREFIX_INFINITY 0XFFFFFFFFU /* A "forever" prefix lifetime */
116 115
117 116 /*
118 117 * Used by 2 hour rule for stateless addrconf
119 118 */
120 119 #define MIN_VALID_LIFETIME (2*60*60) /* In seconds */
121 120
122 121 /*
123 122 * Control how often pi_ReachableTime gets re-randomized
124 123 */
125 124 #define MIN_REACH_RANDOM_INTERVAL (60*1000) /* 1 minute in ms */
126 125 #define MAX_REACH_RANDOM_INTERVAL (60*60*1000) /* 1 hour in ms */
127 126
128 127 /*
129 128 * Parsing constants
130 129 */
131 130 #define MAXLINELEN 4096
132 131 #define MAXARGSPERLINE 128
133 132
134 133 void timer_schedule(uint_t delay);
135 134 extern void logmsg(int level, const char *fmt, ...);
136 135 extern void logperror(const char *str);
137 136 extern void logperror_pi(const struct phyint *pi, const char *str);
138 137 extern void logperror_pr(const struct prefix *pr, const char *str);
139 138 extern int parse_config(char *config_file, boolean_t file_required);
140 139
141 140 extern int poll_add(int fd);
142 141 extern int poll_remove(int fd);
143 142
144 143 extern char *fmt_lla(char *llabuf, int bufsize, uchar_t *lla, int llalen);
145 144
146 145 extern int do_dad(char *ifname, struct sockaddr_in6 *testaddr);
147 146
148 147 #ifdef __cplusplus
149 148 }
150 149 #endif
151 150
152 151 #endif /* _NDPD_DEFS_H */
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX