| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: rtadvd.c,v 1.36 2011/12/10 19:14:29 roy Exp $ */ | | 1 | /* $NetBSD: rtadvd.c,v 1.37 2011/12/11 15:25:52 joerg Exp $ */ |
2 | /* $KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $ */ | | 2 | /* $KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | | 5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -134,29 +134,28 @@ struct sockaddr_in6 sin6_linklocal_allno | | | @@ -134,29 +134,28 @@ struct sockaddr_in6 sin6_linklocal_allno |
134 | .sin6_addr = IN6ADDR_LINKLOCAL_ALLNODES_INIT, | | 134 | .sin6_addr = IN6ADDR_LINKLOCAL_ALLNODES_INIT, |
135 | }; | | 135 | }; |
136 | struct sockaddr_in6 sin6_linklocal_allrouters = { | | 136 | struct sockaddr_in6 sin6_linklocal_allrouters = { |
137 | .sin6_len = sizeof(sin6_linklocal_allrouters), | | 137 | .sin6_len = sizeof(sin6_linklocal_allrouters), |
138 | .sin6_family = AF_INET6, | | 138 | .sin6_family = AF_INET6, |
139 | .sin6_addr = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT, | | 139 | .sin6_addr = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT, |
140 | }; | | 140 | }; |
141 | struct sockaddr_in6 sin6_sitelocal_allrouters = { | | 141 | struct sockaddr_in6 sin6_sitelocal_allrouters = { |
142 | .sin6_len = sizeof(sin6_sitelocal_allrouters), | | 142 | .sin6_len = sizeof(sin6_sitelocal_allrouters), |
143 | .sin6_family = AF_INET6, | | 143 | .sin6_family = AF_INET6, |
144 | .sin6_addr = IN6ADDR_SITELOCAL_ALLROUTERS_INIT, | | 144 | .sin6_addr = IN6ADDR_SITELOCAL_ALLROUTERS_INIT, |
145 | }; | | 145 | }; |
146 | | | 146 | |
147 | int main(int, char *[]); | | | |
148 | static void set_die(int); | | 147 | static void set_die(int); |
149 | static void die(void); | | 148 | static void die(void) __dead; |
150 | static void sock_open(void); | | 149 | static void sock_open(void); |
151 | static void rtsock_open(void); | | 150 | static void rtsock_open(void); |
152 | static void rtadvd_input(void); | | 151 | static void rtadvd_input(void); |
153 | static void rs_input(int, struct nd_router_solicit *, | | 152 | static void rs_input(int, struct nd_router_solicit *, |
154 | struct in6_pktinfo *, struct sockaddr_in6 *); | | 153 | struct in6_pktinfo *, struct sockaddr_in6 *); |
155 | static void ra_input(int, struct nd_router_advert *, | | 154 | static void ra_input(int, struct nd_router_advert *, |
156 | struct in6_pktinfo *, struct sockaddr_in6 *); | | 155 | struct in6_pktinfo *, struct sockaddr_in6 *); |
157 | static int prefix_check(struct nd_opt_prefix_info *, struct rainfo *, | | 156 | static int prefix_check(struct nd_opt_prefix_info *, struct rainfo *, |
158 | struct sockaddr_in6 *); | | 157 | struct sockaddr_in6 *); |
159 | static int nd6_options(struct nd_opt_hdr *, int, union nd_opts *, uint32_t); | | 158 | static int nd6_options(struct nd_opt_hdr *, int, union nd_opts *, uint32_t); |
160 | static void free_ndopts(union nd_opts *); | | 159 | static void free_ndopts(union nd_opts *); |
161 | static void ra_output(struct rainfo *); | | 160 | static void ra_output(struct rainfo *); |
162 | static void rtmsg_input(void); | | 161 | static void rtmsg_input(void); |