]>
git.saurik.com Git - apple/xnu.git/blob - bsd/net/rtsock_mip.c
eccfc1dd65c93451a629b6c22f76b1313b52f8fb
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
27 /* to be included from net/rtsock.c - ugly but necessary for portability */
29 * Mobile IPv6 addition.
30 * Send a routing message to all routing socket listeners.
33 rt_mip6msg(cmd
, ifp
, rt
)
36 register struct rtentry
*rt
;
38 struct rt_addrinfo info
;
39 struct sockaddr
*sa
= 0;
41 register struct rt_msghdr
*rtm
;
44 printf("route_cb.any_count = %d\n", route_cb
.any_count
);
46 bzero((caddr_t
)&info
, sizeof(info
));
48 if (rt
== 0 || ifp
== 0)
50 netmask
= rt_mask(rt
);
51 dst
= sa
= rt_key(rt
);
52 gate
= rt
->rt_gateway
;
53 genmask
= rt
->rt_genmask
;
54 if ((m
= rt_msg1(cmd
, &info
)) == NULL
) {
56 printf("failure... \n");
60 rtm
= mtod(m
, struct rt_msghdr
*);
61 rtm
->rtm_index
= ifp
->if_index
;
62 rtm
->rtm_flags
|= rt
->rt_flags
;
63 rtm
->rtm_rmx
= rt
->rt_rmx
;
64 rtm
->rtm_addrs
= info
.rti_addrs
;
65 rtm
->rtm_flags
|= RTF_DONE
;
67 route_proto
.sp_protocol
= sa
? sa
->sa_family
: 0;
69 raw_input(m
, NULL
, &route_proto
, &route_src
, &route_dst
);
71 raw_input(m
, &route_proto
, &route_src
, &route_dst
);