11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * INET An implementation of the TCP/IP protocol suite for the LINUX 31da177e4SLinus Torvalds * operating system. INET is implemented using the BSD Socket 41da177e4SLinus Torvalds * interface as the means of communication with the user level. 51da177e4SLinus Torvalds * 61da177e4SLinus Torvalds * Definitions for the Forwarding Information Base. 71da177e4SLinus Torvalds * 81da177e4SLinus Torvalds * Authors: A.N.Kuznetsov, <[email protected]> 91da177e4SLinus Torvalds * 101da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or 111da177e4SLinus Torvalds * modify it under the terms of the GNU General Public License 121da177e4SLinus Torvalds * as published by the Free Software Foundation; either version 131da177e4SLinus Torvalds * 2 of the License, or (at your option) any later version. 141da177e4SLinus Torvalds */ 151da177e4SLinus Torvalds 161da177e4SLinus Torvalds #ifndef _NET_IP_FIB_H 171da177e4SLinus Torvalds #define _NET_IP_FIB_H 181da177e4SLinus Torvalds 191da177e4SLinus Torvalds #include <net/flow.h> 201da177e4SLinus Torvalds #include <linux/seq_file.h> 214895c771SDavid S. Miller #include <linux/rcupdate.h> 22e1ef4bf2SThomas Graf #include <net/fib_rules.h> 238e773277SDavid S. Miller #include <net/inetpeer.h> 24d26b3a7cSEric Dumazet #include <linux/percpu.h> 251da177e4SLinus Torvalds 264e902c57SThomas Graf struct fib_config { 274e902c57SThomas Graf u8 fc_dst_len; 284e902c57SThomas Graf u8 fc_tos; 294e902c57SThomas Graf u8 fc_protocol; 304e902c57SThomas Graf u8 fc_scope; 314e902c57SThomas Graf u8 fc_type; 32b52f070cSThomas Graf /* 3 bytes unused */ 334e902c57SThomas Graf u32 fc_table; 346d85c10aSAl Viro __be32 fc_dst; 356d85c10aSAl Viro __be32 fc_gw; 364e902c57SThomas Graf int fc_oif; 374e902c57SThomas Graf u32 fc_flags; 384e902c57SThomas Graf u32 fc_priority; 396d85c10aSAl Viro __be32 fc_prefsrc; 404e902c57SThomas Graf struct nlattr *fc_mx; 414e902c57SThomas Graf struct rtnexthop *fc_mp; 424e902c57SThomas Graf int fc_mx_len; 434e902c57SThomas Graf int fc_mp_len; 444e902c57SThomas Graf u32 fc_flow; 454e902c57SThomas Graf u32 fc_nlflags; 464e902c57SThomas Graf struct nl_info fc_nlinfo; 47571e7226SRoopa Prabhu struct nlattr *fc_encap; 48571e7226SRoopa Prabhu u16 fc_encap_type; 491da177e4SLinus Torvalds }; 501da177e4SLinus Torvalds 511da177e4SLinus Torvalds struct fib_info; 52f2bb4bedSDavid S. Miller struct rtable; 531da177e4SLinus Torvalds 544895c771SDavid S. Miller struct fib_nh_exception { 554895c771SDavid S. Miller struct fib_nh_exception __rcu *fnhe_next; 565aad1de5STimo Teräs int fnhe_genid; 574895c771SDavid S. Miller __be32 fnhe_daddr; 584895c771SDavid S. Miller u32 fnhe_pmtu; 59aee06da6SJulian Anastasov __be32 fnhe_gw; 604895c771SDavid S. Miller unsigned long fnhe_expires; 612ffae99dSTimo Teräs struct rtable __rcu *fnhe_rth_input; 622ffae99dSTimo Teräs struct rtable __rcu *fnhe_rth_output; 634895c771SDavid S. Miller unsigned long fnhe_stamp; 64*deed49dfSXin Long struct rcu_head rcu; 654895c771SDavid S. Miller }; 664895c771SDavid S. Miller 674895c771SDavid S. Miller struct fnhe_hash_bucket { 684895c771SDavid S. Miller struct fib_nh_exception __rcu *chain; 694895c771SDavid S. Miller }; 704895c771SDavid S. Miller 71d546c621SEric Dumazet #define FNHE_HASH_SHIFT 11 72d546c621SEric Dumazet #define FNHE_HASH_SIZE (1 << FNHE_HASH_SHIFT) 734895c771SDavid S. Miller #define FNHE_RECLAIM_DEPTH 5 744895c771SDavid S. Miller 751da177e4SLinus Torvalds struct fib_nh { 761da177e4SLinus Torvalds struct net_device *nh_dev; 771da177e4SLinus Torvalds struct hlist_node nh_hash; 781da177e4SLinus Torvalds struct fib_info *nh_parent; 7995c96174SEric Dumazet unsigned int nh_flags; 801da177e4SLinus Torvalds unsigned char nh_scope; 811da177e4SLinus Torvalds #ifdef CONFIG_IP_ROUTE_MULTIPATH 821da177e4SLinus Torvalds int nh_weight; 830e884c78SPeter Nørlund atomic_t nh_upper_bound; 841da177e4SLinus Torvalds #endif 85c7066f70SPatrick McHardy #ifdef CONFIG_IP_ROUTE_CLASSID 861da177e4SLinus Torvalds __u32 nh_tclassid; 871da177e4SLinus Torvalds #endif 881da177e4SLinus Torvalds int nh_oif; 89ed49e3caSAl Viro __be32 nh_gw; 901fc050a1SDavid S. Miller __be32 nh_saddr; 91436c3b66SDavid S. Miller int nh_saddr_genid; 92d26b3a7cSEric Dumazet struct rtable __rcu * __percpu *nh_pcpu_rth_output; 9354764bb6SEric Dumazet struct rtable __rcu *nh_rth_input; 94caa41527SEric Dumazet struct fnhe_hash_bucket __rcu *nh_exceptions; 95571e7226SRoopa Prabhu struct lwtunnel_state *nh_lwtstate; 961da177e4SLinus Torvalds }; 971da177e4SLinus Torvalds 981da177e4SLinus Torvalds /* 991da177e4SLinus Torvalds * This structure contains data shared by many of routes. 1001da177e4SLinus Torvalds */ 1011da177e4SLinus Torvalds 1021da177e4SLinus Torvalds struct fib_info { 1031da177e4SLinus Torvalds struct hlist_node fib_hash; 1041da177e4SLinus Torvalds struct hlist_node fib_lhash; 1057462bd74SDenis V. Lunev struct net *fib_net; 1061da177e4SLinus Torvalds int fib_treeref; 1071da177e4SLinus Torvalds atomic_t fib_clntref; 10895c96174SEric Dumazet unsigned int fib_flags; 10937e826c5SDavid S. Miller unsigned char fib_dead; 11037e826c5SDavid S. Miller unsigned char fib_protocol; 11137e826c5SDavid S. Miller unsigned char fib_scope; 112f4ef85bbSEric Dumazet unsigned char fib_type; 113b83738aeSAl Viro __be32 fib_prefsrc; 1141da177e4SLinus Torvalds u32 fib_priority; 1159c150e82SDavid S. Miller u32 *fib_metrics; 1161da177e4SLinus Torvalds #define fib_mtu fib_metrics[RTAX_MTU-1] 1171da177e4SLinus Torvalds #define fib_window fib_metrics[RTAX_WINDOW-1] 1181da177e4SLinus Torvalds #define fib_rtt fib_metrics[RTAX_RTT-1] 1191da177e4SLinus Torvalds #define fib_advmss fib_metrics[RTAX_ADVMSS-1] 1201da177e4SLinus Torvalds int fib_nhs; 1211da177e4SLinus Torvalds #ifdef CONFIG_IP_ROUTE_MULTIPATH 1220e884c78SPeter Nørlund int fib_weight; 1231da177e4SLinus Torvalds #endif 124ebc0ffaeSEric Dumazet struct rcu_head rcu; 1251da177e4SLinus Torvalds struct fib_nh fib_nh[0]; 1261da177e4SLinus Torvalds #define fib_dev fib_nh[0].nh_dev 1271da177e4SLinus Torvalds }; 1281da177e4SLinus Torvalds 1291da177e4SLinus Torvalds 1301da177e4SLinus Torvalds #ifdef CONFIG_IP_MULTIPLE_TABLES 1311da177e4SLinus Torvalds struct fib_rule; 1321da177e4SLinus Torvalds #endif 1331da177e4SLinus Torvalds 1345b470441SDavid S. Miller struct fib_table; 1351da177e4SLinus Torvalds struct fib_result { 1361da177e4SLinus Torvalds unsigned char prefixlen; 1371da177e4SLinus Torvalds unsigned char nh_sel; 1381da177e4SLinus Torvalds unsigned char type; 1391da177e4SLinus Torvalds unsigned char scope; 14085b91b03SDavid S. Miller u32 tclassid; 1411da177e4SLinus Torvalds struct fib_info *fi; 1425b470441SDavid S. Miller struct fib_table *table; 14356315f9eSAlexander Duyck struct hlist_head *fa_head; 1441da177e4SLinus Torvalds }; 1451da177e4SLinus Torvalds 146246955feSRobert Olsson struct fib_result_nl { 14780e856e1SAl Viro __be32 fl_addr; /* To be looked up*/ 1485f300893SThomas Graf u32 fl_mark; 149246955feSRobert Olsson unsigned char fl_tos; 150246955feSRobert Olsson unsigned char fl_scope; 151246955feSRobert Olsson unsigned char tb_id_in; 152246955feSRobert Olsson 153246955feSRobert Olsson unsigned char tb_id; /* Results */ 154246955feSRobert Olsson unsigned char prefixlen; 155246955feSRobert Olsson unsigned char nh_sel; 156246955feSRobert Olsson unsigned char type; 157246955feSRobert Olsson unsigned char scope; 158246955feSRobert Olsson int err; 159246955feSRobert Olsson }; 1601da177e4SLinus Torvalds 1611da177e4SLinus Torvalds #ifdef CONFIG_IP_ROUTE_MULTIPATH 1621da177e4SLinus Torvalds #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) 1631da177e4SLinus Torvalds #else /* CONFIG_IP_ROUTE_MULTIPATH */ 1641da177e4SLinus Torvalds #define FIB_RES_NH(res) ((res).fi->fib_nh[0]) 1651da177e4SLinus Torvalds #endif /* CONFIG_IP_ROUTE_MULTIPATH */ 1661da177e4SLinus Torvalds 1675b9e12dbSDenis V. Lunev #ifdef CONFIG_IP_MULTIPLE_TABLES 1685b9e12dbSDenis V. Lunev #define FIB_TABLE_HASHSZ 256 1695b9e12dbSDenis V. Lunev #else 1705b9e12dbSDenis V. Lunev #define FIB_TABLE_HASHSZ 2 1715b9e12dbSDenis V. Lunev #endif 1725b9e12dbSDenis V. Lunev 1735c3a0fd7SJoe Perches __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); 174436c3b66SDavid S. Miller 175436c3b66SDavid S. Miller #define FIB_RES_SADDR(net, res) \ 176436c3b66SDavid S. Miller ((FIB_RES_NH(res).nh_saddr_genid == \ 177436c3b66SDavid S. Miller atomic_read(&(net)->ipv4.dev_addr_genid)) ? \ 178436c3b66SDavid S. Miller FIB_RES_NH(res).nh_saddr : \ 179436c3b66SDavid S. Miller fib_info_update_nh_saddr((net), &FIB_RES_NH(res))) 1801da177e4SLinus Torvalds #define FIB_RES_GW(res) (FIB_RES_NH(res).nh_gw) 1811da177e4SLinus Torvalds #define FIB_RES_DEV(res) (FIB_RES_NH(res).nh_dev) 1821da177e4SLinus Torvalds #define FIB_RES_OIF(res) (FIB_RES_NH(res).nh_oif) 1831da177e4SLinus Torvalds 184436c3b66SDavid S. Miller #define FIB_RES_PREFSRC(net, res) ((res).fi->fib_prefsrc ? : \ 185436c3b66SDavid S. Miller FIB_RES_SADDR(net, res)) 1861fc050a1SDavid S. Miller 1871da177e4SLinus Torvalds struct fib_table { 1881af5a8c4SPatrick McHardy struct hlist_node tb_hlist; 1892dfe55b4SPatrick McHardy u32 tb_id; 19021d8c49eSDavid S. Miller int tb_num_default; 191a7e53531SAlexander Duyck struct rcu_head rcu; 1920ddcf43dSAlexander Duyck unsigned long *tb_data; 1930ddcf43dSAlexander Duyck unsigned long __data[0]; 1941da177e4SLinus Torvalds }; 1951da177e4SLinus Torvalds 1965c3a0fd7SJoe Perches int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, 197ebc0ffaeSEric Dumazet struct fib_result *res, int fib_flags); 1985c3a0fd7SJoe Perches int fib_table_insert(struct fib_table *, struct fib_config *); 1995c3a0fd7SJoe Perches int fib_table_delete(struct fib_table *, struct fib_config *); 2005c3a0fd7SJoe Perches int fib_table_dump(struct fib_table *table, struct sk_buff *skb, 20116c6cf8bSStephen Hemminger struct netlink_callback *cb); 2025c3a0fd7SJoe Perches int fib_table_flush(struct fib_table *table); 2030ddcf43dSAlexander Duyck struct fib_table *fib_trie_unmerge(struct fib_table *main_tb); 204104616e7SScott Feldman void fib_table_flush_external(struct fib_table *table); 2055c3a0fd7SJoe Perches void fib_free_table(struct fib_table *tb); 2064aa2c466SPavel Emelyanov 2071da177e4SLinus Torvalds #ifndef CONFIG_IP_MULTIPLE_TABLES 2081da177e4SLinus Torvalds 209a5a519b2SAlexander Duyck #define TABLE_LOCAL_INDEX (RT_TABLE_LOCAL & (FIB_TABLE_HASHSZ - 1)) 210a5a519b2SAlexander Duyck #define TABLE_MAIN_INDEX (RT_TABLE_MAIN & (FIB_TABLE_HASHSZ - 1)) 2111da177e4SLinus Torvalds 2128ad4942cSDenis V. Lunev static inline struct fib_table *fib_get_table(struct net *net, u32 id) 2131da177e4SLinus Torvalds { 214a7e53531SAlexander Duyck struct hlist_node *tb_hlist; 21593456b6dSDenis V. Lunev struct hlist_head *ptr; 21693456b6dSDenis V. Lunev 21793456b6dSDenis V. Lunev ptr = id == RT_TABLE_LOCAL ? 218e4aef8aeSDenis V. Lunev &net->ipv4.fib_table_hash[TABLE_LOCAL_INDEX] : 219e4aef8aeSDenis V. Lunev &net->ipv4.fib_table_hash[TABLE_MAIN_INDEX]; 220a7e53531SAlexander Duyck 221a7e53531SAlexander Duyck tb_hlist = rcu_dereference_rtnl(hlist_first_rcu(ptr)); 222a7e53531SAlexander Duyck 223a7e53531SAlexander Duyck return hlist_entry(tb_hlist, struct fib_table, tb_hlist); 2241da177e4SLinus Torvalds } 2251da177e4SLinus Torvalds 2268ad4942cSDenis V. Lunev static inline struct fib_table *fib_new_table(struct net *net, u32 id) 2271da177e4SLinus Torvalds { 2288ad4942cSDenis V. Lunev return fib_get_table(net, id); 2291da177e4SLinus Torvalds } 2301da177e4SLinus Torvalds 23122bd5b9bSDavid S. Miller static inline int fib_lookup(struct net *net, const struct flowi4 *flp, 2320eeb075fSAndy Gospodarek struct fib_result *res, unsigned int flags) 2331da177e4SLinus Torvalds { 234a7e53531SAlexander Duyck struct fib_table *tb; 2350ddcf43dSAlexander Duyck int err = -ENETUNREACH; 23693456b6dSDenis V. Lunev 237345e9b54SAlexander Duyck rcu_read_lock(); 23893456b6dSDenis V. Lunev 239a7e53531SAlexander Duyck tb = fib_get_table(net, RT_TABLE_MAIN); 2400315e382SNikola Forró if (tb) 2410315e382SNikola Forró err = fib_table_lookup(tb, flp, res, flags | FIB_LOOKUP_NOREF); 2420315e382SNikola Forró 2430315e382SNikola Forró if (err == -EAGAIN) 2440315e382SNikola Forró err = -ENETUNREACH; 245345e9b54SAlexander Duyck 246345e9b54SAlexander Duyck rcu_read_unlock(); 247345e9b54SAlexander Duyck 248345e9b54SAlexander Duyck return err; 2491da177e4SLinus Torvalds } 2501da177e4SLinus Torvalds 2511da177e4SLinus Torvalds #else /* CONFIG_IP_MULTIPLE_TABLES */ 2525c3a0fd7SJoe Perches int __net_init fib4_rules_init(struct net *net); 2535c3a0fd7SJoe Perches void __net_exit fib4_rules_exit(struct net *net); 254c3e9a353SPavel Emelyanov 2555c3a0fd7SJoe Perches struct fib_table *fib_new_table(struct net *net, u32 id); 2565c3a0fd7SJoe Perches struct fib_table *fib_get_table(struct net *net, u32 id); 2571da177e4SLinus Torvalds 2580eeb075fSAndy Gospodarek int __fib_lookup(struct net *net, struct flowi4 *flp, 2590eeb075fSAndy Gospodarek struct fib_result *res, unsigned int flags); 260f4530fa5SDavid S. Miller 261f4530fa5SDavid S. Miller static inline int fib_lookup(struct net *net, struct flowi4 *flp, 2620eeb075fSAndy Gospodarek struct fib_result *res, unsigned int flags) 263f4530fa5SDavid S. Miller { 264a7e53531SAlexander Duyck struct fib_table *tb; 2650315e382SNikola Forró int err = -ENETUNREACH; 266a7e53531SAlexander Duyck 2670eeb075fSAndy Gospodarek flags |= FIB_LOOKUP_NOREF; 268a7e53531SAlexander Duyck if (net->ipv4.fib_has_custom_rules) 2690eeb075fSAndy Gospodarek return __fib_lookup(net, flp, res, flags); 270345e9b54SAlexander Duyck 271345e9b54SAlexander Duyck rcu_read_lock(); 272345e9b54SAlexander Duyck 27385b91b03SDavid S. Miller res->tclassid = 0; 274a7e53531SAlexander Duyck 275a7e53531SAlexander Duyck tb = rcu_dereference_rtnl(net->ipv4.fib_main); 2760315e382SNikola Forró if (tb) 2770315e382SNikola Forró err = fib_table_lookup(tb, flp, res, flags); 2780315e382SNikola Forró 2790315e382SNikola Forró if (!err) 2800315e382SNikola Forró goto out; 281a7e53531SAlexander Duyck 282a7e53531SAlexander Duyck tb = rcu_dereference_rtnl(net->ipv4.fib_default); 2830315e382SNikola Forró if (tb) 2840315e382SNikola Forró err = fib_table_lookup(tb, flp, res, flags); 2850315e382SNikola Forró 2860315e382SNikola Forró out: 2870315e382SNikola Forró if (err == -EAGAIN) 2880315e382SNikola Forró err = -ENETUNREACH; 289345e9b54SAlexander Duyck 290345e9b54SAlexander Duyck rcu_read_unlock(); 291345e9b54SAlexander Duyck 292345e9b54SAlexander Duyck return err; 293f4530fa5SDavid S. Miller } 294f4530fa5SDavid S. Miller 2951da177e4SLinus Torvalds #endif /* CONFIG_IP_MULTIPLE_TABLES */ 2961da177e4SLinus Torvalds 2971da177e4SLinus Torvalds /* Exported by fib_frontend.c */ 298ef7c79edSPatrick McHardy extern const struct nla_policy rtm_ipv4_policy[]; 2995c3a0fd7SJoe Perches void ip_fib_init(void); 3005c3a0fd7SJoe Perches __be32 fib_compute_spec_dst(struct sk_buff *skb); 3015c3a0fd7SJoe Perches int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, 3025c04c819SMichael Smith u8 tos, int oif, struct net_device *dev, 3039e56e380SDavid S. Miller struct in_device *idev, u32 *itag); 3042392debcSJulian Anastasov void fib_select_default(const struct flowi4 *flp, struct fib_result *res); 3057a9bc9b8SDavid S. Miller #ifdef CONFIG_IP_ROUTE_CLASSID 306f4530fa5SDavid S. Miller static inline int fib_num_tclassid_users(struct net *net) 307f4530fa5SDavid S. Miller { 308f4530fa5SDavid S. Miller return net->ipv4.fib_num_tclassid_users; 309f4530fa5SDavid S. Miller } 3107a9bc9b8SDavid S. Miller #else 311f4530fa5SDavid S. Miller static inline int fib_num_tclassid_users(struct net *net) 312f4530fa5SDavid S. Miller { 313f4530fa5SDavid S. Miller return 0; 314f4530fa5SDavid S. Miller } 3157a9bc9b8SDavid S. Miller #endif 3160ddcf43dSAlexander Duyck int fib_unmerge(struct net *net); 317104616e7SScott Feldman void fib_flush_external(struct net *net); 31814c85021SArnaldo Carvalho de Melo 3191da177e4SLinus Torvalds /* Exported by fib_semantics.c */ 3205c3a0fd7SJoe Perches int ip_fib_check_default(__be32 gw, struct net_device *dev); 3214f823defSJulian Anastasov int fib_sync_down_dev(struct net_device *dev, unsigned long event, bool force); 3225c3a0fd7SJoe Perches int fib_sync_down_addr(struct net *net, __be32 local); 3238a3d0316SAndy Gospodarek int fib_sync_up(struct net_device *dev, unsigned int nh_flags); 3240e884c78SPeter Nørlund 3250e884c78SPeter Nørlund extern u32 fib_multipath_secret __read_mostly; 3260e884c78SPeter Nørlund 3270e884c78SPeter Nørlund static inline int fib_multipath_hash(__be32 saddr, __be32 daddr) 3280e884c78SPeter Nørlund { 3290797cbd8SLance Richardson return jhash_2words((__force u32)saddr, (__force u32)daddr, 3300797cbd8SLance Richardson fib_multipath_secret) >> 1; 3310e884c78SPeter Nørlund } 3320e884c78SPeter Nørlund 3330e884c78SPeter Nørlund void fib_select_multipath(struct fib_result *res, int hash); 3343ce58d84SDavid Ahern void fib_select_path(struct net *net, struct fib_result *res, 3353ce58d84SDavid Ahern struct flowi4 *fl4, int mp_hash); 3361da177e4SLinus Torvalds 3375348ba85SDavid S. Miller /* Exported by fib_trie.c */ 3385c3a0fd7SJoe Perches void fib_trie_init(void); 3390ddcf43dSAlexander Duyck struct fib_table *fib_trie_table(u32 id, struct fib_table *alias); 3401da177e4SLinus Torvalds 341b6bf3ca0SDavid S. Miller static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) 3421da177e4SLinus Torvalds { 343c7066f70SPatrick McHardy #ifdef CONFIG_IP_ROUTE_CLASSID 3441da177e4SLinus Torvalds #ifdef CONFIG_IP_MULTIPLE_TABLES 3451da177e4SLinus Torvalds u32 rtag; 3461da177e4SLinus Torvalds #endif 3471da177e4SLinus Torvalds *itag = FIB_RES_NH(*res).nh_tclassid<<16; 3481da177e4SLinus Torvalds #ifdef CONFIG_IP_MULTIPLE_TABLES 34985b91b03SDavid S. Miller rtag = res->tclassid; 3501da177e4SLinus Torvalds if (*itag == 0) 3511da177e4SLinus Torvalds *itag = (rtag<<16); 3521da177e4SLinus Torvalds *itag |= (rtag>>16); 3531da177e4SLinus Torvalds #endif 3541da177e4SLinus Torvalds #endif 3551da177e4SLinus Torvalds } 3561da177e4SLinus Torvalds 3575c3a0fd7SJoe Perches void free_fib_info(struct fib_info *fi); 3581da177e4SLinus Torvalds 3591da177e4SLinus Torvalds static inline void fib_info_put(struct fib_info *fi) 3601da177e4SLinus Torvalds { 3611da177e4SLinus Torvalds if (atomic_dec_and_test(&fi->fib_clntref)) 3621da177e4SLinus Torvalds free_fib_info(fi); 3631da177e4SLinus Torvalds } 3641da177e4SLinus Torvalds 36520380731SArnaldo Carvalho de Melo #ifdef CONFIG_PROC_FS 3665c3a0fd7SJoe Perches int __net_init fib_proc_init(struct net *net); 3675c3a0fd7SJoe Perches void __net_exit fib_proc_exit(struct net *net); 368cc8274f5SLi Zefan #else 369cc8274f5SLi Zefan static inline int fib_proc_init(struct net *net) 370cc8274f5SLi Zefan { 371cc8274f5SLi Zefan return 0; 372cc8274f5SLi Zefan } 373cc8274f5SLi Zefan static inline void fib_proc_exit(struct net *net) 374cc8274f5SLi Zefan { 375cc8274f5SLi Zefan } 37620380731SArnaldo Carvalho de Melo #endif 37720380731SArnaldo Carvalho de Melo 3781da177e4SLinus Torvalds #endif /* _NET_FIB_H */ 379