0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef PN_DEV_H
0011 #define PN_DEV_H
0012
0013 #include <linux/list.h>
0014 #include <linux/mutex.h>
0015
0016 struct net;
0017
0018 struct phonet_device_list {
0019 struct list_head list;
0020 struct mutex lock;
0021 };
0022
0023 struct phonet_device_list *phonet_device_list(struct net *net);
0024
0025 struct phonet_device {
0026 struct list_head list;
0027 struct net_device *netdev;
0028 DECLARE_BITMAP(addrs, 64);
0029 struct rcu_head rcu;
0030 };
0031
0032 int phonet_device_init(void);
0033 void phonet_device_exit(void);
0034 int phonet_netlink_register(void);
0035 struct net_device *phonet_device_get(struct net *net);
0036
0037 int phonet_address_add(struct net_device *dev, u8 addr);
0038 int phonet_address_del(struct net_device *dev, u8 addr);
0039 u8 phonet_address_get(struct net_device *dev, u8 addr);
0040 int phonet_address_lookup(struct net *net, u8 addr);
0041 void phonet_address_notify(int event, struct net_device *dev, u8 addr);
0042
0043 int phonet_route_add(struct net_device *dev, u8 daddr);
0044 int phonet_route_del(struct net_device *dev, u8 daddr);
0045 void rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
0046 struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
0047 struct net_device *phonet_route_output(struct net *net, u8 daddr);
0048
0049 #define PN_NO_ADDR 0xff
0050
0051 extern const struct seq_operations pn_sock_seq_ops;
0052 extern const struct seq_operations pn_res_seq_ops;
0053
0054 #endif