2 * Glue for Mobility support integration to IPv6
5 * Antti Tuominen <ajtuomin@cc.hut.fi>
7 * $Id: s.mipglue.c 1.7 03/09/18 15:59:41+03:00 vnuorval@amber.hut.mediapoli.com $
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
16 #include <linux/sched.h>
19 #include <net/addrconf.h>
20 #include <net/neighbour.h>
21 #include <net/mipglue.h>
23 extern int ip6_tlvopt_unknown(struct sk_buff *skb, int optoff);
25 /* Initialize all zero */
26 struct mipv6_callable_functions mipv6_functions = { NULL };
28 /* Sets mipv6_functions struct to zero to invalidate all successive
29 * calls to mipv6 functions. Used on module unload. */
31 void mipv6_invalidate_calls(void)
33 memset(&mipv6_functions, 0, sizeof(mipv6_functions));
37 /* Selects correct handler for tlv encoded destination option. Called
38 * by ip6_parse_tlv. Checks if mipv6 calls are valid before calling. */
40 int mipv6_handle_dstopt(struct sk_buff *skb, int optoff)
44 switch (skb->nh.raw[optoff]) {
45 case MIPV6_TLV_HOMEADDR:
46 ret = MIPV6_CALLFUNC(mipv6_handle_homeaddr, 0)(skb, optoff);
49 /* Should never happen */
50 printk(KERN_ERR __FILE__ ": Invalid destination option code (%d)\n",
56 /* If mipv6 handlers are not valid, pass the packet to
57 * ip6_tlvopt_unknown() for correct handling. */
59 return ip6_tlvopt_unknown(skb, optoff);
64 EXPORT_SYMBOL(mipv6_functions);
65 EXPORT_SYMBOL(mipv6_invalidate_calls);