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