aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_private.h')
-rw-r--r--net/bridge/br_private.h299
1 files changed, 138 insertions, 161 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index e14c33b42f75..d1ca6d956633 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -343,10 +343,9 @@ static inline int br_is_root_bridge(const struct net_bridge *br)
343} 343}
344 344
345/* br_device.c */ 345/* br_device.c */
346extern void br_dev_setup(struct net_device *dev); 346void br_dev_setup(struct net_device *dev);
347extern void br_dev_delete(struct net_device *dev, struct list_head *list); 347void br_dev_delete(struct net_device *dev, struct list_head *list);
348extern netdev_tx_t br_dev_xmit(struct sk_buff *skb, 348netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev);
349 struct net_device *dev);
350#ifdef CONFIG_NET_POLL_CONTROLLER 349#ifdef CONFIG_NET_POLL_CONTROLLER
351static inline void br_netpoll_send_skb(const struct net_bridge_port *p, 350static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
352 struct sk_buff *skb) 351 struct sk_buff *skb)
@@ -357,8 +356,8 @@ static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
357 netpoll_send_skb(np, skb); 356 netpoll_send_skb(np, skb);
358} 357}
359 358
360extern int br_netpoll_enable(struct net_bridge_port *p, gfp_t gfp); 359int br_netpoll_enable(struct net_bridge_port *p, gfp_t gfp);
361extern void br_netpoll_disable(struct net_bridge_port *p); 360void br_netpoll_disable(struct net_bridge_port *p);
362#else 361#else
363static inline void br_netpoll_send_skb(const struct net_bridge_port *p, 362static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
364 struct sk_buff *skb) 363 struct sk_buff *skb)
@@ -376,116 +375,99 @@ static inline void br_netpoll_disable(struct net_bridge_port *p)
376#endif 375#endif
377 376
378/* br_fdb.c */ 377/* br_fdb.c */
379extern int br_fdb_init(void); 378int br_fdb_init(void);
380extern void br_fdb_fini(void); 379void br_fdb_fini(void);
381extern void br_fdb_flush(struct net_bridge *br); 380void br_fdb_flush(struct net_bridge *br);
382extern void br_fdb_changeaddr(struct net_bridge_port *p, 381void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr);
383 const unsigned char *newaddr); 382void br_fdb_change_mac_address(struct net_bridge *br, const u8 *newaddr);
384extern void br_fdb_change_mac_address(struct net_bridge *br, const u8 *newaddr); 383void br_fdb_cleanup(unsigned long arg);
385extern void br_fdb_cleanup(unsigned long arg); 384void br_fdb_delete_by_port(struct net_bridge *br,
386extern void br_fdb_delete_by_port(struct net_bridge *br, 385 const struct net_bridge_port *p, int do_all);
387 const struct net_bridge_port *p, int do_all); 386struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
388extern struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br, 387 const unsigned char *addr, __u16 vid);
389 const unsigned char *addr, 388int br_fdb_test_addr(struct net_device *dev, unsigned char *addr);
390 __u16 vid); 389int br_fdb_fillbuf(struct net_bridge *br, void *buf, unsigned long count,
391extern int br_fdb_test_addr(struct net_device *dev, unsigned char *addr); 390 unsigned long off);
392extern int br_fdb_fillbuf(struct net_bridge *br, void *buf, 391int br_fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
393 unsigned long count, unsigned long off); 392 const unsigned char *addr, u16 vid);
394extern int br_fdb_insert(struct net_bridge *br, 393void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
395 struct net_bridge_port *source, 394 const unsigned char *addr, u16 vid);
396 const unsigned char *addr, 395int fdb_delete_by_addr(struct net_bridge *br, const u8 *addr, u16 vid);
397 u16 vid); 396
398extern void br_fdb_update(struct net_bridge *br, 397int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
399 struct net_bridge_port *source, 398 struct net_device *dev, const unsigned char *addr);
400 const unsigned char *addr, 399int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev,
401 u16 vid); 400 const unsigned char *addr, u16 nlh_flags);
402extern int fdb_delete_by_addr(struct net_bridge *br, const u8 *addr, u16 vid); 401int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
403 402 struct net_device *dev, int idx);
404extern int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
405 struct net_device *dev,
406 const unsigned char *addr);
407extern int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[],
408 struct net_device *dev,
409 const unsigned char *addr,
410 u16 nlh_flags);
411extern int br_fdb_dump(struct sk_buff *skb,
412 struct netlink_callback *cb,
413 struct net_device *dev,
414 int idx);
415 403
416/* br_forward.c */ 404/* br_forward.c */
417extern void br_deliver(const struct net_bridge_port *to, 405void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb);
418 struct sk_buff *skb); 406int br_dev_queue_push_xmit(struct sk_buff *skb);
419extern int br_dev_queue_push_xmit(struct sk_buff *skb); 407void br_forward(const struct net_bridge_port *to,
420extern void br_forward(const struct net_bridge_port *to,
421 struct sk_buff *skb, struct sk_buff *skb0); 408 struct sk_buff *skb, struct sk_buff *skb0);
422extern int br_forward_finish(struct sk_buff *skb); 409int br_forward_finish(struct sk_buff *skb);
423extern void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb, 410void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb, bool unicast);
424 bool unicast); 411void br_flood_forward(struct net_bridge *br, struct sk_buff *skb,
425extern void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, 412 struct sk_buff *skb2, bool unicast);
426 struct sk_buff *skb2, bool unicast);
427 413
428/* br_if.c */ 414/* br_if.c */
429extern void br_port_carrier_check(struct net_bridge_port *p); 415void br_port_carrier_check(struct net_bridge_port *p);
430extern int br_add_bridge(struct net *net, const char *name); 416int br_add_bridge(struct net *net, const char *name);
431extern int br_del_bridge(struct net *net, const char *name); 417int br_del_bridge(struct net *net, const char *name);
432extern void br_net_exit(struct net *net); 418void br_net_exit(struct net *net);
433extern int br_add_if(struct net_bridge *br, 419int br_add_if(struct net_bridge *br, struct net_device *dev);
434 struct net_device *dev); 420int br_del_if(struct net_bridge *br, struct net_device *dev);
435extern int br_del_if(struct net_bridge *br, 421int br_min_mtu(const struct net_bridge *br);
436 struct net_device *dev); 422netdev_features_t br_features_recompute(struct net_bridge *br,
437extern int br_min_mtu(const struct net_bridge *br); 423 netdev_features_t features);
438extern netdev_features_t br_features_recompute(struct net_bridge *br,
439 netdev_features_t features);
440 424
441/* br_input.c */ 425/* br_input.c */
442extern int br_handle_frame_finish(struct sk_buff *skb); 426int br_handle_frame_finish(struct sk_buff *skb);
443extern rx_handler_result_t br_handle_frame(struct sk_buff **pskb); 427rx_handler_result_t br_handle_frame(struct sk_buff **pskb);
444 428
445/* br_ioctl.c */ 429/* br_ioctl.c */
446extern int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 430int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
447extern int br_ioctl_deviceless_stub(struct net *net, unsigned int cmd, void __user *arg); 431int br_ioctl_deviceless_stub(struct net *net, unsigned int cmd,
432 void __user *arg);
448 433
449/* br_multicast.c */ 434/* br_multicast.c */
450#ifdef CONFIG_BRIDGE_IGMP_SNOOPING 435#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
451extern unsigned int br_mdb_rehash_seq; 436extern unsigned int br_mdb_rehash_seq;
452extern int br_multicast_rcv(struct net_bridge *br, 437int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port,
453 struct net_bridge_port *port, 438 struct sk_buff *skb);
454 struct sk_buff *skb); 439struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br,
455extern struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, 440 struct sk_buff *skb, u16 vid);
456 struct sk_buff *skb, u16 vid); 441void br_multicast_add_port(struct net_bridge_port *port);
457extern void br_multicast_add_port(struct net_bridge_port *port); 442void br_multicast_del_port(struct net_bridge_port *port);
458extern void br_multicast_del_port(struct net_bridge_port *port); 443void br_multicast_enable_port(struct net_bridge_port *port);
459extern void br_multicast_enable_port(struct net_bridge_port *port); 444void br_multicast_disable_port(struct net_bridge_port *port);
460extern void br_multicast_disable_port(struct net_bridge_port *port); 445void br_multicast_init(struct net_bridge *br);
461extern void br_multicast_init(struct net_bridge *br); 446void br_multicast_open(struct net_bridge *br);
462extern void br_multicast_open(struct net_bridge *br); 447void br_multicast_stop(struct net_bridge *br);
463extern void br_multicast_stop(struct net_bridge *br); 448void br_multicast_deliver(struct net_bridge_mdb_entry *mdst,
464extern void br_multicast_deliver(struct net_bridge_mdb_entry *mdst, 449 struct sk_buff *skb);
465 struct sk_buff *skb); 450void br_multicast_forward(struct net_bridge_mdb_entry *mdst,
466extern void br_multicast_forward(struct net_bridge_mdb_entry *mdst, 451 struct sk_buff *skb, struct sk_buff *skb2);
467 struct sk_buff *skb, struct sk_buff *skb2); 452int br_multicast_set_router(struct net_bridge *br, unsigned long val);
468extern int br_multicast_set_router(struct net_bridge *br, unsigned long val); 453int br_multicast_set_port_router(struct net_bridge_port *p, unsigned long val);
469extern int br_multicast_set_port_router(struct net_bridge_port *p, 454int br_multicast_toggle(struct net_bridge *br, unsigned long val);
470 unsigned long val); 455int br_multicast_set_querier(struct net_bridge *br, unsigned long val);
471extern int br_multicast_toggle(struct net_bridge *br, unsigned long val); 456int br_multicast_set_hash_max(struct net_bridge *br, unsigned long val);
472extern int br_multicast_set_querier(struct net_bridge *br, unsigned long val); 457struct net_bridge_mdb_entry *
473extern int br_multicast_set_hash_max(struct net_bridge *br, unsigned long val); 458br_mdb_ip_get(struct net_bridge_mdb_htable *mdb, struct br_ip *dst);
474extern struct net_bridge_mdb_entry *br_mdb_ip_get( 459struct net_bridge_mdb_entry *
475 struct net_bridge_mdb_htable *mdb, 460br_multicast_new_group(struct net_bridge *br, struct net_bridge_port *port,
476 struct br_ip *dst); 461 struct br_ip *group);
477extern struct net_bridge_mdb_entry *br_multicast_new_group(struct net_bridge *br, 462void br_multicast_free_pg(struct rcu_head *head);
478 struct net_bridge_port *port, struct br_ip *group); 463struct net_bridge_port_group *
479extern void br_multicast_free_pg(struct rcu_head *head); 464br_multicast_new_port_group(struct net_bridge_port *port, struct br_ip *group,
480extern struct net_bridge_port_group *br_multicast_new_port_group( 465 struct net_bridge_port_group __rcu *next,
481 struct net_bridge_port *port, 466 unsigned char state);
482 struct br_ip *group, 467void br_mdb_init(void);
483 struct net_bridge_port_group __rcu *next, 468void br_mdb_uninit(void);
484 unsigned char state); 469void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
485extern void br_mdb_init(void); 470 struct br_ip *group, int type);
486extern void br_mdb_uninit(void);
487extern void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
488 struct br_ip *group, int type);
489 471
490#define mlock_dereference(X, br) \ 472#define mlock_dereference(X, br) \
491 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) 473 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))
@@ -590,22 +572,21 @@ static inline void br_mdb_uninit(void)
590 572
591/* br_vlan.c */ 573/* br_vlan.c */
592#ifdef CONFIG_BRIDGE_VLAN_FILTERING 574#ifdef CONFIG_BRIDGE_VLAN_FILTERING
593extern bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, 575bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
594 struct sk_buff *skb, u16 *vid); 576 struct sk_buff *skb, u16 *vid);
595extern bool br_allowed_egress(struct net_bridge *br, 577bool br_allowed_egress(struct net_bridge *br, const struct net_port_vlans *v,
596 const struct net_port_vlans *v, 578 const struct sk_buff *skb);
597 const struct sk_buff *skb); 579struct sk_buff *br_handle_vlan(struct net_bridge *br,
598extern struct sk_buff *br_handle_vlan(struct net_bridge *br, 580 const struct net_port_vlans *v,
599 const struct net_port_vlans *v, 581 struct sk_buff *skb);
600 struct sk_buff *skb); 582int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags);
601extern int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags); 583int br_vlan_delete(struct net_bridge *br, u16 vid);
602extern int br_vlan_delete(struct net_bridge *br, u16 vid); 584void br_vlan_flush(struct net_bridge *br);
603extern void br_vlan_flush(struct net_bridge *br); 585int br_vlan_filter_toggle(struct net_bridge *br, unsigned long val);
604extern int br_vlan_filter_toggle(struct net_bridge *br, unsigned long val); 586int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags);
605extern int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags); 587int nbp_vlan_delete(struct net_bridge_port *port, u16 vid);
606extern int nbp_vlan_delete(struct net_bridge_port *port, u16 vid); 588void nbp_vlan_flush(struct net_bridge_port *port);
607extern void nbp_vlan_flush(struct net_bridge_port *port); 589bool nbp_vlan_find(struct net_bridge_port *port, u16 vid);
608extern bool nbp_vlan_find(struct net_bridge_port *port, u16 vid);
609 590
610static inline struct net_port_vlans *br_get_vlan_info( 591static inline struct net_port_vlans *br_get_vlan_info(
611 const struct net_bridge *br) 592 const struct net_bridge *br)
@@ -724,9 +705,9 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v)
724 705
725/* br_netfilter.c */ 706/* br_netfilter.c */
726#ifdef CONFIG_BRIDGE_NETFILTER 707#ifdef CONFIG_BRIDGE_NETFILTER
727extern int br_netfilter_init(void); 708int br_netfilter_init(void);
728extern void br_netfilter_fini(void); 709void br_netfilter_fini(void);
729extern void br_netfilter_rtable_init(struct net_bridge *); 710void br_netfilter_rtable_init(struct net_bridge *);
730#else 711#else
731#define br_netfilter_init() (0) 712#define br_netfilter_init() (0)
732#define br_netfilter_fini() do { } while(0) 713#define br_netfilter_fini() do { } while(0)
@@ -734,43 +715,39 @@ extern void br_netfilter_rtable_init(struct net_bridge *);
734#endif 715#endif
735 716
736/* br_stp.c */ 717/* br_stp.c */
737extern void br_log_state(const struct net_bridge_port *p); 718void br_log_state(const struct net_bridge_port *p);
738extern struct net_bridge_port *br_get_port(struct net_bridge *br, 719struct net_bridge_port *br_get_port(struct net_bridge *br, u16 port_no);
739 u16 port_no); 720void br_init_port(struct net_bridge_port *p);
740extern void br_init_port(struct net_bridge_port *p); 721void br_become_designated_port(struct net_bridge_port *p);
741extern void br_become_designated_port(struct net_bridge_port *p);
742 722
743extern void __br_set_forward_delay(struct net_bridge *br, unsigned long t); 723void __br_set_forward_delay(struct net_bridge *br, unsigned long t);
744extern int br_set_forward_delay(struct net_bridge *br, unsigned long x); 724int br_set_forward_delay(struct net_bridge *br, unsigned long x);
745extern int br_set_hello_time(struct net_bridge *br, unsigned long x); 725int br_set_hello_time(struct net_bridge *br, unsigned long x);
746extern int br_set_max_age(struct net_bridge *br, unsigned long x); 726int br_set_max_age(struct net_bridge *br, unsigned long x);
747 727
748 728
749/* br_stp_if.c */ 729/* br_stp_if.c */
750extern void br_stp_enable_bridge(struct net_bridge *br); 730void br_stp_enable_bridge(struct net_bridge *br);
751extern void br_stp_disable_bridge(struct net_bridge *br); 731void br_stp_disable_bridge(struct net_bridge *br);
752extern void br_stp_set_enabled(struct net_bridge *br, unsigned long val); 732void br_stp_set_enabled(struct net_bridge *br, unsigned long val);
753extern void br_stp_enable_port(struct net_bridge_port *p); 733void br_stp_enable_port(struct net_bridge_port *p);
754extern void br_stp_disable_port(struct net_bridge_port *p); 734void br_stp_disable_port(struct net_bridge_port *p);
755extern bool br_stp_recalculate_bridge_id(struct net_bridge *br); 735bool br_stp_recalculate_bridge_id(struct net_bridge *br);
756extern void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *a); 736void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *a);
757extern void br_stp_set_bridge_priority(struct net_bridge *br, 737void br_stp_set_bridge_priority(struct net_bridge *br, u16 newprio);
758 u16 newprio); 738int br_stp_set_port_priority(struct net_bridge_port *p, unsigned long newprio);
759extern int br_stp_set_port_priority(struct net_bridge_port *p, 739int br_stp_set_path_cost(struct net_bridge_port *p, unsigned long path_cost);
760 unsigned long newprio); 740ssize_t br_show_bridge_id(char *buf, const struct bridge_id *id);
761extern int br_stp_set_path_cost(struct net_bridge_port *p,
762 unsigned long path_cost);
763extern ssize_t br_show_bridge_id(char *buf, const struct bridge_id *id);
764 741
765/* br_stp_bpdu.c */ 742/* br_stp_bpdu.c */
766struct stp_proto; 743struct stp_proto;
767extern void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb, 744void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
768 struct net_device *dev); 745 struct net_device *dev);
769 746
770/* br_stp_timer.c */ 747/* br_stp_timer.c */
771extern void br_stp_timer_init(struct net_bridge *br); 748void br_stp_timer_init(struct net_bridge *br);
772extern void br_stp_port_timer_init(struct net_bridge_port *p); 749void br_stp_port_timer_init(struct net_bridge_port *p);
773extern unsigned long br_timer_value(const struct timer_list *timer); 750unsigned long br_timer_value(const struct timer_list *timer);
774 751
775/* br.c */ 752/* br.c */
776#if IS_ENABLED(CONFIG_ATM_LANE) 753#if IS_ENABLED(CONFIG_ATM_LANE)
@@ -779,23 +756,23 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr)
779 756
780/* br_netlink.c */ 757/* br_netlink.c */
781extern struct rtnl_link_ops br_link_ops; 758extern struct rtnl_link_ops br_link_ops;
782extern int br_netlink_init(void); 759int br_netlink_init(void);
783extern void br_netlink_fini(void); 760void br_netlink_fini(void);
784extern void br_ifinfo_notify(int event, struct net_bridge_port *port); 761void br_ifinfo_notify(int event, struct net_bridge_port *port);
785extern int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg); 762int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg);
786extern int br_dellink(struct net_device *dev, struct nlmsghdr *nlmsg); 763int br_dellink(struct net_device *dev, struct nlmsghdr *nlmsg);
787extern int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, 764int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev,
788 struct net_device *dev, u32 filter_mask); 765 u32 filter_mask);
789 766
790#ifdef CONFIG_SYSFS 767#ifdef CONFIG_SYSFS
791/* br_sysfs_if.c */ 768/* br_sysfs_if.c */
792extern const struct sysfs_ops brport_sysfs_ops; 769extern const struct sysfs_ops brport_sysfs_ops;
793extern int br_sysfs_addif(struct net_bridge_port *p); 770int br_sysfs_addif(struct net_bridge_port *p);
794extern int br_sysfs_renameif(struct net_bridge_port *p); 771int br_sysfs_renameif(struct net_bridge_port *p);
795 772
796/* br_sysfs_br.c */ 773/* br_sysfs_br.c */
797extern int br_sysfs_addbr(struct net_device *dev); 774int br_sysfs_addbr(struct net_device *dev);
798extern void br_sysfs_delbr(struct net_device *dev); 775void br_sysfs_delbr(struct net_device *dev);
799 776
800#else 777#else
801 778