diff options
| author | Mark Brown <broonie@linaro.org> | 2013-11-24 09:35:18 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2013-11-24 09:35:18 -0500 |
| commit | 30c27abd28fa168d7ebd2e5286f1fe473c74bfa9 (patch) | |
| tree | 9936b38c0c81cd430d5e75906c1207d127fe588c /include/net | |
| parent | 16ec790938d4f356c82fab27b9a9adf4d6fe19a6 (diff) | |
| parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff) | |
Merge tag 'v3.13-rc1' into asoc-arizona
Linux 3.13-rc1
Diffstat (limited to 'include/net')
133 files changed, 3840 insertions, 3322 deletions
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h deleted file mode 100644 index 487b54c1308f..000000000000 --- a/include/net/bluetooth/a2mp.h +++ /dev/null | |||
| @@ -1,150 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved. | ||
| 3 | Copyright (c) 2011,2012 Intel Corp. | ||
| 4 | |||
| 5 | This program is free software; you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License version 2 and | ||
| 7 | only version 2 as published by the Free Software Foundation. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __A2MP_H | ||
| 16 | #define __A2MP_H | ||
| 17 | |||
| 18 | #include <net/bluetooth/l2cap.h> | ||
| 19 | |||
| 20 | #define A2MP_FEAT_EXT 0x8000 | ||
| 21 | |||
| 22 | enum amp_mgr_state { | ||
| 23 | READ_LOC_AMP_INFO, | ||
| 24 | READ_LOC_AMP_ASSOC, | ||
| 25 | READ_LOC_AMP_ASSOC_FINAL, | ||
| 26 | WRITE_REMOTE_AMP_ASSOC, | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct amp_mgr { | ||
| 30 | struct list_head list; | ||
| 31 | struct l2cap_conn *l2cap_conn; | ||
| 32 | struct l2cap_chan *a2mp_chan; | ||
| 33 | struct l2cap_chan *bredr_chan; | ||
| 34 | struct kref kref; | ||
| 35 | __u8 ident; | ||
| 36 | __u8 handle; | ||
| 37 | unsigned long state; | ||
| 38 | unsigned long flags; | ||
| 39 | |||
| 40 | struct list_head amp_ctrls; | ||
| 41 | struct mutex amp_ctrls_lock; | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct a2mp_cmd { | ||
| 45 | __u8 code; | ||
| 46 | __u8 ident; | ||
| 47 | __le16 len; | ||
| 48 | __u8 data[0]; | ||
| 49 | } __packed; | ||
| 50 | |||
| 51 | /* A2MP command codes */ | ||
| 52 | #define A2MP_COMMAND_REJ 0x01 | ||
| 53 | struct a2mp_cmd_rej { | ||
| 54 | __le16 reason; | ||
| 55 | __u8 data[0]; | ||
| 56 | } __packed; | ||
| 57 | |||
| 58 | #define A2MP_DISCOVER_REQ 0x02 | ||
| 59 | struct a2mp_discov_req { | ||
| 60 | __le16 mtu; | ||
| 61 | __le16 ext_feat; | ||
| 62 | } __packed; | ||
| 63 | |||
| 64 | struct a2mp_cl { | ||
| 65 | __u8 id; | ||
| 66 | __u8 type; | ||
| 67 | __u8 status; | ||
| 68 | } __packed; | ||
| 69 | |||
| 70 | #define A2MP_DISCOVER_RSP 0x03 | ||
| 71 | struct a2mp_discov_rsp { | ||
| 72 | __le16 mtu; | ||
| 73 | __le16 ext_feat; | ||
| 74 | struct a2mp_cl cl[0]; | ||
| 75 | } __packed; | ||
| 76 | |||
| 77 | #define A2MP_CHANGE_NOTIFY 0x04 | ||
| 78 | #define A2MP_CHANGE_RSP 0x05 | ||
| 79 | |||
| 80 | #define A2MP_GETINFO_REQ 0x06 | ||
| 81 | struct a2mp_info_req { | ||
| 82 | __u8 id; | ||
| 83 | } __packed; | ||
| 84 | |||
| 85 | #define A2MP_GETINFO_RSP 0x07 | ||
| 86 | struct a2mp_info_rsp { | ||
| 87 | __u8 id; | ||
| 88 | __u8 status; | ||
| 89 | __le32 total_bw; | ||
| 90 | __le32 max_bw; | ||
| 91 | __le32 min_latency; | ||
| 92 | __le16 pal_cap; | ||
| 93 | __le16 assoc_size; | ||
| 94 | } __packed; | ||
| 95 | |||
| 96 | #define A2MP_GETAMPASSOC_REQ 0x08 | ||
| 97 | struct a2mp_amp_assoc_req { | ||
| 98 | __u8 id; | ||
| 99 | } __packed; | ||
| 100 | |||
| 101 | #define A2MP_GETAMPASSOC_RSP 0x09 | ||
| 102 | struct a2mp_amp_assoc_rsp { | ||
| 103 | __u8 id; | ||
| 104 | __u8 status; | ||
| 105 | __u8 amp_assoc[0]; | ||
| 106 | } __packed; | ||
| 107 | |||
| 108 | #define A2MP_CREATEPHYSLINK_REQ 0x0A | ||
| 109 | #define A2MP_DISCONNPHYSLINK_REQ 0x0C | ||
| 110 | struct a2mp_physlink_req { | ||
| 111 | __u8 local_id; | ||
| 112 | __u8 remote_id; | ||
| 113 | __u8 amp_assoc[0]; | ||
| 114 | } __packed; | ||
| 115 | |||
| 116 | #define A2MP_CREATEPHYSLINK_RSP 0x0B | ||
| 117 | #define A2MP_DISCONNPHYSLINK_RSP 0x0D | ||
| 118 | struct a2mp_physlink_rsp { | ||
| 119 | __u8 local_id; | ||
| 120 | __u8 remote_id; | ||
| 121 | __u8 status; | ||
| 122 | } __packed; | ||
| 123 | |||
| 124 | /* A2MP response status */ | ||
| 125 | #define A2MP_STATUS_SUCCESS 0x00 | ||
| 126 | #define A2MP_STATUS_INVALID_CTRL_ID 0x01 | ||
| 127 | #define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02 | ||
| 128 | #define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02 | ||
| 129 | #define A2MP_STATUS_COLLISION_OCCURED 0x03 | ||
| 130 | #define A2MP_STATUS_DISCONN_REQ_RECVD 0x04 | ||
| 131 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | ||
| 132 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | ||
| 133 | |||
| 134 | extern struct list_head amp_mgr_list; | ||
| 135 | extern struct mutex amp_mgr_list_lock; | ||
| 136 | |||
| 137 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); | ||
| 138 | int amp_mgr_put(struct amp_mgr *mgr); | ||
| 139 | u8 __next_ident(struct amp_mgr *mgr); | ||
| 140 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | ||
| 141 | struct sk_buff *skb); | ||
| 142 | struct amp_mgr *amp_mgr_lookup_by_state(u8 state); | ||
| 143 | void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data); | ||
| 144 | void a2mp_discover_amp(struct l2cap_chan *chan); | ||
| 145 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); | ||
| 146 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); | ||
| 147 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); | ||
| 148 | void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status); | ||
| 149 | |||
| 150 | #endif /* __A2MP_H */ | ||
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h deleted file mode 100644 index 7ea3db77ba89..000000000000 --- a/include/net/bluetooth/amp.h +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright (c) 2011,2012 Intel Corp. | ||
| 3 | |||
| 4 | This program is free software; you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License version 2 and | ||
| 6 | only version 2 as published by the Free Software Foundation. | ||
| 7 | |||
| 8 | This program is distributed in the hope that it will be useful, | ||
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __AMP_H | ||
| 15 | #define __AMP_H | ||
| 16 | |||
| 17 | struct amp_ctrl { | ||
| 18 | struct list_head list; | ||
| 19 | struct kref kref; | ||
| 20 | __u8 id; | ||
| 21 | __u16 assoc_len_so_far; | ||
| 22 | __u16 assoc_rem_len; | ||
| 23 | __u16 assoc_len; | ||
| 24 | __u8 *assoc; | ||
| 25 | }; | ||
| 26 | |||
| 27 | int amp_ctrl_put(struct amp_ctrl *ctrl); | ||
| 28 | void amp_ctrl_get(struct amp_ctrl *ctrl); | ||
| 29 | struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id); | ||
| 30 | struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id); | ||
| 31 | void amp_ctrl_list_flush(struct amp_mgr *mgr); | ||
| 32 | |||
| 33 | struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
| 34 | u8 remote_id, bool out); | ||
| 35 | |||
| 36 | int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type); | ||
| 37 | |||
| 38 | void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
| 39 | void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); | ||
| 40 | void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
| 41 | void amp_read_loc_assoc_final_data(struct hci_dev *hdev, | ||
| 42 | struct hci_conn *hcon); | ||
| 43 | void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
| 44 | struct hci_conn *hcon); | ||
| 45 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
| 46 | struct hci_conn *hcon); | ||
| 47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | ||
| 48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | ||
| 49 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); | ||
| 50 | void amp_create_logical_link(struct l2cap_chan *chan); | ||
| 51 | void amp_disconnect_logical_link(struct hci_chan *hchan); | ||
| 52 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); | ||
| 53 | |||
| 54 | #endif /* __AMP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 10d43d8c7037..2a628b28249f 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -197,8 +197,8 @@ static inline bool bdaddr_type_is_le(__u8 type) | |||
| 197 | return false; | 197 | return false; |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) | 200 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) |
| 201 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) | 201 | #define BDADDR_NONE (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}) |
| 202 | 202 | ||
| 203 | /* Copy, swap, convert BD Address */ | 203 | /* Copy, swap, convert BD Address */ |
| 204 | static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2) | 204 | static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2) |
| @@ -218,11 +218,10 @@ void baswap(bdaddr_t *dst, bdaddr_t *src); | |||
| 218 | 218 | ||
| 219 | struct bt_sock { | 219 | struct bt_sock { |
| 220 | struct sock sk; | 220 | struct sock sk; |
| 221 | bdaddr_t src; | ||
| 222 | bdaddr_t dst; | ||
| 223 | struct list_head accept_q; | 221 | struct list_head accept_q; |
| 224 | struct sock *parent; | 222 | struct sock *parent; |
| 225 | unsigned long flags; | 223 | unsigned long flags; |
| 224 | void (*skb_msg_name)(struct sk_buff *, void *, int *); | ||
| 226 | }; | 225 | }; |
| 227 | 226 | ||
| 228 | enum { | 227 | enum { |
| @@ -249,6 +248,7 @@ int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 249 | uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); | 248 | uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); |
| 250 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 249 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 251 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 250 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
| 251 | int bt_sock_wait_ready(struct sock *sk, unsigned long flags); | ||
| 252 | 252 | ||
| 253 | void bt_accept_enqueue(struct sock *parent, struct sock *sk); | 253 | void bt_accept_enqueue(struct sock *parent, struct sock *sk); |
| 254 | void bt_accept_unlink(struct sock *sk); | 254 | void bt_accept_unlink(struct sock *sk); |
| @@ -282,8 +282,11 @@ struct bt_skb_cb { | |||
| 282 | __u8 incoming; | 282 | __u8 incoming; |
| 283 | __u16 expect; | 283 | __u16 expect; |
| 284 | __u8 force_active; | 284 | __u8 force_active; |
| 285 | struct l2cap_chan *chan; | ||
| 285 | struct l2cap_ctrl control; | 286 | struct l2cap_ctrl control; |
| 286 | struct hci_req_ctrl req; | 287 | struct hci_req_ctrl req; |
| 288 | bdaddr_t bdaddr; | ||
| 289 | __le16 psm; | ||
| 287 | }; | 290 | }; |
| 288 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) | 291 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) |
| 289 | 292 | ||
| @@ -331,16 +334,16 @@ out: | |||
| 331 | 334 | ||
| 332 | int bt_to_errno(__u16 code); | 335 | int bt_to_errno(__u16 code); |
| 333 | 336 | ||
| 334 | extern int hci_sock_init(void); | 337 | int hci_sock_init(void); |
| 335 | extern void hci_sock_cleanup(void); | 338 | void hci_sock_cleanup(void); |
| 336 | 339 | ||
| 337 | extern int bt_sysfs_init(void); | 340 | int bt_sysfs_init(void); |
| 338 | extern void bt_sysfs_cleanup(void); | 341 | void bt_sysfs_cleanup(void); |
| 339 | 342 | ||
| 340 | extern int bt_procfs_init(struct net *net, const char *name, | 343 | int bt_procfs_init(struct net *net, const char *name, |
| 341 | struct bt_sock_list* sk_list, | 344 | struct bt_sock_list *sk_list, |
| 342 | int (* seq_show)(struct seq_file *, void *)); | 345 | int (*seq_show)(struct seq_file *, void *)); |
| 343 | extern void bt_procfs_cleanup(struct net *net, const char *name); | 346 | void bt_procfs_cleanup(struct net *net, const char *name); |
| 344 | 347 | ||
| 345 | extern struct dentry *bt_debugfs; | 348 | extern struct dentry *bt_debugfs; |
| 346 | 349 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 15f10841e2b5..1784c48699f0 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | 35 | ||
| 36 | #define HCI_MAX_AMP_ASSOC_SIZE 672 | 36 | #define HCI_MAX_AMP_ASSOC_SIZE 672 |
| 37 | 37 | ||
| 38 | #define HCI_MAX_CSB_DATA_SIZE 252 | ||
| 39 | |||
| 38 | /* HCI dev events */ | 40 | /* HCI dev events */ |
| 39 | #define HCI_DEV_REG 1 | 41 | #define HCI_DEV_REG 1 |
| 40 | #define HCI_DEV_UNREG 2 | 42 | #define HCI_DEV_UNREG 2 |
| @@ -62,16 +64,20 @@ | |||
| 62 | #define HCI_AMP 0x01 | 64 | #define HCI_AMP 0x01 |
| 63 | 65 | ||
| 64 | /* First BR/EDR Controller shall have ID = 0 */ | 66 | /* First BR/EDR Controller shall have ID = 0 */ |
| 65 | #define HCI_BREDR_ID 0 | 67 | #define AMP_ID_BREDR 0x00 |
| 68 | |||
| 69 | /* AMP controller types */ | ||
| 70 | #define AMP_TYPE_BREDR 0x00 | ||
| 71 | #define AMP_TYPE_80211 0x01 | ||
| 66 | 72 | ||
| 67 | /* AMP controller status */ | 73 | /* AMP controller status */ |
| 68 | #define AMP_CTRL_POWERED_DOWN 0x00 | 74 | #define AMP_STATUS_POWERED_DOWN 0x00 |
| 69 | #define AMP_CTRL_BLUETOOTH_ONLY 0x01 | 75 | #define AMP_STATUS_BLUETOOTH_ONLY 0x01 |
| 70 | #define AMP_CTRL_NO_CAPACITY 0x02 | 76 | #define AMP_STATUS_NO_CAPACITY 0x02 |
| 71 | #define AMP_CTRL_LOW_CAPACITY 0x03 | 77 | #define AMP_STATUS_LOW_CAPACITY 0x03 |
| 72 | #define AMP_CTRL_MEDIUM_CAPACITY 0x04 | 78 | #define AMP_STATUS_MEDIUM_CAPACITY 0x04 |
| 73 | #define AMP_CTRL_HIGH_CAPACITY 0x05 | 79 | #define AMP_STATUS_HIGH_CAPACITY 0x05 |
| 74 | #define AMP_CTRL_FULL_CAPACITY 0x06 | 80 | #define AMP_STATUS_FULL_CAPACITY 0x06 |
| 75 | 81 | ||
| 76 | /* HCI device quirks */ | 82 | /* HCI device quirks */ |
| 77 | enum { | 83 | enum { |
| @@ -109,18 +115,22 @@ enum { | |||
| 109 | HCI_PAIRABLE, | 115 | HCI_PAIRABLE, |
| 110 | HCI_SERVICE_CACHE, | 116 | HCI_SERVICE_CACHE, |
| 111 | HCI_DEBUG_KEYS, | 117 | HCI_DEBUG_KEYS, |
| 118 | HCI_DUT_MODE, | ||
| 112 | HCI_UNREGISTER, | 119 | HCI_UNREGISTER, |
| 120 | HCI_USER_CHANNEL, | ||
| 113 | 121 | ||
| 114 | HCI_LE_SCAN, | 122 | HCI_LE_SCAN, |
| 115 | HCI_SSP_ENABLED, | 123 | HCI_SSP_ENABLED, |
| 116 | HCI_HS_ENABLED, | 124 | HCI_HS_ENABLED, |
| 117 | HCI_LE_ENABLED, | 125 | HCI_LE_ENABLED, |
| 118 | HCI_LE_PERIPHERAL, | 126 | HCI_ADVERTISING, |
| 119 | HCI_CONNECTABLE, | 127 | HCI_CONNECTABLE, |
| 120 | HCI_DISCOVERABLE, | 128 | HCI_DISCOVERABLE, |
| 129 | HCI_LIMITED_DISCOVERABLE, | ||
| 121 | HCI_LINK_SECURITY, | 130 | HCI_LINK_SECURITY, |
| 122 | HCI_PERIODIC_INQ, | 131 | HCI_PERIODIC_INQ, |
| 123 | HCI_FAST_CONNECTABLE, | 132 | HCI_FAST_CONNECTABLE, |
| 133 | HCI_BREDR_ENABLED, | ||
| 124 | }; | 134 | }; |
| 125 | 135 | ||
| 126 | /* A mask for the flags that are supposed to remain when a reset happens | 136 | /* A mask for the flags that are supposed to remain when a reset happens |
| @@ -624,6 +634,24 @@ struct hci_rp_logical_link_cancel { | |||
| 624 | __u8 flow_spec_id; | 634 | __u8 flow_spec_id; |
| 625 | } __packed; | 635 | } __packed; |
| 626 | 636 | ||
| 637 | #define HCI_OP_SET_CSB 0x0441 | ||
| 638 | struct hci_cp_set_csb { | ||
| 639 | __u8 enable; | ||
| 640 | __u8 lt_addr; | ||
| 641 | __u8 lpo_allowed; | ||
| 642 | __le16 packet_type; | ||
| 643 | __le16 interval_min; | ||
| 644 | __le16 interval_max; | ||
| 645 | __le16 csb_sv_tout; | ||
| 646 | } __packed; | ||
| 647 | struct hci_rp_set_csb { | ||
| 648 | __u8 status; | ||
| 649 | __u8 lt_addr; | ||
| 650 | __le16 interval; | ||
| 651 | } __packed; | ||
| 652 | |||
| 653 | #define HCI_OP_START_SYNC_TRAIN 0x0443 | ||
| 654 | |||
| 627 | #define HCI_OP_SNIFF_MODE 0x0803 | 655 | #define HCI_OP_SNIFF_MODE 0x0803 |
| 628 | struct hci_cp_sniff_mode { | 656 | struct hci_cp_sniff_mode { |
| 629 | __le16 handle; | 657 | __le16 handle; |
| @@ -694,9 +722,6 @@ struct hci_cp_sniff_subrate { | |||
| 694 | } __packed; | 722 | } __packed; |
| 695 | 723 | ||
| 696 | #define HCI_OP_SET_EVENT_MASK 0x0c01 | 724 | #define HCI_OP_SET_EVENT_MASK 0x0c01 |
| 697 | struct hci_cp_set_event_mask { | ||
| 698 | __u8 mask[8]; | ||
| 699 | } __packed; | ||
| 700 | 725 | ||
| 701 | #define HCI_OP_RESET 0x0c03 | 726 | #define HCI_OP_RESET 0x0c03 |
| 702 | 727 | ||
| @@ -792,6 +817,20 @@ struct hci_cp_host_buffer_size { | |||
| 792 | __le16 sco_max_pkt; | 817 | __le16 sco_max_pkt; |
| 793 | } __packed; | 818 | } __packed; |
| 794 | 819 | ||
| 820 | #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 | ||
| 821 | struct hci_rp_read_num_supported_iac { | ||
| 822 | __u8 status; | ||
| 823 | __u8 num_iac; | ||
| 824 | } __packed; | ||
| 825 | |||
| 826 | #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 | ||
| 827 | |||
| 828 | #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a | ||
| 829 | struct hci_cp_write_current_iac_lap { | ||
| 830 | __u8 num_iac; | ||
| 831 | __u8 iac_lap[6]; | ||
| 832 | } __packed; | ||
| 833 | |||
| 795 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 | 834 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 |
| 796 | 835 | ||
| 797 | #define HCI_MAX_EIR_LENGTH 240 | 836 | #define HCI_MAX_EIR_LENGTH 240 |
| @@ -826,6 +865,10 @@ struct hci_rp_read_inq_rsp_tx_power { | |||
| 826 | __s8 tx_power; | 865 | __s8 tx_power; |
| 827 | } __packed; | 866 | } __packed; |
| 828 | 867 | ||
| 868 | #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 | ||
| 869 | |||
| 870 | #define HCI_OP_READ_LOCATION_DATA 0x0c64 | ||
| 871 | |||
| 829 | #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 | 872 | #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 |
| 830 | struct hci_rp_read_flow_control_mode { | 873 | struct hci_rp_read_flow_control_mode { |
| 831 | __u8 status; | 874 | __u8 status; |
| @@ -838,6 +881,50 @@ struct hci_cp_write_le_host_supported { | |||
| 838 | __u8 simul; | 881 | __u8 simul; |
| 839 | } __packed; | 882 | } __packed; |
| 840 | 883 | ||
| 884 | #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 | ||
| 885 | struct hci_cp_set_reserved_lt_addr { | ||
| 886 | __u8 lt_addr; | ||
| 887 | } __packed; | ||
| 888 | struct hci_rp_set_reserved_lt_addr { | ||
| 889 | __u8 status; | ||
| 890 | __u8 lt_addr; | ||
| 891 | } __packed; | ||
| 892 | |||
| 893 | #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 | ||
| 894 | struct hci_cp_delete_reserved_lt_addr { | ||
| 895 | __u8 lt_addr; | ||
| 896 | } __packed; | ||
| 897 | struct hci_rp_delete_reserved_lt_addr { | ||
| 898 | __u8 status; | ||
| 899 | __u8 lt_addr; | ||
| 900 | } __packed; | ||
| 901 | |||
| 902 | #define HCI_OP_SET_CSB_DATA 0x0c76 | ||
| 903 | struct hci_cp_set_csb_data { | ||
| 904 | __u8 lt_addr; | ||
| 905 | __u8 fragment; | ||
| 906 | __u8 data_length; | ||
| 907 | __u8 data[HCI_MAX_CSB_DATA_SIZE]; | ||
| 908 | } __packed; | ||
| 909 | struct hci_rp_set_csb_data { | ||
| 910 | __u8 status; | ||
| 911 | __u8 lt_addr; | ||
| 912 | } __packed; | ||
| 913 | |||
| 914 | #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 | ||
| 915 | |||
| 916 | #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 | ||
| 917 | struct hci_cp_write_sync_train_params { | ||
| 918 | __le16 interval_min; | ||
| 919 | __le16 interval_max; | ||
| 920 | __le32 sync_train_tout; | ||
| 921 | __u8 service_data; | ||
| 922 | } __packed; | ||
| 923 | struct hci_rp_write_sync_train_params { | ||
| 924 | __u8 status; | ||
| 925 | __le16 sync_train_int; | ||
| 926 | } __packed; | ||
| 927 | |||
| 841 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 928 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
| 842 | struct hci_rp_read_local_version { | 929 | struct hci_rp_read_local_version { |
| 843 | __u8 status; | 930 | __u8 status; |
| @@ -957,6 +1044,10 @@ struct hci_rp_write_remote_amp_assoc { | |||
| 957 | __u8 phy_handle; | 1044 | __u8 phy_handle; |
| 958 | } __packed; | 1045 | } __packed; |
| 959 | 1046 | ||
| 1047 | #define HCI_OP_ENABLE_DUT_MODE 0x1803 | ||
| 1048 | |||
| 1049 | #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 | ||
| 1050 | |||
| 960 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | 1051 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 |
| 961 | struct hci_cp_le_set_event_mask { | 1052 | struct hci_cp_le_set_event_mask { |
| 962 | __u8 mask[8]; | 1053 | __u8 mask[8]; |
| @@ -975,6 +1066,20 @@ struct hci_rp_le_read_local_features { | |||
| 975 | __u8 features[8]; | 1066 | __u8 features[8]; |
| 976 | } __packed; | 1067 | } __packed; |
| 977 | 1068 | ||
| 1069 | #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 | ||
| 1070 | |||
| 1071 | #define HCI_OP_LE_SET_ADV_PARAM 0x2006 | ||
| 1072 | struct hci_cp_le_set_adv_param { | ||
| 1073 | __le16 min_interval; | ||
| 1074 | __le16 max_interval; | ||
| 1075 | __u8 type; | ||
| 1076 | __u8 own_address_type; | ||
| 1077 | __u8 direct_addr_type; | ||
| 1078 | bdaddr_t direct_addr; | ||
| 1079 | __u8 channel_map; | ||
| 1080 | __u8 filter_policy; | ||
| 1081 | } __packed; | ||
| 1082 | |||
| 978 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 | 1083 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 |
| 979 | struct hci_rp_le_read_adv_tx_power { | 1084 | struct hci_rp_le_read_adv_tx_power { |
| 980 | __u8 status; | 1085 | __u8 status; |
| @@ -989,6 +1094,12 @@ struct hci_cp_le_set_adv_data { | |||
| 989 | __u8 data[HCI_MAX_AD_LENGTH]; | 1094 | __u8 data[HCI_MAX_AD_LENGTH]; |
| 990 | } __packed; | 1095 | } __packed; |
| 991 | 1096 | ||
| 1097 | #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 | ||
| 1098 | struct hci_cp_le_set_scan_rsp_data { | ||
| 1099 | __u8 length; | ||
| 1100 | __u8 data[HCI_MAX_AD_LENGTH]; | ||
| 1101 | } __packed; | ||
| 1102 | |||
| 992 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a | 1103 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a |
| 993 | 1104 | ||
| 994 | #define LE_SCAN_PASSIVE 0x00 | 1105 | #define LE_SCAN_PASSIVE 0x00 |
| @@ -1438,6 +1549,13 @@ struct hci_ev_num_comp_blocks { | |||
| 1438 | struct hci_comp_blocks_info handles[0]; | 1549 | struct hci_comp_blocks_info handles[0]; |
| 1439 | } __packed; | 1550 | } __packed; |
| 1440 | 1551 | ||
| 1552 | #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F | ||
| 1553 | struct hci_ev_sync_train_complete { | ||
| 1554 | __u8 status; | ||
| 1555 | } __packed; | ||
| 1556 | |||
| 1557 | #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 | ||
| 1558 | |||
| 1441 | /* Low energy meta events */ | 1559 | /* Low energy meta events */ |
| 1442 | #define LE_CONN_ROLE_MASTER 0x00 | 1560 | #define LE_CONN_ROLE_MASTER 0x00 |
| 1443 | 1561 | ||
| @@ -1462,11 +1580,11 @@ struct hci_ev_le_ltk_req { | |||
| 1462 | } __packed; | 1580 | } __packed; |
| 1463 | 1581 | ||
| 1464 | /* Advertising report event types */ | 1582 | /* Advertising report event types */ |
| 1465 | #define ADV_IND 0x00 | 1583 | #define LE_ADV_IND 0x00 |
| 1466 | #define ADV_DIRECT_IND 0x01 | 1584 | #define LE_ADV_DIRECT_IND 0x01 |
| 1467 | #define ADV_SCAN_IND 0x02 | 1585 | #define LE_ADV_SCAN_IND 0x02 |
| 1468 | #define ADV_NONCONN_IND 0x03 | 1586 | #define LE_ADV_NONCONN_IND 0x03 |
| 1469 | #define ADV_SCAN_RSP 0x04 | 1587 | #define LE_ADV_SCAN_RSP 0x04 |
| 1470 | 1588 | ||
| 1471 | #define ADDR_LE_DEV_PUBLIC 0x00 | 1589 | #define ADDR_LE_DEV_PUBLIC 0x00 |
| 1472 | #define ADDR_LE_DEV_RANDOM 0x01 | 1590 | #define ADDR_LE_DEV_RANDOM 0x01 |
| @@ -1571,6 +1689,7 @@ struct sockaddr_hci { | |||
| 1571 | #define HCI_DEV_NONE 0xffff | 1689 | #define HCI_DEV_NONE 0xffff |
| 1572 | 1690 | ||
| 1573 | #define HCI_CHANNEL_RAW 0 | 1691 | #define HCI_CHANNEL_RAW 0 |
| 1692 | #define HCI_CHANNEL_USER 1 | ||
| 1574 | #define HCI_CHANNEL_MONITOR 2 | 1693 | #define HCI_CHANNEL_MONITOR 2 |
| 1575 | #define HCI_CHANNEL_CONTROL 3 | 1694 | #define HCI_CHANNEL_CONTROL 3 |
| 1576 | 1695 | ||
| @@ -1673,6 +1792,4 @@ struct hci_inquiry_req { | |||
| 1673 | }; | 1792 | }; |
| 1674 | #define IREQ_CACHE_FLUSH 0x0001 | 1793 | #define IREQ_CACHE_FLUSH 0x0001 |
| 1675 | 1794 | ||
| 1676 | extern bool enable_hs; | ||
| 1677 | |||
| 1678 | #endif /* __HCI_H */ | 1795 | #endif /* __HCI_H */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 3ede820d328f..f8555ad7b104 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -81,6 +81,7 @@ struct hci_conn_hash { | |||
| 81 | struct bdaddr_list { | 81 | struct bdaddr_list { |
| 82 | struct list_head list; | 82 | struct list_head list; |
| 83 | bdaddr_t bdaddr; | 83 | bdaddr_t bdaddr; |
| 84 | u8 bdaddr_type; | ||
| 84 | }; | 85 | }; |
| 85 | 86 | ||
| 86 | struct bt_uuid { | 87 | struct bt_uuid { |
| @@ -140,6 +141,8 @@ struct hci_dev { | |||
| 140 | __u8 bus; | 141 | __u8 bus; |
| 141 | __u8 dev_type; | 142 | __u8 dev_type; |
| 142 | bdaddr_t bdaddr; | 143 | bdaddr_t bdaddr; |
| 144 | bdaddr_t static_addr; | ||
| 145 | __u8 own_addr_type; | ||
| 143 | __u8 dev_name[HCI_MAX_NAME_LENGTH]; | 146 | __u8 dev_name[HCI_MAX_NAME_LENGTH]; |
| 144 | __u8 short_name[HCI_MAX_SHORT_NAME_LENGTH]; | 147 | __u8 short_name[HCI_MAX_SHORT_NAME_LENGTH]; |
| 145 | __u8 eir[HCI_MAX_EIR_LENGTH]; | 148 | __u8 eir[HCI_MAX_EIR_LENGTH]; |
| @@ -158,11 +161,17 @@ struct hci_dev { | |||
| 158 | __u16 manufacturer; | 161 | __u16 manufacturer; |
| 159 | __u16 lmp_subver; | 162 | __u16 lmp_subver; |
| 160 | __u16 voice_setting; | 163 | __u16 voice_setting; |
| 164 | __u8 num_iac; | ||
| 161 | __u8 io_capability; | 165 | __u8 io_capability; |
| 162 | __s8 inq_tx_power; | 166 | __s8 inq_tx_power; |
| 163 | __u16 page_scan_interval; | 167 | __u16 page_scan_interval; |
| 164 | __u16 page_scan_window; | 168 | __u16 page_scan_window; |
| 165 | __u8 page_scan_type; | 169 | __u8 page_scan_type; |
| 170 | __u16 le_scan_interval; | ||
| 171 | __u16 le_scan_window; | ||
| 172 | __u16 le_conn_min_interval; | ||
| 173 | __u16 le_conn_max_interval; | ||
| 174 | __u8 ssp_debug_mode; | ||
| 166 | 175 | ||
| 167 | __u16 devid_source; | 176 | __u16 devid_source; |
| 168 | __u16 devid_vendor; | 177 | __u16 devid_vendor; |
| @@ -279,14 +288,15 @@ struct hci_dev { | |||
| 279 | __s8 adv_tx_power; | 288 | __s8 adv_tx_power; |
| 280 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | 289 | __u8 adv_data[HCI_MAX_AD_LENGTH]; |
| 281 | __u8 adv_data_len; | 290 | __u8 adv_data_len; |
| 291 | __u8 scan_rsp_data[HCI_MAX_AD_LENGTH]; | ||
| 292 | __u8 scan_rsp_data_len; | ||
| 282 | 293 | ||
| 283 | int (*open)(struct hci_dev *hdev); | 294 | int (*open)(struct hci_dev *hdev); |
| 284 | int (*close)(struct hci_dev *hdev); | 295 | int (*close)(struct hci_dev *hdev); |
| 285 | int (*flush)(struct hci_dev *hdev); | 296 | int (*flush)(struct hci_dev *hdev); |
| 286 | int (*setup)(struct hci_dev *hdev); | 297 | int (*setup)(struct hci_dev *hdev); |
| 287 | int (*send)(struct sk_buff *skb); | 298 | int (*send)(struct hci_dev *hdev, struct sk_buff *skb); |
| 288 | void (*notify)(struct hci_dev *hdev, unsigned int evt); | 299 | void (*notify)(struct hci_dev *hdev, unsigned int evt); |
| 289 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); | ||
| 290 | }; | 300 | }; |
| 291 | 301 | ||
| 292 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) | 302 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) |
| @@ -298,6 +308,8 @@ struct hci_conn { | |||
| 298 | 308 | ||
| 299 | bdaddr_t dst; | 309 | bdaddr_t dst; |
| 300 | __u8 dst_type; | 310 | __u8 dst_type; |
| 311 | bdaddr_t src; | ||
| 312 | __u8 src_type; | ||
| 301 | __u16 handle; | 313 | __u16 handle; |
| 302 | __u16 state; | 314 | __u16 state; |
| 303 | __u8 mode; | 315 | __u8 mode; |
| @@ -306,7 +318,6 @@ struct hci_conn { | |||
| 306 | __u8 attempt; | 318 | __u8 attempt; |
| 307 | __u8 dev_class[3]; | 319 | __u8 dev_class[3]; |
| 308 | __u8 features[HCI_MAX_PAGES][8]; | 320 | __u8 features[HCI_MAX_PAGES][8]; |
| 309 | __u16 interval; | ||
| 310 | __u16 pkt_type; | 321 | __u16 pkt_type; |
| 311 | __u16 link_policy; | 322 | __u16 link_policy; |
| 312 | __u32 link_mode; | 323 | __u32 link_mode; |
| @@ -334,8 +345,8 @@ struct hci_conn { | |||
| 334 | struct list_head chan_list; | 345 | struct list_head chan_list; |
| 335 | 346 | ||
| 336 | struct delayed_work disc_work; | 347 | struct delayed_work disc_work; |
| 337 | struct timer_list idle_timer; | 348 | struct delayed_work auto_accept_work; |
| 338 | struct timer_list auto_accept_timer; | 349 | struct delayed_work idle_work; |
| 339 | 350 | ||
| 340 | struct device dev; | 351 | struct device dev; |
| 341 | 352 | ||
| @@ -367,18 +378,17 @@ extern rwlock_t hci_dev_list_lock; | |||
| 367 | extern rwlock_t hci_cb_list_lock; | 378 | extern rwlock_t hci_cb_list_lock; |
| 368 | 379 | ||
| 369 | /* ----- HCI interface to upper protocols ----- */ | 380 | /* ----- HCI interface to upper protocols ----- */ |
| 370 | extern int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 381 | int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 371 | extern void l2cap_connect_cfm(struct hci_conn *hcon, u8 status); | 382 | void l2cap_connect_cfm(struct hci_conn *hcon, u8 status); |
| 372 | extern int l2cap_disconn_ind(struct hci_conn *hcon); | 383 | int l2cap_disconn_ind(struct hci_conn *hcon); |
| 373 | extern void l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); | 384 | void l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); |
| 374 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); | 385 | int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); |
| 375 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, | 386 | int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags); |
| 376 | u16 flags); | 387 | |
| 377 | 388 | int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags); | |
| 378 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags); | 389 | void sco_connect_cfm(struct hci_conn *hcon, __u8 status); |
| 379 | extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status); | 390 | void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); |
| 380 | extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); | 391 | int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); |
| 381 | extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); | ||
| 382 | 392 | ||
| 383 | /* ----- Inquiry cache ----- */ | 393 | /* ----- Inquiry cache ----- */ |
| 384 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */ | 394 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */ |
| @@ -644,7 +654,7 @@ static inline void hci_conn_drop(struct hci_conn *conn) | |||
| 644 | switch (conn->type) { | 654 | switch (conn->type) { |
| 645 | case ACL_LINK: | 655 | case ACL_LINK: |
| 646 | case LE_LINK: | 656 | case LE_LINK: |
| 647 | del_timer(&conn->idle_timer); | 657 | cancel_delayed_work(&conn->idle_work); |
| 648 | if (conn->state == BT_CONNECTED) { | 658 | if (conn->state == BT_CONNECTED) { |
| 649 | timeo = conn->disc_timeout; | 659 | timeo = conn->disc_timeout; |
| 650 | if (!conn->out) | 660 | if (!conn->out) |
| @@ -703,19 +713,6 @@ static inline void hci_set_drvdata(struct hci_dev *hdev, void *data) | |||
| 703 | dev_set_drvdata(&hdev->dev, data); | 713 | dev_set_drvdata(&hdev->dev, data); |
| 704 | } | 714 | } |
| 705 | 715 | ||
| 706 | /* hci_dev_list shall be locked */ | ||
| 707 | static inline uint8_t __hci_num_ctrl(void) | ||
| 708 | { | ||
| 709 | uint8_t count = 0; | ||
| 710 | struct list_head *p; | ||
| 711 | |||
| 712 | list_for_each(p, &hci_dev_list) { | ||
| 713 | count++; | ||
| 714 | } | ||
| 715 | |||
| 716 | return count; | ||
| 717 | } | ||
| 718 | |||
| 719 | struct hci_dev *hci_dev_get(int index); | 716 | struct hci_dev *hci_dev_get(int index); |
| 720 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); | 717 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); |
| 721 | 718 | ||
| @@ -738,7 +735,7 @@ int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | |||
| 738 | int hci_inquiry(void __user *arg); | 735 | int hci_inquiry(void __user *arg); |
| 739 | 736 | ||
| 740 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, | 737 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, |
| 741 | bdaddr_t *bdaddr); | 738 | bdaddr_t *bdaddr, u8 type); |
| 742 | int hci_blacklist_clear(struct hci_dev *hdev); | 739 | int hci_blacklist_clear(struct hci_dev *hdev); |
| 743 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 740 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
| 744 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 741 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
| @@ -768,13 +765,11 @@ int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | |||
| 768 | 765 | ||
| 769 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 766 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
| 770 | 767 | ||
| 771 | int hci_recv_frame(struct sk_buff *skb); | 768 | int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb); |
| 772 | int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); | 769 | int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); |
| 773 | int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count); | 770 | int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count); |
| 774 | 771 | ||
| 775 | void hci_init_sysfs(struct hci_dev *hdev); | 772 | void hci_init_sysfs(struct hci_dev *hdev); |
| 776 | int hci_add_sysfs(struct hci_dev *hdev); | ||
| 777 | void hci_del_sysfs(struct hci_dev *hdev); | ||
| 778 | void hci_conn_init_sysfs(struct hci_conn *conn); | 773 | void hci_conn_init_sysfs(struct hci_conn *conn); |
| 779 | void hci_conn_add_sysfs(struct hci_conn *conn); | 774 | void hci_conn_add_sysfs(struct hci_conn *conn); |
| 780 | void hci_conn_del_sysfs(struct hci_conn *conn); | 775 | void hci_conn_del_sysfs(struct hci_conn *conn); |
| @@ -807,22 +802,6 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
| 807 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) | 802 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) |
| 808 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) | 803 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) |
| 809 | 804 | ||
| 810 | /* returns true if at least one AMP active */ | ||
| 811 | static inline bool hci_amp_capable(void) | ||
| 812 | { | ||
| 813 | struct hci_dev *hdev; | ||
| 814 | bool ret = false; | ||
| 815 | |||
| 816 | read_lock(&hci_dev_list_lock); | ||
| 817 | list_for_each_entry(hdev, &hci_dev_list, list) | ||
| 818 | if (hdev->amp_type == HCI_AMP && | ||
| 819 | test_bit(HCI_UP, &hdev->flags)) | ||
| 820 | ret = true; | ||
| 821 | read_unlock(&hci_dev_list_lock); | ||
| 822 | |||
| 823 | return ret; | ||
| 824 | } | ||
| 825 | |||
| 826 | /* ----- HCI protocols ----- */ | 805 | /* ----- HCI protocols ----- */ |
| 827 | #define HCI_PROTO_DEFER 0x01 | 806 | #define HCI_PROTO_DEFER 0x01 |
| 828 | 807 | ||
| @@ -1033,34 +1012,6 @@ static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) | |||
| 1033 | return false; | 1012 | return false; |
| 1034 | } | 1013 | } |
| 1035 | 1014 | ||
| 1036 | static inline size_t eir_get_length(u8 *eir, size_t eir_len) | ||
| 1037 | { | ||
| 1038 | size_t parsed = 0; | ||
| 1039 | |||
| 1040 | while (parsed < eir_len) { | ||
| 1041 | u8 field_len = eir[0]; | ||
| 1042 | |||
| 1043 | if (field_len == 0) | ||
| 1044 | return parsed; | ||
| 1045 | |||
| 1046 | parsed += field_len + 1; | ||
| 1047 | eir += field_len + 1; | ||
| 1048 | } | ||
| 1049 | |||
| 1050 | return eir_len; | ||
| 1051 | } | ||
| 1052 | |||
| 1053 | static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data, | ||
| 1054 | u8 data_len) | ||
| 1055 | { | ||
| 1056 | eir[eir_len++] = sizeof(type) + data_len; | ||
| 1057 | eir[eir_len++] = type; | ||
| 1058 | memcpy(&eir[eir_len], data, data_len); | ||
| 1059 | eir_len += data_len; | ||
| 1060 | |||
| 1061 | return eir_len; | ||
| 1062 | } | ||
| 1063 | |||
| 1064 | int hci_register_cb(struct hci_cb *hcb); | 1015 | int hci_register_cb(struct hci_cb *hcb); |
| 1065 | int hci_unregister_cb(struct hci_cb *hcb); | 1016 | int hci_unregister_cb(struct hci_cb *hcb); |
| 1066 | 1017 | ||
| @@ -1120,29 +1071,30 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event); | |||
| 1120 | #define DISCOV_BREDR_INQUIRY_LEN 0x08 | 1071 | #define DISCOV_BREDR_INQUIRY_LEN 0x08 |
| 1121 | 1072 | ||
| 1122 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | 1073 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); |
| 1123 | int mgmt_index_added(struct hci_dev *hdev); | 1074 | void mgmt_index_added(struct hci_dev *hdev); |
| 1124 | int mgmt_index_removed(struct hci_dev *hdev); | 1075 | void mgmt_index_removed(struct hci_dev *hdev); |
| 1125 | int mgmt_set_powered_failed(struct hci_dev *hdev, int err); | 1076 | void mgmt_set_powered_failed(struct hci_dev *hdev, int err); |
| 1126 | int mgmt_powered(struct hci_dev *hdev, u8 powered); | 1077 | int mgmt_powered(struct hci_dev *hdev, u8 powered); |
| 1127 | int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); | 1078 | void mgmt_discoverable_timeout(struct hci_dev *hdev); |
| 1128 | int mgmt_connectable(struct hci_dev *hdev, u8 connectable); | 1079 | void mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); |
| 1129 | int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); | 1080 | void mgmt_connectable(struct hci_dev *hdev, u8 connectable); |
| 1130 | int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, | 1081 | void mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); |
| 1131 | bool persistent); | 1082 | void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, |
| 1132 | int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1083 | bool persistent); |
| 1133 | u8 addr_type, u32 flags, u8 *name, u8 name_len, | 1084 | void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 1134 | u8 *dev_class); | 1085 | u8 addr_type, u32 flags, u8 *name, u8 name_len, |
| 1135 | int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1086 | u8 *dev_class); |
| 1136 | u8 link_type, u8 addr_type, u8 reason); | 1087 | void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 1137 | int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1088 | u8 link_type, u8 addr_type, u8 reason); |
| 1138 | u8 link_type, u8 addr_type, u8 status); | 1089 | void mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 1139 | int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1090 | u8 link_type, u8 addr_type, u8 status); |
| 1140 | u8 addr_type, u8 status); | 1091 | void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 1141 | int mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); | 1092 | u8 addr_type, u8 status); |
| 1142 | int mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1093 | void mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); |
| 1143 | u8 status); | 1094 | void mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 1144 | int mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1095 | u8 status); |
| 1145 | u8 status); | 1096 | void mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 1097 | u8 status); | ||
| 1146 | int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1098 | int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 1147 | u8 link_type, u8 addr_type, __le32 value, | 1099 | u8 link_type, u8 addr_type, __le32 value, |
| 1148 | u8 confirm_hint); | 1100 | u8 confirm_hint); |
| @@ -1159,26 +1111,25 @@ int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
| 1159 | int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1111 | int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 1160 | u8 link_type, u8 addr_type, u32 passkey, | 1112 | u8 link_type, u8 addr_type, u32 passkey, |
| 1161 | u8 entered); | 1113 | u8 entered); |
| 1162 | int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1114 | void mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 1163 | u8 addr_type, u8 status); | 1115 | u8 addr_type, u8 status); |
| 1164 | int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); | 1116 | void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); |
| 1165 | int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); | 1117 | void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); |
| 1166 | int mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, | 1118 | void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, |
| 1167 | u8 status); | 1119 | u8 status); |
| 1168 | int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); | 1120 | void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); |
| 1169 | int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, | 1121 | void mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, |
| 1170 | u8 *randomizer, u8 status); | 1122 | u8 *randomizer, u8 status); |
| 1171 | int mgmt_le_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); | 1123 | void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 1172 | int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1124 | u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, |
| 1173 | u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, | 1125 | u8 ssp, u8 *eir, u16 eir_len); |
| 1174 | u8 ssp, u8 *eir, u16 eir_len); | 1126 | void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 1175 | int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1127 | u8 addr_type, s8 rssi, u8 *name, u8 name_len); |
| 1176 | u8 addr_type, s8 rssi, u8 *name, u8 name_len); | 1128 | void mgmt_discovering(struct hci_dev *hdev, u8 discovering); |
| 1177 | int mgmt_discovering(struct hci_dev *hdev, u8 discovering); | ||
| 1178 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 1129 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
| 1179 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 1130 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
| 1180 | bool mgmt_valid_hdev(struct hci_dev *hdev); | 1131 | void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); |
| 1181 | int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); | 1132 | void mgmt_reenable_advertising(struct hci_dev *hdev); |
| 1182 | 1133 | ||
| 1183 | /* HCI info for socket */ | 1134 | /* HCI info for socket */ |
| 1184 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 1135 | #define hci_pi(sk) ((struct hci_pinfo *) sk) |
| @@ -1208,15 +1159,11 @@ struct hci_sec_filter { | |||
| 1208 | #define hci_req_lock(d) mutex_lock(&d->req_lock) | 1159 | #define hci_req_lock(d) mutex_lock(&d->req_lock) |
| 1209 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) | 1160 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) |
| 1210 | 1161 | ||
| 1211 | void hci_update_ad(struct hci_request *req); | ||
| 1212 | |||
| 1213 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, | 1162 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, |
| 1214 | u16 latency, u16 to_multiplier); | 1163 | u16 latency, u16 to_multiplier); |
| 1215 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], | 1164 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], |
| 1216 | __u8 ltk[16]); | 1165 | __u8 ltk[16]); |
| 1217 | 1166 | ||
| 1218 | u8 bdaddr_to_le(u8 bdaddr_type); | ||
| 1219 | |||
| 1220 | #define SCO_AIRMODE_MASK 0x0003 | 1167 | #define SCO_AIRMODE_MASK 0x0003 |
| 1221 | #define SCO_AIRMODE_CVSD 0x0000 | 1168 | #define SCO_AIRMODE_CVSD 0x0000 |
| 1222 | #define SCO_AIRMODE_TRANSP 0x0003 | 1169 | #define SCO_AIRMODE_TRANSP 0x0003 |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 1a966afbbfa8..c853b16de4ef 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -131,6 +131,7 @@ struct l2cap_conninfo { | |||
| 131 | 131 | ||
| 132 | /* L2CAP fixed channels */ | 132 | /* L2CAP fixed channels */ |
| 133 | #define L2CAP_FC_L2CAP 0x02 | 133 | #define L2CAP_FC_L2CAP 0x02 |
| 134 | #define L2CAP_FC_CONNLESS 0x04 | ||
| 134 | #define L2CAP_FC_A2MP 0x08 | 135 | #define L2CAP_FC_A2MP 0x08 |
| 135 | 136 | ||
| 136 | /* L2CAP Control Field bit masks */ | 137 | /* L2CAP Control Field bit masks */ |
| @@ -237,8 +238,9 @@ struct l2cap_conn_rsp { | |||
| 237 | /* protocol/service multiplexer (PSM) */ | 238 | /* protocol/service multiplexer (PSM) */ |
| 238 | #define L2CAP_PSM_SDP 0x0001 | 239 | #define L2CAP_PSM_SDP 0x0001 |
| 239 | #define L2CAP_PSM_RFCOMM 0x0003 | 240 | #define L2CAP_PSM_RFCOMM 0x0003 |
| 241 | #define L2CAP_PSM_3DSP 0x0021 | ||
| 240 | 242 | ||
| 241 | /* channel indentifier */ | 243 | /* channel identifier */ |
| 242 | #define L2CAP_CID_SIGNALING 0x0001 | 244 | #define L2CAP_CID_SIGNALING 0x0001 |
| 243 | #define L2CAP_CID_CONN_LESS 0x0002 | 245 | #define L2CAP_CID_CONN_LESS 0x0002 |
| 244 | #define L2CAP_CID_A2MP 0x0003 | 246 | #define L2CAP_CID_A2MP 0x0003 |
| @@ -433,8 +435,6 @@ struct l2cap_seq_list { | |||
| 433 | #define L2CAP_SEQ_LIST_TAIL 0x8000 | 435 | #define L2CAP_SEQ_LIST_TAIL 0x8000 |
| 434 | 436 | ||
| 435 | struct l2cap_chan { | 437 | struct l2cap_chan { |
| 436 | struct sock *sk; | ||
| 437 | |||
| 438 | struct l2cap_conn *conn; | 438 | struct l2cap_conn *conn; |
| 439 | struct hci_conn *hs_hcon; | 439 | struct hci_conn *hs_hcon; |
| 440 | struct hci_chan *hs_hchan; | 440 | struct hci_chan *hs_hchan; |
| @@ -442,7 +442,12 @@ struct l2cap_chan { | |||
| 442 | 442 | ||
| 443 | __u8 state; | 443 | __u8 state; |
| 444 | 444 | ||
| 445 | bdaddr_t dst; | ||
| 446 | __u8 dst_type; | ||
| 447 | bdaddr_t src; | ||
| 448 | __u8 src_type; | ||
| 445 | __le16 psm; | 449 | __le16 psm; |
| 450 | __le16 sport; | ||
| 446 | __u16 dcid; | 451 | __u16 dcid; |
| 447 | __u16 scid; | 452 | __u16 scid; |
| 448 | 453 | ||
| @@ -453,8 +458,6 @@ struct l2cap_chan { | |||
| 453 | __u8 chan_type; | 458 | __u8 chan_type; |
| 454 | __u8 chan_policy; | 459 | __u8 chan_policy; |
| 455 | 460 | ||
| 456 | __le16 sport; | ||
| 457 | |||
| 458 | __u8 sec_level; | 461 | __u8 sec_level; |
| 459 | 462 | ||
| 460 | __u8 ident; | 463 | __u8 ident; |
| @@ -546,9 +549,12 @@ struct l2cap_ops { | |||
| 546 | void (*teardown) (struct l2cap_chan *chan, int err); | 549 | void (*teardown) (struct l2cap_chan *chan, int err); |
| 547 | void (*close) (struct l2cap_chan *chan); | 550 | void (*close) (struct l2cap_chan *chan); |
| 548 | void (*state_change) (struct l2cap_chan *chan, | 551 | void (*state_change) (struct l2cap_chan *chan, |
| 549 | int state); | 552 | int state, int err); |
| 550 | void (*ready) (struct l2cap_chan *chan); | 553 | void (*ready) (struct l2cap_chan *chan); |
| 551 | void (*defer) (struct l2cap_chan *chan); | 554 | void (*defer) (struct l2cap_chan *chan); |
| 555 | void (*resume) (struct l2cap_chan *chan); | ||
| 556 | void (*set_shutdown) (struct l2cap_chan *chan); | ||
| 557 | long (*get_sndtimeo) (struct l2cap_chan *chan); | ||
| 552 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 558 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
| 553 | unsigned long len, int nb); | 559 | unsigned long len, int nb); |
| 554 | }; | 560 | }; |
| @@ -557,13 +563,11 @@ struct l2cap_conn { | |||
| 557 | struct hci_conn *hcon; | 563 | struct hci_conn *hcon; |
| 558 | struct hci_chan *hchan; | 564 | struct hci_chan *hchan; |
| 559 | 565 | ||
| 560 | bdaddr_t *dst; | ||
| 561 | bdaddr_t *src; | ||
| 562 | |||
| 563 | unsigned int mtu; | 566 | unsigned int mtu; |
| 564 | 567 | ||
| 565 | __u32 feat_mask; | 568 | __u32 feat_mask; |
| 566 | __u8 fixed_chan_mask; | 569 | __u8 fixed_chan_mask; |
| 570 | bool hs_enabled; | ||
| 567 | 571 | ||
| 568 | __u8 info_state; | 572 | __u8 info_state; |
| 569 | __u8 info_ident; | 573 | __u8 info_ident; |
| @@ -649,6 +653,7 @@ enum { | |||
| 649 | FLAG_FLUSHABLE, | 653 | FLAG_FLUSHABLE, |
| 650 | FLAG_EXT_CTRL, | 654 | FLAG_EXT_CTRL, |
| 651 | FLAG_EFS_ENABLE, | 655 | FLAG_EFS_ENABLE, |
| 656 | FLAG_DEFER_SETUP, | ||
| 652 | }; | 657 | }; |
| 653 | 658 | ||
| 654 | enum { | 659 | enum { |
| @@ -790,6 +795,19 @@ static inline void l2cap_chan_no_defer(struct l2cap_chan *chan) | |||
| 790 | { | 795 | { |
| 791 | } | 796 | } |
| 792 | 797 | ||
| 798 | static inline void l2cap_chan_no_resume(struct l2cap_chan *chan) | ||
| 799 | { | ||
| 800 | } | ||
| 801 | |||
| 802 | static inline void l2cap_chan_no_set_shutdown(struct l2cap_chan *chan) | ||
| 803 | { | ||
| 804 | } | ||
| 805 | |||
| 806 | static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan) | ||
| 807 | { | ||
| 808 | return 0; | ||
| 809 | } | ||
| 810 | |||
| 793 | extern bool disable_ertm; | 811 | extern bool disable_ertm; |
| 794 | 812 | ||
| 795 | int l2cap_init_sockets(void); | 813 | int l2cap_init_sockets(void); |
| @@ -797,7 +815,6 @@ void l2cap_cleanup_sockets(void); | |||
| 797 | bool l2cap_is_socket(struct socket *sock); | 815 | bool l2cap_is_socket(struct socket *sock); |
| 798 | 816 | ||
| 799 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); | 817 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); |
| 800 | int __l2cap_wait_ack(struct sock *sk); | ||
| 801 | 818 | ||
| 802 | int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); | 819 | int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); |
| 803 | int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid); | 820 | int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid); |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 9944c3e68c5d..518c5c84e39a 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
| @@ -93,6 +93,7 @@ struct mgmt_rp_read_index_list { | |||
| 93 | #define MGMT_SETTING_BREDR 0x00000080 | 93 | #define MGMT_SETTING_BREDR 0x00000080 |
| 94 | #define MGMT_SETTING_HS 0x00000100 | 94 | #define MGMT_SETTING_HS 0x00000100 |
| 95 | #define MGMT_SETTING_LE 0x00000200 | 95 | #define MGMT_SETTING_LE 0x00000200 |
| 96 | #define MGMT_SETTING_ADVERTISING 0x00000400 | ||
| 96 | 97 | ||
| 97 | #define MGMT_OP_READ_INFO 0x0004 | 98 | #define MGMT_OP_READ_INFO 0x0004 |
| 98 | #define MGMT_READ_INFO_SIZE 0 | 99 | #define MGMT_READ_INFO_SIZE 0 |
| @@ -351,6 +352,23 @@ struct mgmt_cp_set_device_id { | |||
| 351 | } __packed; | 352 | } __packed; |
| 352 | #define MGMT_SET_DEVICE_ID_SIZE 8 | 353 | #define MGMT_SET_DEVICE_ID_SIZE 8 |
| 353 | 354 | ||
| 355 | #define MGMT_OP_SET_ADVERTISING 0x0029 | ||
| 356 | |||
| 357 | #define MGMT_OP_SET_BREDR 0x002A | ||
| 358 | |||
| 359 | #define MGMT_OP_SET_STATIC_ADDRESS 0x002B | ||
| 360 | struct mgmt_cp_set_static_address { | ||
| 361 | bdaddr_t bdaddr; | ||
| 362 | } __packed; | ||
| 363 | #define MGMT_SET_STATIC_ADDRESS_SIZE 6 | ||
| 364 | |||
| 365 | #define MGMT_OP_SET_SCAN_PARAMS 0x002C | ||
| 366 | struct mgmt_cp_set_scan_params { | ||
| 367 | __le16 interval; | ||
| 368 | __le16 window; | ||
| 369 | } __packed; | ||
| 370 | #define MGMT_SET_SCAN_PARAMS_SIZE 4 | ||
| 371 | |||
| 354 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 372 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
| 355 | struct mgmt_ev_cmd_complete { | 373 | struct mgmt_ev_cmd_complete { |
| 356 | __le16 opcode; | 374 | __le16 opcode; |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 7afd4199d6b6..486213a1aed8 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
| @@ -256,8 +256,8 @@ static inline void rfcomm_dlc_put(struct rfcomm_dlc *d) | |||
| 256 | rfcomm_dlc_free(d); | 256 | rfcomm_dlc_free(d); |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | extern void __rfcomm_dlc_throttle(struct rfcomm_dlc *d); | 259 | void __rfcomm_dlc_throttle(struct rfcomm_dlc *d); |
| 260 | extern void __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d); | 260 | void __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d); |
| 261 | 261 | ||
| 262 | static inline void rfcomm_dlc_throttle(struct rfcomm_dlc *d) | 262 | static inline void rfcomm_dlc_throttle(struct rfcomm_dlc *d) |
| 263 | { | 263 | { |
| @@ -300,6 +300,8 @@ struct rfcomm_conninfo { | |||
| 300 | 300 | ||
| 301 | struct rfcomm_pinfo { | 301 | struct rfcomm_pinfo { |
| 302 | struct bt_sock bt; | 302 | struct bt_sock bt; |
| 303 | bdaddr_t src; | ||
| 304 | bdaddr_t dst; | ||
| 303 | struct rfcomm_dlc *dlc; | 305 | struct rfcomm_dlc *dlc; |
| 304 | u8 channel; | 306 | u8 channel; |
| 305 | u8 sec_level; | 307 | u8 sec_level; |
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h index e252a31ee6b6..2019d1a0996a 100644 --- a/include/net/bluetooth/sco.h +++ b/include/net/bluetooth/sco.h | |||
| @@ -55,9 +55,6 @@ struct sco_conninfo { | |||
| 55 | struct sco_conn { | 55 | struct sco_conn { |
| 56 | struct hci_conn *hcon; | 56 | struct hci_conn *hcon; |
| 57 | 57 | ||
| 58 | bdaddr_t *dst; | ||
| 59 | bdaddr_t *src; | ||
| 60 | |||
| 61 | spinlock_t lock; | 58 | spinlock_t lock; |
| 62 | struct sock *sk; | 59 | struct sock *sk; |
| 63 | 60 | ||
| @@ -72,6 +69,8 @@ struct sco_conn { | |||
| 72 | 69 | ||
| 73 | struct sco_pinfo { | 70 | struct sco_pinfo { |
| 74 | struct bt_sock bt; | 71 | struct bt_sock bt; |
| 72 | bdaddr_t src; | ||
| 73 | bdaddr_t dst; | ||
| 75 | __u32 flags; | 74 | __u32 flags; |
| 76 | __u16 setting; | 75 | __u16 setting; |
| 77 | struct sco_conn *conn; | 76 | struct sco_conn *conn; |
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h deleted file mode 100644 index f8ba07f3e5fa..000000000000 --- a/include/net/bluetooth/smp.h +++ /dev/null | |||
| @@ -1,146 +0,0 @@ | |||
| 1 | /* | ||
| 2 | BlueZ - Bluetooth protocol stack for Linux | ||
| 3 | Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). | ||
| 4 | |||
| 5 | This program is free software; you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License version 2 as | ||
| 7 | published by the Free Software Foundation; | ||
| 8 | |||
| 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| 10 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 11 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | ||
| 12 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | ||
| 13 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | ||
| 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 17 | |||
| 18 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | ||
| 19 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | ||
| 20 | SOFTWARE IS DISCLAIMED. | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __SMP_H | ||
| 24 | #define __SMP_H | ||
| 25 | |||
| 26 | struct smp_command_hdr { | ||
| 27 | __u8 code; | ||
| 28 | } __packed; | ||
| 29 | |||
| 30 | #define SMP_CMD_PAIRING_REQ 0x01 | ||
| 31 | #define SMP_CMD_PAIRING_RSP 0x02 | ||
| 32 | struct smp_cmd_pairing { | ||
| 33 | __u8 io_capability; | ||
| 34 | __u8 oob_flag; | ||
| 35 | __u8 auth_req; | ||
| 36 | __u8 max_key_size; | ||
| 37 | __u8 init_key_dist; | ||
| 38 | __u8 resp_key_dist; | ||
| 39 | } __packed; | ||
| 40 | |||
| 41 | #define SMP_IO_DISPLAY_ONLY 0x00 | ||
| 42 | #define SMP_IO_DISPLAY_YESNO 0x01 | ||
| 43 | #define SMP_IO_KEYBOARD_ONLY 0x02 | ||
| 44 | #define SMP_IO_NO_INPUT_OUTPUT 0x03 | ||
| 45 | #define SMP_IO_KEYBOARD_DISPLAY 0x04 | ||
| 46 | |||
| 47 | #define SMP_OOB_NOT_PRESENT 0x00 | ||
| 48 | #define SMP_OOB_PRESENT 0x01 | ||
| 49 | |||
| 50 | #define SMP_DIST_ENC_KEY 0x01 | ||
| 51 | #define SMP_DIST_ID_KEY 0x02 | ||
| 52 | #define SMP_DIST_SIGN 0x04 | ||
| 53 | |||
| 54 | #define SMP_AUTH_NONE 0x00 | ||
| 55 | #define SMP_AUTH_BONDING 0x01 | ||
| 56 | #define SMP_AUTH_MITM 0x04 | ||
| 57 | |||
| 58 | #define SMP_CMD_PAIRING_CONFIRM 0x03 | ||
| 59 | struct smp_cmd_pairing_confirm { | ||
| 60 | __u8 confirm_val[16]; | ||
| 61 | } __packed; | ||
| 62 | |||
| 63 | #define SMP_CMD_PAIRING_RANDOM 0x04 | ||
| 64 | struct smp_cmd_pairing_random { | ||
| 65 | __u8 rand_val[16]; | ||
| 66 | } __packed; | ||
| 67 | |||
| 68 | #define SMP_CMD_PAIRING_FAIL 0x05 | ||
| 69 | struct smp_cmd_pairing_fail { | ||
| 70 | __u8 reason; | ||
| 71 | } __packed; | ||
| 72 | |||
| 73 | #define SMP_CMD_ENCRYPT_INFO 0x06 | ||
| 74 | struct smp_cmd_encrypt_info { | ||
| 75 | __u8 ltk[16]; | ||
| 76 | } __packed; | ||
| 77 | |||
| 78 | #define SMP_CMD_MASTER_IDENT 0x07 | ||
| 79 | struct smp_cmd_master_ident { | ||
| 80 | __le16 ediv; | ||
| 81 | __u8 rand[8]; | ||
| 82 | } __packed; | ||
| 83 | |||
| 84 | #define SMP_CMD_IDENT_INFO 0x08 | ||
| 85 | struct smp_cmd_ident_info { | ||
| 86 | __u8 irk[16]; | ||
| 87 | } __packed; | ||
| 88 | |||
| 89 | #define SMP_CMD_IDENT_ADDR_INFO 0x09 | ||
| 90 | struct smp_cmd_ident_addr_info { | ||
| 91 | __u8 addr_type; | ||
| 92 | bdaddr_t bdaddr; | ||
| 93 | } __packed; | ||
| 94 | |||
| 95 | #define SMP_CMD_SIGN_INFO 0x0a | ||
| 96 | struct smp_cmd_sign_info { | ||
| 97 | __u8 csrk[16]; | ||
| 98 | } __packed; | ||
| 99 | |||
| 100 | #define SMP_CMD_SECURITY_REQ 0x0b | ||
| 101 | struct smp_cmd_security_req { | ||
| 102 | __u8 auth_req; | ||
| 103 | } __packed; | ||
| 104 | |||
| 105 | #define SMP_PASSKEY_ENTRY_FAILED 0x01 | ||
| 106 | #define SMP_OOB_NOT_AVAIL 0x02 | ||
| 107 | #define SMP_AUTH_REQUIREMENTS 0x03 | ||
| 108 | #define SMP_CONFIRM_FAILED 0x04 | ||
| 109 | #define SMP_PAIRING_NOTSUPP 0x05 | ||
| 110 | #define SMP_ENC_KEY_SIZE 0x06 | ||
| 111 | #define SMP_CMD_NOTSUPP 0x07 | ||
| 112 | #define SMP_UNSPECIFIED 0x08 | ||
| 113 | #define SMP_REPEATED_ATTEMPTS 0x09 | ||
| 114 | |||
| 115 | #define SMP_MIN_ENC_KEY_SIZE 7 | ||
| 116 | #define SMP_MAX_ENC_KEY_SIZE 16 | ||
| 117 | |||
| 118 | #define SMP_FLAG_TK_VALID 1 | ||
| 119 | #define SMP_FLAG_CFM_PENDING 2 | ||
| 120 | #define SMP_FLAG_MITM_AUTH 3 | ||
| 121 | |||
| 122 | struct smp_chan { | ||
| 123 | struct l2cap_conn *conn; | ||
| 124 | u8 preq[7]; /* SMP Pairing Request */ | ||
| 125 | u8 prsp[7]; /* SMP Pairing Response */ | ||
| 126 | u8 prnd[16]; /* SMP Pairing Random (local) */ | ||
| 127 | u8 rrnd[16]; /* SMP Pairing Random (remote) */ | ||
| 128 | u8 pcnf[16]; /* SMP Pairing Confirm */ | ||
| 129 | u8 tk[16]; /* SMP Temporary Key */ | ||
| 130 | u8 enc_key_size; | ||
| 131 | unsigned long smp_flags; | ||
| 132 | struct crypto_blkcipher *tfm; | ||
| 133 | struct work_struct confirm; | ||
| 134 | struct work_struct random; | ||
| 135 | |||
| 136 | }; | ||
| 137 | |||
| 138 | /* SMP Commands */ | ||
| 139 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); | ||
| 140 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); | ||
| 141 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); | ||
| 142 | int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); | ||
| 143 | |||
| 144 | void smp_chan_destroy(struct l2cap_conn *conn); | ||
| 145 | |||
| 146 | #endif /* __SMP_H */ | ||
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h index 4795e817afe5..097f69cfaa75 100644 --- a/include/net/caif/caif_hsi.h +++ b/include/net/caif/caif_hsi.h | |||
| @@ -195,6 +195,6 @@ enum ifla_caif_hsi { | |||
| 195 | __IFLA_CAIF_HSI_MAX | 195 | __IFLA_CAIF_HSI_MAX |
| 196 | }; | 196 | }; |
| 197 | 197 | ||
| 198 | extern struct cfhsi_ops *cfhsi_get_ops(void); | 198 | struct cfhsi_ops *cfhsi_get_ops(void); |
| 199 | 199 | ||
| 200 | #endif /* CAIF_HSI_H_ */ | 200 | #endif /* CAIF_HSI_H_ */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index cb710913d5c8..3eae46cb1acf 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -437,6 +437,15 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, | |||
| 437 | u32 prohibited_flags); | 437 | u32 prohibited_flags); |
| 438 | 438 | ||
| 439 | /** | 439 | /** |
| 440 | * cfg80211_chandef_dfs_required - checks if radar detection is required | ||
| 441 | * @wiphy: the wiphy to validate against | ||
| 442 | * @chandef: the channel definition to check | ||
| 443 | * Return: 1 if radar detection is required, 0 if it is not, < 0 on error | ||
| 444 | */ | ||
| 445 | int cfg80211_chandef_dfs_required(struct wiphy *wiphy, | ||
| 446 | const struct cfg80211_chan_def *chandef); | ||
| 447 | |||
| 448 | /** | ||
| 440 | * ieee80211_chandef_rate_flags - returns rate flags for a channel | 449 | * ieee80211_chandef_rate_flags - returns rate flags for a channel |
| 441 | * | 450 | * |
| 442 | * In some channel types, not all rates may be used - for example CCK | 451 | * In some channel types, not all rates may be used - for example CCK |
| @@ -735,6 +744,10 @@ enum station_parameters_apply_mask { | |||
| 735 | * @capability: station capability | 744 | * @capability: station capability |
| 736 | * @ext_capab: extended capabilities of the station | 745 | * @ext_capab: extended capabilities of the station |
| 737 | * @ext_capab_len: number of extended capabilities | 746 | * @ext_capab_len: number of extended capabilities |
| 747 | * @supported_channels: supported channels in IEEE 802.11 format | ||
| 748 | * @supported_channels_len: number of supported channels | ||
| 749 | * @supported_oper_classes: supported oper classes in IEEE 802.11 format | ||
| 750 | * @supported_oper_classes_len: number of supported operating classes | ||
| 738 | */ | 751 | */ |
| 739 | struct station_parameters { | 752 | struct station_parameters { |
| 740 | const u8 *supported_rates; | 753 | const u8 *supported_rates; |
| @@ -754,6 +767,10 @@ struct station_parameters { | |||
| 754 | u16 capability; | 767 | u16 capability; |
| 755 | const u8 *ext_capab; | 768 | const u8 *ext_capab; |
| 756 | u8 ext_capab_len; | 769 | u8 ext_capab_len; |
| 770 | const u8 *supported_channels; | ||
| 771 | u8 supported_channels_len; | ||
| 772 | const u8 *supported_oper_classes; | ||
| 773 | u8 supported_oper_classes_len; | ||
| 757 | }; | 774 | }; |
| 758 | 775 | ||
| 759 | /** | 776 | /** |
| @@ -1647,6 +1664,9 @@ struct cfg80211_disassoc_request { | |||
| 1647 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is | 1664 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is |
| 1648 | * required to assume that the port is unauthorized until authorized by | 1665 | * required to assume that the port is unauthorized until authorized by |
| 1649 | * user space. Otherwise, port is marked authorized by default. | 1666 | * user space. Otherwise, port is marked authorized by default. |
| 1667 | * @userspace_handles_dfs: whether user space controls DFS operation, i.e. | ||
| 1668 | * changes the channel when a radar is detected. This is required | ||
| 1669 | * to operate on DFS channels. | ||
| 1650 | * @basic_rates: bitmap of basic rates to use when creating the IBSS | 1670 | * @basic_rates: bitmap of basic rates to use when creating the IBSS |
| 1651 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 1671 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
| 1652 | * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask | 1672 | * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask |
| @@ -1664,6 +1684,7 @@ struct cfg80211_ibss_params { | |||
| 1664 | bool channel_fixed; | 1684 | bool channel_fixed; |
| 1665 | bool privacy; | 1685 | bool privacy; |
| 1666 | bool control_port; | 1686 | bool control_port; |
| 1687 | bool userspace_handles_dfs; | ||
| 1667 | int mcast_rate[IEEE80211_NUM_BANDS]; | 1688 | int mcast_rate[IEEE80211_NUM_BANDS]; |
| 1668 | struct ieee80211_ht_cap ht_capa; | 1689 | struct ieee80211_ht_cap ht_capa; |
| 1669 | struct ieee80211_ht_cap ht_capa_mask; | 1690 | struct ieee80211_ht_cap ht_capa_mask; |
| @@ -3044,6 +3065,7 @@ struct cfg80211_cached_keys; | |||
| 3044 | * @conn: (private) cfg80211 software SME connection state machine data | 3065 | * @conn: (private) cfg80211 software SME connection state machine data |
| 3045 | * @connect_keys: (private) keys to set after connection is established | 3066 | * @connect_keys: (private) keys to set after connection is established |
| 3046 | * @ibss_fixed: (private) IBSS is using fixed BSSID | 3067 | * @ibss_fixed: (private) IBSS is using fixed BSSID |
| 3068 | * @ibss_dfs_possible: (private) IBSS may change to a DFS channel | ||
| 3047 | * @event_list: (private) list for internal event processing | 3069 | * @event_list: (private) list for internal event processing |
| 3048 | * @event_lock: (private) lock for event list | 3070 | * @event_lock: (private) lock for event list |
| 3049 | */ | 3071 | */ |
| @@ -3082,6 +3104,7 @@ struct wireless_dev { | |||
| 3082 | struct ieee80211_channel *channel; | 3104 | struct ieee80211_channel *channel; |
| 3083 | 3105 | ||
| 3084 | bool ibss_fixed; | 3106 | bool ibss_fixed; |
| 3107 | bool ibss_dfs_possible; | ||
| 3085 | 3108 | ||
| 3086 | bool ps; | 3109 | bool ps; |
| 3087 | int ps_timeout; | 3110 | int ps_timeout; |
| @@ -3474,6 +3497,15 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy, | |||
| 3474 | const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy, | 3497 | const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy, |
| 3475 | u32 center_freq); | 3498 | u32 center_freq); |
| 3476 | 3499 | ||
| 3500 | /** | ||
| 3501 | * reg_initiator_name - map regulatory request initiator enum to name | ||
| 3502 | * @initiator: the regulatory request initiator | ||
| 3503 | * | ||
| 3504 | * You can use this to map the regulatory request initiator enum to a | ||
| 3505 | * proper string representation. | ||
| 3506 | */ | ||
| 3507 | const char *reg_initiator_name(enum nl80211_reg_initiator initiator); | ||
| 3508 | |||
| 3477 | /* | 3509 | /* |
| 3478 | * callbacks for asynchronous cfg80211 methods, notification | 3510 | * callbacks for asynchronous cfg80211 methods, notification |
| 3479 | * functions and BSS handling helpers | 3511 | * functions and BSS handling helpers |
diff --git a/include/net/checksum.h b/include/net/checksum.h index 8f59ca50477c..37a0e24adbe7 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h | |||
| @@ -79,6 +79,12 @@ csum_block_add(__wsum csum, __wsum csum2, int offset) | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static inline __wsum | 81 | static inline __wsum |
| 82 | csum_block_add_ext(__wsum csum, __wsum csum2, int offset, int len) | ||
| 83 | { | ||
| 84 | return csum_block_add(csum, csum2, offset); | ||
| 85 | } | ||
| 86 | |||
| 87 | static inline __wsum | ||
| 82 | csum_block_sub(__wsum csum, __wsum csum2, int offset) | 88 | csum_block_sub(__wsum csum, __wsum csum2, int offset) |
| 83 | { | 89 | { |
| 84 | u32 sum = (__force u32)csum2; | 90 | u32 sum = (__force u32)csum2; |
| @@ -92,6 +98,11 @@ static inline __wsum csum_unfold(__sum16 n) | |||
| 92 | return (__force __wsum)n; | 98 | return (__force __wsum)n; |
| 93 | } | 99 | } |
| 94 | 100 | ||
| 101 | static inline __wsum csum_partial_ext(const void *buff, int len, __wsum sum) | ||
| 102 | { | ||
| 103 | return csum_partial(buff, len, sum); | ||
| 104 | } | ||
| 105 | |||
| 95 | #define CSUM_MANGLED_0 ((__force __sum16)0xffff) | 106 | #define CSUM_MANGLED_0 ((__force __sum16)0xffff) |
| 96 | 107 | ||
| 97 | static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to) | 108 | static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to) |
diff --git a/include/net/codel.h b/include/net/codel.h index 389cf621161d..3b04ff5f6f8d 100644 --- a/include/net/codel.h +++ b/include/net/codel.h | |||
| @@ -72,10 +72,21 @@ static inline codel_time_t codel_get_time(void) | |||
| 72 | return ns >> CODEL_SHIFT; | 72 | return ns >> CODEL_SHIFT; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | #define codel_time_after(a, b) ((s32)(a) - (s32)(b) > 0) | 75 | /* Dealing with timer wrapping, according to RFC 1982, as desc in wikipedia: |
| 76 | #define codel_time_after_eq(a, b) ((s32)(a) - (s32)(b) >= 0) | 76 | * https://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution |
| 77 | #define codel_time_before(a, b) ((s32)(a) - (s32)(b) < 0) | 77 | * codel_time_after(a,b) returns true if the time a is after time b. |
| 78 | #define codel_time_before_eq(a, b) ((s32)(a) - (s32)(b) <= 0) | 78 | */ |
| 79 | #define codel_time_after(a, b) \ | ||
| 80 | (typecheck(codel_time_t, a) && \ | ||
| 81 | typecheck(codel_time_t, b) && \ | ||
| 82 | ((s32)((a) - (b)) > 0)) | ||
| 83 | #define codel_time_before(a, b) codel_time_after(b, a) | ||
| 84 | |||
| 85 | #define codel_time_after_eq(a, b) \ | ||
| 86 | (typecheck(codel_time_t, a) && \ | ||
| 87 | typecheck(codel_time_t, b) && \ | ||
| 88 | ((s32)((a) - (b)) >= 0)) | ||
| 89 | #define codel_time_before_eq(a, b) codel_time_after_eq(b, a) | ||
| 79 | 90 | ||
| 80 | /* Qdiscs using codel plugin must use codel_skb_cb in their own cb[] */ | 91 | /* Qdiscs using codel plugin must use codel_skb_cb in their own cb[] */ |
| 81 | struct codel_skb_cb { | 92 | struct codel_skb_cb { |
diff --git a/include/net/compat.h b/include/net/compat.h index 6e9565324989..3b603b199c01 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
| @@ -29,8 +29,8 @@ struct compat_cmsghdr { | |||
| 29 | compat_int_t cmsg_type; | 29 | compat_int_t cmsg_type; |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | 32 | int compat_sock_get_timestamp(struct sock *, struct timeval __user *); |
| 33 | extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); | 33 | int compat_sock_get_timestampns(struct sock *, struct timespec __user *); |
| 34 | 34 | ||
| 35 | #else /* defined(CONFIG_COMPAT) */ | 35 | #else /* defined(CONFIG_COMPAT) */ |
| 36 | /* | 36 | /* |
| @@ -40,24 +40,30 @@ extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); | |||
| 40 | #define compat_mmsghdr mmsghdr | 40 | #define compat_mmsghdr mmsghdr |
| 41 | #endif /* defined(CONFIG_COMPAT) */ | 41 | #endif /* defined(CONFIG_COMPAT) */ |
| 42 | 42 | ||
| 43 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); | 43 | int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); |
| 44 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr_storage *, int); | 44 | int verify_compat_iovec(struct msghdr *, struct iovec *, |
| 45 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned int); | 45 | struct sockaddr_storage *, int); |
| 46 | extern asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *, | 46 | asmlinkage long compat_sys_sendmsg(int, struct compat_msghdr __user *, |
| 47 | unsigned int, unsigned int); | 47 | unsigned int); |
| 48 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned int); | 48 | asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *, |
| 49 | extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, | 49 | unsigned int, unsigned int); |
| 50 | unsigned int, unsigned int, | 50 | asmlinkage long compat_sys_recvmsg(int, struct compat_msghdr __user *, |
| 51 | struct compat_timespec __user *); | 51 | unsigned int); |
| 52 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); | 52 | asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, |
| 53 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); | 53 | unsigned int, unsigned int, |
| 54 | 54 | struct compat_timespec __user *); | |
| 55 | extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int); | 55 | asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, |
| 56 | 56 | int __user *); | |
| 57 | extern int compat_mc_setsockopt(struct sock *, int, int, char __user *, unsigned int, | 57 | int put_cmsg_compat(struct msghdr*, int, int, int, void *); |
| 58 | int (*)(struct sock *, int, int, char __user *, unsigned int)); | 58 | |
| 59 | extern int compat_mc_getsockopt(struct sock *, int, int, char __user *, | 59 | int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, |
| 60 | int __user *, int (*)(struct sock *, int, int, char __user *, | 60 | unsigned char *, int); |
| 61 | int __user *)); | 61 | |
| 62 | int compat_mc_setsockopt(struct sock *, int, int, char __user *, unsigned int, | ||
| 63 | int (*)(struct sock *, int, int, char __user *, | ||
| 64 | unsigned int)); | ||
| 65 | int compat_mc_getsockopt(struct sock *, int, int, char __user *, int __user *, | ||
| 66 | int (*)(struct sock *, int, int, char __user *, | ||
| 67 | int __user *)); | ||
| 62 | 68 | ||
| 63 | #endif /* NET_COMPAT_H */ | 69 | #endif /* NET_COMPAT_H */ |
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h index 443626ed4cbc..d2f3041c0dfa 100644 --- a/include/net/dcbevent.h +++ b/include/net/dcbevent.h | |||
| @@ -25,9 +25,9 @@ enum dcbevent_notif_type { | |||
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | #ifdef CONFIG_DCB | 27 | #ifdef CONFIG_DCB |
| 28 | extern int register_dcbevent_notifier(struct notifier_block *nb); | 28 | int register_dcbevent_notifier(struct notifier_block *nb); |
| 29 | extern int unregister_dcbevent_notifier(struct notifier_block *nb); | 29 | int unregister_dcbevent_notifier(struct notifier_block *nb); |
| 30 | extern int call_dcbevent_notifiers(unsigned long val, void *v); | 30 | int call_dcbevent_notifiers(unsigned long val, void *v); |
| 31 | #else | 31 | #else |
| 32 | static inline int | 32 | static inline int |
| 33 | register_dcbevent_notifier(struct notifier_block *nb) | 33 | register_dcbevent_notifier(struct notifier_block *nb) |
diff --git a/include/net/dn.h b/include/net/dn.h index c88bf4ebd330..ccc15588d108 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
| @@ -199,24 +199,26 @@ static inline void dn_sk_ports_copy(struct flowidn *fld, struct dn_scp *scp) | |||
| 199 | fld->fld_dport = scp->addrrem; | 199 | fld->fld_dport = scp->addrrem; |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | extern unsigned int dn_mss_from_pmtu(struct net_device *dev, int mtu); | 202 | unsigned int dn_mss_from_pmtu(struct net_device *dev, int mtu); |
| 203 | 203 | ||
| 204 | #define DN_MENUVER_ACC 0x01 | 204 | #define DN_MENUVER_ACC 0x01 |
| 205 | #define DN_MENUVER_USR 0x02 | 205 | #define DN_MENUVER_USR 0x02 |
| 206 | #define DN_MENUVER_PRX 0x04 | 206 | #define DN_MENUVER_PRX 0x04 |
| 207 | #define DN_MENUVER_UIC 0x08 | 207 | #define DN_MENUVER_UIC 0x08 |
| 208 | 208 | ||
| 209 | extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); | 209 | struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); |
| 210 | extern struct sock *dn_find_by_skb(struct sk_buff *skb); | 210 | struct sock *dn_find_by_skb(struct sk_buff *skb); |
| 211 | #define DN_ASCBUF_LEN 9 | 211 | #define DN_ASCBUF_LEN 9 |
| 212 | extern char *dn_addr2asc(__u16, char *); | 212 | char *dn_addr2asc(__u16, char *); |
| 213 | extern int dn_destroy_timer(struct sock *sk); | 213 | int dn_destroy_timer(struct sock *sk); |
| 214 | 214 | ||
| 215 | extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type); | 215 | int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, |
| 216 | extern int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *addr, unsigned char *type); | 216 | unsigned char type); |
| 217 | int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *addr, | ||
| 218 | unsigned char *type); | ||
| 217 | 219 | ||
| 218 | extern void dn_start_slow_timer(struct sock *sk); | 220 | void dn_start_slow_timer(struct sock *sk); |
| 219 | extern void dn_stop_slow_timer(struct sock *sk); | 221 | void dn_stop_slow_timer(struct sock *sk); |
| 220 | 222 | ||
| 221 | extern __le16 decnet_address; | 223 | extern __le16 decnet_address; |
| 222 | extern int decnet_debug_level; | 224 | extern int decnet_debug_level; |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index b9e32db03f20..20b5ab06032d 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
| @@ -148,27 +148,27 @@ struct rtnode_hello_message { | |||
| 148 | } __packed; | 148 | } __packed; |
| 149 | 149 | ||
| 150 | 150 | ||
| 151 | extern void dn_dev_init(void); | 151 | void dn_dev_init(void); |
| 152 | extern void dn_dev_cleanup(void); | 152 | void dn_dev_cleanup(void); |
| 153 | 153 | ||
| 154 | extern int dn_dev_ioctl(unsigned int cmd, void __user *arg); | 154 | int dn_dev_ioctl(unsigned int cmd, void __user *arg); |
| 155 | 155 | ||
| 156 | extern void dn_dev_devices_off(void); | 156 | void dn_dev_devices_off(void); |
| 157 | extern void dn_dev_devices_on(void); | 157 | void dn_dev_devices_on(void); |
| 158 | 158 | ||
| 159 | extern void dn_dev_init_pkt(struct sk_buff *skb); | 159 | void dn_dev_init_pkt(struct sk_buff *skb); |
| 160 | extern void dn_dev_veri_pkt(struct sk_buff *skb); | 160 | void dn_dev_veri_pkt(struct sk_buff *skb); |
| 161 | extern void dn_dev_hello(struct sk_buff *skb); | 161 | void dn_dev_hello(struct sk_buff *skb); |
| 162 | 162 | ||
| 163 | extern void dn_dev_up(struct net_device *); | 163 | void dn_dev_up(struct net_device *); |
| 164 | extern void dn_dev_down(struct net_device *); | 164 | void dn_dev_down(struct net_device *); |
| 165 | 165 | ||
| 166 | extern int dn_dev_set_default(struct net_device *dev, int force); | 166 | int dn_dev_set_default(struct net_device *dev, int force); |
| 167 | extern struct net_device *dn_dev_get_default(void); | 167 | struct net_device *dn_dev_get_default(void); |
| 168 | extern int dn_dev_bind_default(__le16 *addr); | 168 | int dn_dev_bind_default(__le16 *addr); |
| 169 | 169 | ||
| 170 | extern int register_dnaddr_notifier(struct notifier_block *nb); | 170 | int register_dnaddr_notifier(struct notifier_block *nb); |
| 171 | extern int unregister_dnaddr_notifier(struct notifier_block *nb); | 171 | int unregister_dnaddr_notifier(struct notifier_block *nb); |
| 172 | 172 | ||
| 173 | static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) | 173 | static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) |
| 174 | { | 174 | { |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index 74004af31c48..f2ca135ddcc9 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
| @@ -95,41 +95,38 @@ struct dn_fib_table { | |||
| 95 | /* | 95 | /* |
| 96 | * dn_fib.c | 96 | * dn_fib.c |
| 97 | */ | 97 | */ |
| 98 | extern void dn_fib_init(void); | 98 | void dn_fib_init(void); |
| 99 | extern void dn_fib_cleanup(void); | 99 | void dn_fib_cleanup(void); |
| 100 | 100 | ||
| 101 | extern int dn_fib_ioctl(struct socket *sock, unsigned int cmd, | 101 | int dn_fib_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 102 | unsigned long arg); | 102 | struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, |
| 103 | extern struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, | 103 | struct nlattr *attrs[], |
| 104 | struct nlattr *attrs[], | 104 | const struct nlmsghdr *nlh, int *errp); |
| 105 | const struct nlmsghdr *nlh, int *errp); | 105 | int dn_fib_semantic_match(int type, struct dn_fib_info *fi, |
| 106 | extern int dn_fib_semantic_match(int type, struct dn_fib_info *fi, | 106 | const struct flowidn *fld, struct dn_fib_res *res); |
| 107 | const struct flowidn *fld, | 107 | void dn_fib_release_info(struct dn_fib_info *fi); |
| 108 | struct dn_fib_res *res); | 108 | void dn_fib_flush(void); |
| 109 | extern void dn_fib_release_info(struct dn_fib_info *fi); | 109 | void dn_fib_select_multipath(const struct flowidn *fld, struct dn_fib_res *res); |
| 110 | extern void dn_fib_flush(void); | ||
| 111 | extern void dn_fib_select_multipath(const struct flowidn *fld, | ||
| 112 | struct dn_fib_res *res); | ||
| 113 | 110 | ||
| 114 | /* | 111 | /* |
| 115 | * dn_tables.c | 112 | * dn_tables.c |
| 116 | */ | 113 | */ |
| 117 | extern struct dn_fib_table *dn_fib_get_table(u32 n, int creat); | 114 | struct dn_fib_table *dn_fib_get_table(u32 n, int creat); |
| 118 | extern struct dn_fib_table *dn_fib_empty_table(void); | 115 | struct dn_fib_table *dn_fib_empty_table(void); |
| 119 | extern void dn_fib_table_init(void); | 116 | void dn_fib_table_init(void); |
| 120 | extern void dn_fib_table_cleanup(void); | 117 | void dn_fib_table_cleanup(void); |
| 121 | 118 | ||
| 122 | /* | 119 | /* |
| 123 | * dn_rules.c | 120 | * dn_rules.c |
| 124 | */ | 121 | */ |
| 125 | extern void dn_fib_rules_init(void); | 122 | void dn_fib_rules_init(void); |
| 126 | extern void dn_fib_rules_cleanup(void); | 123 | void dn_fib_rules_cleanup(void); |
| 127 | extern unsigned int dnet_addr_type(__le16 addr); | 124 | unsigned int dnet_addr_type(__le16 addr); |
| 128 | extern int dn_fib_lookup(struct flowidn *fld, struct dn_fib_res *res); | 125 | int dn_fib_lookup(struct flowidn *fld, struct dn_fib_res *res); |
| 129 | 126 | ||
| 130 | extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb); | 127 | int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb); |
| 131 | 128 | ||
| 132 | extern void dn_fib_free_info(struct dn_fib_info *fi); | 129 | void dn_fib_free_info(struct dn_fib_info *fi); |
| 133 | 130 | ||
| 134 | static inline void dn_fib_info_put(struct dn_fib_info *fi) | 131 | static inline void dn_fib_info_put(struct dn_fib_info *fi) |
| 135 | { | 132 | { |
diff --git a/include/net/dn_neigh.h b/include/net/dn_neigh.h index 4cb4ae7fb81f..fac4e3f4a6d3 100644 --- a/include/net/dn_neigh.h +++ b/include/net/dn_neigh.h | |||
| @@ -16,12 +16,12 @@ struct dn_neigh { | |||
| 16 | __u8 priority; | 16 | __u8 priority; |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | extern void dn_neigh_init(void); | 19 | void dn_neigh_init(void); |
| 20 | extern void dn_neigh_cleanup(void); | 20 | void dn_neigh_cleanup(void); |
| 21 | extern int dn_neigh_router_hello(struct sk_buff *skb); | 21 | int dn_neigh_router_hello(struct sk_buff *skb); |
| 22 | extern int dn_neigh_endnode_hello(struct sk_buff *skb); | 22 | int dn_neigh_endnode_hello(struct sk_buff *skb); |
| 23 | extern void dn_neigh_pointopoint_hello(struct sk_buff *skb); | 23 | void dn_neigh_pointopoint_hello(struct sk_buff *skb); |
| 24 | extern int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n); | 24 | int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n); |
| 25 | 25 | ||
| 26 | extern struct neigh_table dn_neigh_table; | 26 | extern struct neigh_table dn_neigh_table; |
| 27 | 27 | ||
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h index e43a2893f132..3a3e33d18456 100644 --- a/include/net/dn_nsp.h +++ b/include/net/dn_nsp.h | |||
| @@ -15,29 +15,32 @@ | |||
| 15 | *******************************************************************************/ | 15 | *******************************************************************************/ |
| 16 | /* dn_nsp.c functions prototyping */ | 16 | /* dn_nsp.c functions prototyping */ |
| 17 | 17 | ||
| 18 | extern void dn_nsp_send_data_ack(struct sock *sk); | 18 | void dn_nsp_send_data_ack(struct sock *sk); |
| 19 | extern void dn_nsp_send_oth_ack(struct sock *sk); | 19 | void dn_nsp_send_oth_ack(struct sock *sk); |
| 20 | extern void dn_nsp_delayed_ack(struct sock *sk); | 20 | void dn_nsp_delayed_ack(struct sock *sk); |
| 21 | extern void dn_send_conn_ack(struct sock *sk); | 21 | void dn_send_conn_ack(struct sock *sk); |
| 22 | extern void dn_send_conn_conf(struct sock *sk, gfp_t gfp); | 22 | void dn_send_conn_conf(struct sock *sk, gfp_t gfp); |
| 23 | extern void dn_nsp_send_disc(struct sock *sk, unsigned char type, | 23 | void dn_nsp_send_disc(struct sock *sk, unsigned char type, |
| 24 | unsigned short reason, gfp_t gfp); | 24 | unsigned short reason, gfp_t gfp); |
| 25 | extern void dn_nsp_return_disc(struct sk_buff *skb, unsigned char type, | 25 | void dn_nsp_return_disc(struct sk_buff *skb, unsigned char type, |
| 26 | unsigned short reason); | 26 | unsigned short reason); |
| 27 | extern void dn_nsp_send_link(struct sock *sk, unsigned char lsflags, char fcval); | 27 | void dn_nsp_send_link(struct sock *sk, unsigned char lsflags, char fcval); |
| 28 | extern void dn_nsp_send_conninit(struct sock *sk, unsigned char flags); | 28 | void dn_nsp_send_conninit(struct sock *sk, unsigned char flags); |
| 29 | 29 | ||
| 30 | extern void dn_nsp_output(struct sock *sk); | 30 | void dn_nsp_output(struct sock *sk); |
| 31 | extern int dn_nsp_check_xmit_queue(struct sock *sk, struct sk_buff *skb, struct sk_buff_head *q, unsigned short acknum); | 31 | int dn_nsp_check_xmit_queue(struct sock *sk, struct sk_buff *skb, |
| 32 | extern void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, gfp_t gfp, int oob); | 32 | struct sk_buff_head *q, unsigned short acknum); |
| 33 | extern unsigned long dn_nsp_persist(struct sock *sk); | 33 | void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, gfp_t gfp, |
| 34 | extern int dn_nsp_xmit_timeout(struct sock *sk); | 34 | int oob); |
| 35 | 35 | unsigned long dn_nsp_persist(struct sock *sk); | |
| 36 | extern int dn_nsp_rx(struct sk_buff *); | 36 | int dn_nsp_xmit_timeout(struct sock *sk); |
| 37 | extern int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb); | 37 | |
| 38 | 38 | int dn_nsp_rx(struct sk_buff *); | |
| 39 | extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri); | 39 | int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb); |
| 40 | extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, long timeo, int *err); | 40 | |
| 41 | struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri); | ||
| 42 | struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, | ||
| 43 | long timeo, int *err); | ||
| 41 | 44 | ||
| 42 | #define NSP_REASON_OK 0 /* No error */ | 45 | #define NSP_REASON_OK 0 /* No error */ |
| 43 | #define NSP_REASON_NR 1 /* No resources */ | 46 | #define NSP_REASON_NR 1 /* No resources */ |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 2e9d317c82dc..b409ad6b8d7a 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
| @@ -15,10 +15,11 @@ | |||
| 15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
| 16 | *******************************************************************************/ | 16 | *******************************************************************************/ |
| 17 | 17 | ||
| 18 | extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri); | 18 | struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri); |
| 19 | extern int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *, struct sock *sk, int flags); | 19 | int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *, |
| 20 | extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb); | 20 | struct sock *sk, int flags); |
| 21 | extern void dn_rt_cache_flush(int delay); | 21 | int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb); |
| 22 | void dn_rt_cache_flush(int delay); | ||
| 22 | 23 | ||
| 23 | /* Masks for flags field */ | 24 | /* Masks for flags field */ |
| 24 | #define DN_RT_F_PID 0x07 /* Mask for packet type */ | 25 | #define DN_RT_F_PID 0x07 /* Mask for packet type */ |
| @@ -92,8 +93,8 @@ static inline bool dn_is_output_route(struct dn_route *rt) | |||
| 92 | return rt->fld.flowidn_iif == 0; | 93 | return rt->fld.flowidn_iif == 0; |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 95 | extern void dn_route_init(void); | 96 | void dn_route_init(void); |
| 96 | extern void dn_route_cleanup(void); | 97 | void dn_route_cleanup(void); |
| 97 | 98 | ||
| 98 | #include <net/sock.h> | 99 | #include <net/sock.h> |
| 99 | #include <linux/if_arp.h> | 100 | #include <linux/if_arp.h> |
diff --git a/include/net/dst.h b/include/net/dst.h index 3c4c944096c9..44995c13e941 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -106,7 +106,7 @@ struct dst_entry { | |||
| 106 | }; | 106 | }; |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); | 109 | u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); |
| 110 | extern const u32 dst_default_metrics[]; | 110 | extern const u32 dst_default_metrics[]; |
| 111 | 111 | ||
| 112 | #define DST_METRICS_READ_ONLY 0x1UL | 112 | #define DST_METRICS_READ_ONLY 0x1UL |
| @@ -119,7 +119,7 @@ static inline bool dst_metrics_read_only(const struct dst_entry *dst) | |||
| 119 | return dst->_metrics & DST_METRICS_READ_ONLY; | 119 | return dst->_metrics & DST_METRICS_READ_ONLY; |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | extern void __dst_destroy_metrics_generic(struct dst_entry *dst, unsigned long old); | 122 | void __dst_destroy_metrics_generic(struct dst_entry *dst, unsigned long old); |
| 123 | 123 | ||
| 124 | static inline void dst_destroy_metrics_generic(struct dst_entry *dst) | 124 | static inline void dst_destroy_metrics_generic(struct dst_entry *dst) |
| 125 | { | 125 | { |
| @@ -262,7 +262,7 @@ static inline struct dst_entry *dst_clone(struct dst_entry *dst) | |||
| 262 | return dst; | 262 | return dst; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | extern void dst_release(struct dst_entry *dst); | 265 | void dst_release(struct dst_entry *dst); |
| 266 | 266 | ||
| 267 | static inline void refdst_drop(unsigned long refdst) | 267 | static inline void refdst_drop(unsigned long refdst) |
| 268 | { | 268 | { |
| @@ -362,12 +362,11 @@ static inline struct dst_entry *skb_dst_pop(struct sk_buff *skb) | |||
| 362 | return child; | 362 | return child; |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | extern int dst_discard(struct sk_buff *skb); | 365 | int dst_discard(struct sk_buff *skb); |
| 366 | extern void *dst_alloc(struct dst_ops *ops, struct net_device *dev, | 366 | void *dst_alloc(struct dst_ops *ops, struct net_device *dev, int initial_ref, |
| 367 | int initial_ref, int initial_obsolete, | 367 | int initial_obsolete, unsigned short flags); |
| 368 | unsigned short flags); | 368 | void __dst_free(struct dst_entry *dst); |
| 369 | extern void __dst_free(struct dst_entry *dst); | 369 | struct dst_entry *dst_destroy(struct dst_entry *dst); |
| 370 | extern struct dst_entry *dst_destroy(struct dst_entry *dst); | ||
| 371 | 370 | ||
| 372 | static inline void dst_free(struct dst_entry *dst) | 371 | static inline void dst_free(struct dst_entry *dst) |
| 373 | { | 372 | { |
| @@ -463,7 +462,7 @@ static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie) | |||
| 463 | return dst; | 462 | return dst; |
| 464 | } | 463 | } |
| 465 | 464 | ||
| 466 | extern void dst_init(void); | 465 | void dst_init(void); |
| 467 | 466 | ||
| 468 | /* Flags for xfrm_lookup flags argument. */ | 467 | /* Flags for xfrm_lookup flags argument. */ |
| 469 | enum { | 468 | enum { |
| @@ -486,9 +485,9 @@ static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | |||
| 486 | } | 485 | } |
| 487 | 486 | ||
| 488 | #else | 487 | #else |
| 489 | extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | 488 | struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, |
| 490 | const struct flowi *fl, struct sock *sk, | 489 | const struct flowi *fl, struct sock *sk, |
| 491 | int flags); | 490 | int flags); |
| 492 | 491 | ||
| 493 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ | 492 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ |
| 494 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | 493 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) |
diff --git a/include/net/esp.h b/include/net/esp.h index d58451331dbd..a43be85aedc4 100644 --- a/include/net/esp.h +++ b/include/net/esp.h | |||
| @@ -3,18 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/skbuff.h> | 4 | #include <linux/skbuff.h> |
| 5 | 5 | ||
| 6 | struct crypto_aead; | ||
| 7 | |||
| 8 | struct esp_data { | ||
| 9 | /* 0..255 */ | ||
| 10 | int padlen; | ||
| 11 | |||
| 12 | /* Confidentiality & Integrity */ | ||
| 13 | struct crypto_aead *aead; | ||
| 14 | }; | ||
| 15 | |||
| 16 | extern void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len); | ||
| 17 | |||
| 18 | struct ip_esp_hdr; | 6 | struct ip_esp_hdr; |
| 19 | 7 | ||
| 20 | static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb) | 8 | static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb) |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 4b2b557fb0e8..e584de16e4c3 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
| @@ -115,14 +115,13 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
| 115 | return frh->table; | 115 | return frh->table; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *); | 118 | struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, |
| 119 | extern void fib_rules_unregister(struct fib_rules_ops *); | 119 | struct net *); |
| 120 | void fib_rules_unregister(struct fib_rules_ops *); | ||
| 120 | 121 | ||
| 121 | extern int fib_rules_lookup(struct fib_rules_ops *, | 122 | int fib_rules_lookup(struct fib_rules_ops *, struct flowi *, int flags, |
| 122 | struct flowi *, int flags, | 123 | struct fib_lookup_arg *); |
| 123 | struct fib_lookup_arg *); | 124 | int fib_default_rule_add(struct fib_rules_ops *, u32 pref, u32 table, |
| 124 | extern int fib_default_rule_add(struct fib_rules_ops *, | 125 | u32 flags); |
| 125 | u32 pref, u32 table, | 126 | u32 fib_default_rule_pref(struct fib_rules_ops *ops); |
| 126 | u32 flags); | ||
| 127 | extern u32 fib_default_rule_pref(struct fib_rules_ops *ops); | ||
| 128 | #endif | 127 | #endif |
diff --git a/include/net/flow.h b/include/net/flow.h index 628e11b98c58..65ce471d2ab5 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -215,12 +215,13 @@ typedef struct flow_cache_object *(*flow_resolve_t)( | |||
| 215 | struct net *net, const struct flowi *key, u16 family, | 215 | struct net *net, const struct flowi *key, u16 family, |
| 216 | u8 dir, struct flow_cache_object *oldobj, void *ctx); | 216 | u8 dir, struct flow_cache_object *oldobj, void *ctx); |
| 217 | 217 | ||
| 218 | extern struct flow_cache_object *flow_cache_lookup( | 218 | struct flow_cache_object *flow_cache_lookup(struct net *net, |
| 219 | struct net *net, const struct flowi *key, u16 family, | 219 | const struct flowi *key, u16 family, |
| 220 | u8 dir, flow_resolve_t resolver, void *ctx); | 220 | u8 dir, flow_resolve_t resolver, |
| 221 | void *ctx); | ||
| 221 | 222 | ||
| 222 | extern void flow_cache_flush(void); | 223 | void flow_cache_flush(void); |
| 223 | extern void flow_cache_flush_deferred(void); | 224 | void flow_cache_flush_deferred(void); |
| 224 | extern atomic_t flow_cache_genid; | 225 | extern atomic_t flow_cache_genid; |
| 225 | 226 | ||
| 226 | #endif | 227 | #endif |
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h index bb8271d487b7..7e64bd8bbda9 100644 --- a/include/net/flow_keys.h +++ b/include/net/flow_keys.h | |||
| @@ -13,5 +13,6 @@ struct flow_keys { | |||
| 13 | u8 ip_proto; | 13 | u8 ip_proto; |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | extern bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow); | 16 | bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow); |
| 17 | __be32 skb_flow_get_ports(const struct sk_buff *skb, int thoff, u8 ip_proto); | ||
| 17 | #endif | 18 | #endif |
diff --git a/include/net/garp.h b/include/net/garp.h index 834d8add9e5f..abf33bbd2e6a 100644 --- a/include/net/garp.h +++ b/include/net/garp.h | |||
| @@ -112,19 +112,18 @@ struct garp_port { | |||
| 112 | struct rcu_head rcu; | 112 | struct rcu_head rcu; |
| 113 | }; | 113 | }; |
| 114 | 114 | ||
| 115 | extern int garp_register_application(struct garp_application *app); | 115 | int garp_register_application(struct garp_application *app); |
| 116 | extern void garp_unregister_application(struct garp_application *app); | 116 | void garp_unregister_application(struct garp_application *app); |
| 117 | 117 | ||
| 118 | extern int garp_init_applicant(struct net_device *dev, | 118 | int garp_init_applicant(struct net_device *dev, struct garp_application *app); |
| 119 | struct garp_application *app); | 119 | void garp_uninit_applicant(struct net_device *dev, |
| 120 | extern void garp_uninit_applicant(struct net_device *dev, | 120 | struct garp_application *app); |
| 121 | struct garp_application *app); | 121 | |
| 122 | 122 | int garp_request_join(const struct net_device *dev, | |
| 123 | extern int garp_request_join(const struct net_device *dev, | 123 | const struct garp_application *app, const void *data, |
| 124 | const struct garp_application *app, | 124 | u8 len, u8 type); |
| 125 | const void *data, u8 len, u8 type); | 125 | void garp_request_leave(const struct net_device *dev, |
| 126 | extern void garp_request_leave(const struct net_device *dev, | 126 | const struct garp_application *app, |
| 127 | const struct garp_application *app, | 127 | const void *data, u8 len, u8 type); |
| 128 | const void *data, u8 len, u8 type); | ||
| 129 | 128 | ||
| 130 | #endif /* _NET_GARP_H */ | 129 | #endif /* _NET_GARP_H */ |
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index cf8439ba4d11..ea4271dceff0 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h | |||
| @@ -19,32 +19,31 @@ struct gnet_dump { | |||
| 19 | struct tc_stats tc_stats; | 19 | struct tc_stats tc_stats; |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | extern int gnet_stats_start_copy(struct sk_buff *skb, int type, | 22 | int gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock, |
| 23 | struct gnet_dump *d); | ||
| 24 | |||
| 25 | int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, | ||
| 26 | int tc_stats_type, int xstats_type, | ||
| 23 | spinlock_t *lock, struct gnet_dump *d); | 27 | spinlock_t *lock, struct gnet_dump *d); |
| 24 | 28 | ||
| 25 | extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, | 29 | int gnet_stats_copy_basic(struct gnet_dump *d, |
| 26 | int tc_stats_type,int xstats_type, | 30 | struct gnet_stats_basic_packed *b); |
| 27 | spinlock_t *lock, struct gnet_dump *d); | 31 | int gnet_stats_copy_rate_est(struct gnet_dump *d, |
| 28 | 32 | const struct gnet_stats_basic_packed *b, | |
| 29 | extern int gnet_stats_copy_basic(struct gnet_dump *d, | 33 | struct gnet_stats_rate_est64 *r); |
| 30 | struct gnet_stats_basic_packed *b); | 34 | int gnet_stats_copy_queue(struct gnet_dump *d, struct gnet_stats_queue *q); |
| 31 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, | 35 | int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); |
| 32 | const struct gnet_stats_basic_packed *b, | 36 | |
| 33 | struct gnet_stats_rate_est64 *r); | 37 | int gnet_stats_finish_copy(struct gnet_dump *d); |
| 34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, | 38 | |
| 35 | struct gnet_stats_queue *q); | 39 | int gen_new_estimator(struct gnet_stats_basic_packed *bstats, |
| 36 | extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); | 40 | struct gnet_stats_rate_est64 *rate_est, |
| 37 | 41 | spinlock_t *stats_lock, struct nlattr *opt); | |
| 38 | extern int gnet_stats_finish_copy(struct gnet_dump *d); | 42 | void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, |
| 39 | 43 | struct gnet_stats_rate_est64 *rate_est); | |
| 40 | extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats, | 44 | int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, |
| 41 | struct gnet_stats_rate_est64 *rate_est, | 45 | struct gnet_stats_rate_est64 *rate_est, |
| 42 | spinlock_t *stats_lock, struct nlattr *opt); | 46 | spinlock_t *stats_lock, struct nlattr *opt); |
| 43 | extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, | 47 | bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, |
| 44 | struct gnet_stats_rate_est64 *rate_est); | 48 | const struct gnet_stats_rate_est64 *rate_est); |
| 45 | extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, | ||
| 46 | struct gnet_stats_rate_est64 *rate_est, | ||
| 47 | spinlock_t *stats_lock, struct nlattr *opt); | ||
| 48 | extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, | ||
| 49 | const struct gnet_stats_rate_est64 *rate_est); | ||
| 50 | #endif | 49 | #endif |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 8e0b6c856a13..1b177ed803b7 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -10,16 +10,9 @@ | |||
| 10 | /** | 10 | /** |
| 11 | * struct genl_multicast_group - generic netlink multicast group | 11 | * struct genl_multicast_group - generic netlink multicast group |
| 12 | * @name: name of the multicast group, names are per-family | 12 | * @name: name of the multicast group, names are per-family |
| 13 | * @id: multicast group ID, assigned by the core, to use with | ||
| 14 | * genlmsg_multicast(). | ||
| 15 | * @list: list entry for linking | ||
| 16 | * @family: pointer to family, need not be set before registering | ||
| 17 | */ | 13 | */ |
| 18 | struct genl_multicast_group { | 14 | struct genl_multicast_group { |
| 19 | struct genl_family *family; /* private */ | ||
| 20 | struct list_head list; /* private */ | ||
| 21 | char name[GENL_NAMSIZ]; | 15 | char name[GENL_NAMSIZ]; |
| 22 | u32 id; | ||
| 23 | }; | 16 | }; |
| 24 | 17 | ||
| 25 | struct genl_ops; | 18 | struct genl_ops; |
| @@ -39,9 +32,12 @@ struct genl_info; | |||
| 39 | * @post_doit: called after an operation's doit callback, it may | 32 | * @post_doit: called after an operation's doit callback, it may |
| 40 | * undo operations done by pre_doit, for example release locks | 33 | * undo operations done by pre_doit, for example release locks |
| 41 | * @attrbuf: buffer to store parsed attributes | 34 | * @attrbuf: buffer to store parsed attributes |
| 42 | * @ops_list: list of all assigned operations | ||
| 43 | * @family_list: family list | 35 | * @family_list: family list |
| 44 | * @mcast_groups: multicast groups list | 36 | * @mcgrps: multicast groups used by this family (private) |
| 37 | * @n_mcgrps: number of multicast groups (private) | ||
| 38 | * @mcgrp_offset: starting number of multicast group IDs in this family | ||
| 39 | * @ops: the operations supported by this family (private) | ||
| 40 | * @n_ops: number of operations supported by this family (private) | ||
| 45 | */ | 41 | */ |
| 46 | struct genl_family { | 42 | struct genl_family { |
| 47 | unsigned int id; | 43 | unsigned int id; |
| @@ -51,16 +47,19 @@ struct genl_family { | |||
| 51 | unsigned int maxattr; | 47 | unsigned int maxattr; |
| 52 | bool netnsok; | 48 | bool netnsok; |
| 53 | bool parallel_ops; | 49 | bool parallel_ops; |
| 54 | int (*pre_doit)(struct genl_ops *ops, | 50 | int (*pre_doit)(const struct genl_ops *ops, |
| 55 | struct sk_buff *skb, | 51 | struct sk_buff *skb, |
| 56 | struct genl_info *info); | 52 | struct genl_info *info); |
| 57 | void (*post_doit)(struct genl_ops *ops, | 53 | void (*post_doit)(const struct genl_ops *ops, |
| 58 | struct sk_buff *skb, | 54 | struct sk_buff *skb, |
| 59 | struct genl_info *info); | 55 | struct genl_info *info); |
| 60 | struct nlattr ** attrbuf; /* private */ | 56 | struct nlattr ** attrbuf; /* private */ |
| 61 | struct list_head ops_list; /* private */ | 57 | const struct genl_ops * ops; /* private */ |
| 58 | const struct genl_multicast_group *mcgrps; /* private */ | ||
| 59 | unsigned int n_ops; /* private */ | ||
| 60 | unsigned int n_mcgrps; /* private */ | ||
| 61 | unsigned int mcgrp_offset; /* private */ | ||
| 62 | struct list_head family_list; /* private */ | 62 | struct list_head family_list; /* private */ |
| 63 | struct list_head mcast_groups; /* private */ | ||
| 64 | struct module *module; | 63 | struct module *module; |
| 65 | }; | 64 | }; |
| 66 | 65 | ||
| @@ -110,19 +109,18 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) | |||
| 110 | * @ops_list: operations list | 109 | * @ops_list: operations list |
| 111 | */ | 110 | */ |
| 112 | struct genl_ops { | 111 | struct genl_ops { |
| 113 | u8 cmd; | ||
| 114 | u8 internal_flags; | ||
| 115 | unsigned int flags; | ||
| 116 | const struct nla_policy *policy; | 112 | const struct nla_policy *policy; |
| 117 | int (*doit)(struct sk_buff *skb, | 113 | int (*doit)(struct sk_buff *skb, |
| 118 | struct genl_info *info); | 114 | struct genl_info *info); |
| 119 | int (*dumpit)(struct sk_buff *skb, | 115 | int (*dumpit)(struct sk_buff *skb, |
| 120 | struct netlink_callback *cb); | 116 | struct netlink_callback *cb); |
| 121 | int (*done)(struct netlink_callback *cb); | 117 | int (*done)(struct netlink_callback *cb); |
| 122 | struct list_head ops_list; | 118 | u8 cmd; |
| 119 | u8 internal_flags; | ||
| 120 | u8 flags; | ||
| 123 | }; | 121 | }; |
| 124 | 122 | ||
| 125 | extern int __genl_register_family(struct genl_family *family); | 123 | int __genl_register_family(struct genl_family *family); |
| 126 | 124 | ||
| 127 | static inline int genl_register_family(struct genl_family *family) | 125 | static inline int genl_register_family(struct genl_family *family) |
| 128 | { | 126 | { |
| @@ -130,28 +128,57 @@ static inline int genl_register_family(struct genl_family *family) | |||
| 130 | return __genl_register_family(family); | 128 | return __genl_register_family(family); |
| 131 | } | 129 | } |
| 132 | 130 | ||
| 133 | extern int __genl_register_family_with_ops(struct genl_family *family, | 131 | /** |
| 134 | struct genl_ops *ops, size_t n_ops); | 132 | * genl_register_family_with_ops - register a generic netlink family with ops |
| 135 | 133 | * @family: generic netlink family | |
| 136 | static inline int genl_register_family_with_ops(struct genl_family *family, | 134 | * @ops: operations to be registered |
| 137 | struct genl_ops *ops, size_t n_ops) | 135 | * @n_ops: number of elements to register |
| 136 | * | ||
| 137 | * Registers the specified family and operations from the specified table. | ||
| 138 | * Only one family may be registered with the same family name or identifier. | ||
| 139 | * | ||
| 140 | * The family id may equal GENL_ID_GENERATE causing an unique id to | ||
| 141 | * be automatically generated and assigned. | ||
| 142 | * | ||
| 143 | * Either a doit or dumpit callback must be specified for every registered | ||
| 144 | * operation or the function will fail. Only one operation structure per | ||
| 145 | * command identifier may be registered. | ||
| 146 | * | ||
| 147 | * See include/net/genetlink.h for more documenation on the operations | ||
| 148 | * structure. | ||
| 149 | * | ||
| 150 | * Return 0 on success or a negative error code. | ||
| 151 | */ | ||
| 152 | static inline int | ||
| 153 | _genl_register_family_with_ops_grps(struct genl_family *family, | ||
| 154 | const struct genl_ops *ops, size_t n_ops, | ||
| 155 | const struct genl_multicast_group *mcgrps, | ||
| 156 | size_t n_mcgrps) | ||
| 138 | { | 157 | { |
| 139 | family->module = THIS_MODULE; | 158 | family->module = THIS_MODULE; |
| 140 | return __genl_register_family_with_ops(family, ops, n_ops); | 159 | family->ops = ops; |
| 160 | family->n_ops = n_ops; | ||
| 161 | family->mcgrps = mcgrps; | ||
| 162 | family->n_mcgrps = n_mcgrps; | ||
| 163 | return __genl_register_family(family); | ||
| 141 | } | 164 | } |
| 142 | 165 | ||
| 143 | extern int genl_unregister_family(struct genl_family *family); | 166 | #define genl_register_family_with_ops(family, ops) \ |
| 144 | extern int genl_register_ops(struct genl_family *, struct genl_ops *ops); | 167 | _genl_register_family_with_ops_grps((family), \ |
| 145 | extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops); | 168 | (ops), ARRAY_SIZE(ops), \ |
| 146 | extern int genl_register_mc_group(struct genl_family *family, | 169 | NULL, 0) |
| 147 | struct genl_multicast_group *grp); | 170 | #define genl_register_family_with_ops_groups(family, ops, grps) \ |
| 148 | extern void genl_unregister_mc_group(struct genl_family *family, | 171 | _genl_register_family_with_ops_grps((family), \ |
| 149 | struct genl_multicast_group *grp); | 172 | (ops), ARRAY_SIZE(ops), \ |
| 150 | extern void genl_notify(struct sk_buff *skb, struct net *net, u32 portid, | 173 | (grps), ARRAY_SIZE(grps)) |
| 151 | u32 group, struct nlmsghdr *nlh, gfp_t flags); | 174 | |
| 175 | int genl_unregister_family(struct genl_family *family); | ||
| 176 | void genl_notify(struct genl_family *family, | ||
| 177 | struct sk_buff *skb, struct net *net, u32 portid, | ||
| 178 | u32 group, struct nlmsghdr *nlh, gfp_t flags); | ||
| 152 | 179 | ||
| 153 | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, | 180 | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, |
| 154 | struct genl_family *family, int flags, u8 cmd); | 181 | struct genl_family *family, int flags, u8 cmd); |
| 155 | 182 | ||
| 156 | /** | 183 | /** |
| 157 | * genlmsg_nlhdr - Obtain netlink header from user specified header | 184 | * genlmsg_nlhdr - Obtain netlink header from user specified header |
| @@ -227,41 +254,51 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) | |||
| 227 | 254 | ||
| 228 | /** | 255 | /** |
| 229 | * genlmsg_multicast_netns - multicast a netlink message to a specific netns | 256 | * genlmsg_multicast_netns - multicast a netlink message to a specific netns |
| 257 | * @family: the generic netlink family | ||
| 230 | * @net: the net namespace | 258 | * @net: the net namespace |
| 231 | * @skb: netlink message as socket buffer | 259 | * @skb: netlink message as socket buffer |
| 232 | * @portid: own netlink portid to avoid sending to yourself | 260 | * @portid: own netlink portid to avoid sending to yourself |
| 233 | * @group: multicast group id | 261 | * @group: offset of multicast group in groups array |
| 234 | * @flags: allocation flags | 262 | * @flags: allocation flags |
| 235 | */ | 263 | */ |
| 236 | static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb, | 264 | static inline int genlmsg_multicast_netns(struct genl_family *family, |
| 265 | struct net *net, struct sk_buff *skb, | ||
| 237 | u32 portid, unsigned int group, gfp_t flags) | 266 | u32 portid, unsigned int group, gfp_t flags) |
| 238 | { | 267 | { |
| 268 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) | ||
| 269 | return -EINVAL; | ||
| 270 | group = family->mcgrp_offset + group; | ||
| 239 | return nlmsg_multicast(net->genl_sock, skb, portid, group, flags); | 271 | return nlmsg_multicast(net->genl_sock, skb, portid, group, flags); |
| 240 | } | 272 | } |
| 241 | 273 | ||
| 242 | /** | 274 | /** |
| 243 | * genlmsg_multicast - multicast a netlink message to the default netns | 275 | * genlmsg_multicast - multicast a netlink message to the default netns |
| 276 | * @family: the generic netlink family | ||
| 244 | * @skb: netlink message as socket buffer | 277 | * @skb: netlink message as socket buffer |
| 245 | * @portid: own netlink portid to avoid sending to yourself | 278 | * @portid: own netlink portid to avoid sending to yourself |
| 246 | * @group: multicast group id | 279 | * @group: offset of multicast group in groups array |
| 247 | * @flags: allocation flags | 280 | * @flags: allocation flags |
| 248 | */ | 281 | */ |
| 249 | static inline int genlmsg_multicast(struct sk_buff *skb, u32 portid, | 282 | static inline int genlmsg_multicast(struct genl_family *family, |
| 283 | struct sk_buff *skb, u32 portid, | ||
| 250 | unsigned int group, gfp_t flags) | 284 | unsigned int group, gfp_t flags) |
| 251 | { | 285 | { |
| 252 | return genlmsg_multicast_netns(&init_net, skb, portid, group, flags); | 286 | return genlmsg_multicast_netns(family, &init_net, skb, |
| 287 | portid, group, flags); | ||
| 253 | } | 288 | } |
| 254 | 289 | ||
| 255 | /** | 290 | /** |
| 256 | * genlmsg_multicast_allns - multicast a netlink message to all net namespaces | 291 | * genlmsg_multicast_allns - multicast a netlink message to all net namespaces |
| 292 | * @family: the generic netlink family | ||
| 257 | * @skb: netlink message as socket buffer | 293 | * @skb: netlink message as socket buffer |
| 258 | * @portid: own netlink portid to avoid sending to yourself | 294 | * @portid: own netlink portid to avoid sending to yourself |
| 259 | * @group: multicast group id | 295 | * @group: offset of multicast group in groups array |
| 260 | * @flags: allocation flags | 296 | * @flags: allocation flags |
| 261 | * | 297 | * |
| 262 | * This function must hold the RTNL or rcu_read_lock(). | 298 | * This function must hold the RTNL or rcu_read_lock(). |
| 263 | */ | 299 | */ |
| 264 | int genlmsg_multicast_allns(struct sk_buff *skb, u32 portid, | 300 | int genlmsg_multicast_allns(struct genl_family *family, |
| 301 | struct sk_buff *skb, u32 portid, | ||
| 265 | unsigned int group, gfp_t flags); | 302 | unsigned int group, gfp_t flags); |
| 266 | 303 | ||
| 267 | /** | 304 | /** |
| @@ -332,5 +369,25 @@ static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags) | |||
| 332 | return nlmsg_new(genlmsg_total_size(payload), flags); | 369 | return nlmsg_new(genlmsg_total_size(payload), flags); |
| 333 | } | 370 | } |
| 334 | 371 | ||
| 372 | /** | ||
| 373 | * genl_set_err - report error to genetlink broadcast listeners | ||
| 374 | * @family: the generic netlink family | ||
| 375 | * @net: the network namespace to report the error to | ||
| 376 | * @portid: the PORTID of a process that we want to skip (if any) | ||
| 377 | * @group: the broadcast group that will notice the error | ||
| 378 | * (this is the offset of the multicast group in the groups array) | ||
| 379 | * @code: error code, must be negative (as usual in kernelspace) | ||
| 380 | * | ||
| 381 | * This function returns the number of broadcast listeners that have set the | ||
| 382 | * NETLINK_RECV_NO_ENOBUFS socket option. | ||
| 383 | */ | ||
| 384 | static inline int genl_set_err(struct genl_family *family, struct net *net, | ||
| 385 | u32 portid, u32 group, int code) | ||
| 386 | { | ||
| 387 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) | ||
| 388 | return -EINVAL; | ||
| 389 | group = family->mcgrp_offset + group; | ||
| 390 | return netlink_set_err(net->genl_sock, portid, group, code); | ||
| 391 | } | ||
| 335 | 392 | ||
| 336 | #endif /* __NET_GENERIC_NETLINK_H */ | 393 | #endif /* __NET_GENERIC_NETLINK_H */ |
diff --git a/include/net/gre.h b/include/net/gre.h index 57e4afdf7879..dcd9ae3270d3 100644 --- a/include/net/gre.h +++ b/include/net/gre.h | |||
| @@ -38,7 +38,13 @@ void gre_offload_exit(void); | |||
| 38 | 38 | ||
| 39 | void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, | 39 | void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, |
| 40 | int hdr_len); | 40 | int hdr_len); |
| 41 | struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum); | 41 | |
| 42 | static inline struct sk_buff *gre_handle_offloads(struct sk_buff *skb, | ||
| 43 | bool gre_csum) | ||
| 44 | { | ||
| 45 | return iptunnel_handle_offloads(skb, gre_csum, SKB_GSO_GRE); | ||
| 46 | } | ||
| 47 | |||
| 42 | 48 | ||
| 43 | static inline int ip_gre_calc_hlen(__be16 o_flags) | 49 | static inline int ip_gre_calc_hlen(__be16 o_flags) |
| 44 | { | 50 | { |
diff --git a/include/net/icmp.h b/include/net/icmp.h index 081439fd070e..970028e13382 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h | |||
| @@ -39,10 +39,10 @@ struct net_proto_family; | |||
| 39 | struct sk_buff; | 39 | struct sk_buff; |
| 40 | struct net; | 40 | struct net; |
| 41 | 41 | ||
| 42 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); | 42 | void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); |
| 43 | extern int icmp_rcv(struct sk_buff *skb); | 43 | int icmp_rcv(struct sk_buff *skb); |
| 44 | extern void icmp_err(struct sk_buff *, u32 info); | 44 | void icmp_err(struct sk_buff *skb, u32 info); |
| 45 | extern int icmp_init(void); | 45 | int icmp_init(void); |
| 46 | extern void icmp_out_count(struct net *net, unsigned char type); | 46 | void icmp_out_count(struct net *net, unsigned char type); |
| 47 | 47 | ||
| 48 | #endif /* _ICMP_H */ | 48 | #endif /* _ICMP_H */ |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 02ef7727bb55..76d54270f2e2 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -66,11 +66,10 @@ struct inet6_ifaddr { | |||
| 66 | struct hlist_node addr_lst; | 66 | struct hlist_node addr_lst; |
| 67 | struct list_head if_list; | 67 | struct list_head if_list; |
| 68 | 68 | ||
| 69 | #ifdef CONFIG_IPV6_PRIVACY | ||
| 70 | struct list_head tmp_list; | 69 | struct list_head tmp_list; |
| 71 | struct inet6_ifaddr *ifpub; | 70 | struct inet6_ifaddr *ifpub; |
| 72 | int regen_count; | 71 | int regen_count; |
| 73 | #endif | 72 | |
| 74 | bool tokenized; | 73 | bool tokenized; |
| 75 | 74 | ||
| 76 | struct rcu_head rcu; | 75 | struct rcu_head rcu; |
| @@ -192,11 +191,9 @@ struct inet6_dev { | |||
| 192 | __u32 if_flags; | 191 | __u32 if_flags; |
| 193 | int dead; | 192 | int dead; |
| 194 | 193 | ||
| 195 | #ifdef CONFIG_IPV6_PRIVACY | ||
| 196 | u8 rndid[8]; | 194 | u8 rndid[8]; |
| 197 | struct timer_list regen_timer; | 195 | struct timer_list regen_timer; |
| 198 | struct list_head tempaddr_list; | 196 | struct list_head tempaddr_list; |
| 199 | #endif | ||
| 200 | 197 | ||
| 201 | struct in6_addr token; | 198 | struct in6_addr token; |
| 202 | 199 | ||
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index 04642c920431..f981ba7adeed 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
| @@ -22,27 +22,25 @@ struct sk_buff; | |||
| 22 | struct sock; | 22 | struct sock; |
| 23 | struct sockaddr; | 23 | struct sockaddr; |
| 24 | 24 | ||
| 25 | extern int inet6_csk_bind_conflict(const struct sock *sk, | 25 | int inet6_csk_bind_conflict(const struct sock *sk, |
| 26 | const struct inet_bind_bucket *tb, bool relax); | 26 | const struct inet_bind_bucket *tb, bool relax); |
| 27 | 27 | ||
| 28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, | 28 | struct dst_entry *inet6_csk_route_req(struct sock *sk, struct flowi6 *fl6, |
| 29 | struct flowi6 *fl6, | 29 | const struct request_sock *req); |
| 30 | const struct request_sock *req); | ||
| 31 | 30 | ||
| 32 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, | 31 | struct request_sock *inet6_csk_search_req(const struct sock *sk, |
| 33 | struct request_sock ***prevp, | 32 | struct request_sock ***prevp, |
| 34 | const __be16 rport, | 33 | const __be16 rport, |
| 35 | const struct in6_addr *raddr, | 34 | const struct in6_addr *raddr, |
| 36 | const struct in6_addr *laddr, | 35 | const struct in6_addr *laddr, |
| 37 | const int iif); | 36 | const int iif); |
| 38 | 37 | ||
| 39 | extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk, | 38 | void inet6_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req, |
| 40 | struct request_sock *req, | 39 | const unsigned long timeout); |
| 41 | const unsigned long timeout); | ||
| 42 | 40 | ||
| 43 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 41 | void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
| 44 | 42 | ||
| 45 | extern int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); | 43 | int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); |
| 46 | 44 | ||
| 47 | extern struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); | 45 | struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); |
| 48 | #endif /* _INET6_CONNECTION_SOCK_H */ | 46 | #endif /* _INET6_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index fd4ee016ba5c..ae0613544308 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
| @@ -28,32 +28,17 @@ | |||
| 28 | 28 | ||
| 29 | struct inet_hashinfo; | 29 | struct inet_hashinfo; |
| 30 | 30 | ||
| 31 | static inline unsigned int inet6_ehashfn(struct net *net, | 31 | static inline unsigned int __inet6_ehashfn(const u32 lhash, |
| 32 | const struct in6_addr *laddr, const u16 lport, | 32 | const u16 lport, |
| 33 | const struct in6_addr *faddr, const __be16 fport) | 33 | const u32 fhash, |
| 34 | const __be16 fport, | ||
| 35 | const u32 initval) | ||
| 34 | { | 36 | { |
| 35 | u32 ports = (((u32)lport) << 16) | (__force u32)fport; | 37 | const u32 ports = (((u32)lport) << 16) | (__force u32)fport; |
| 36 | 38 | return jhash_3words(lhash, fhash, ports, initval); | |
| 37 | return jhash_3words((__force u32)laddr->s6_addr32[3], | ||
| 38 | ipv6_addr_jhash(faddr), | ||
| 39 | ports, | ||
| 40 | inet_ehash_secret + net_hash_mix(net)); | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline int inet6_sk_ehashfn(const struct sock *sk) | ||
| 44 | { | ||
| 45 | const struct inet_sock *inet = inet_sk(sk); | ||
| 46 | const struct ipv6_pinfo *np = inet6_sk(sk); | ||
| 47 | const struct in6_addr *laddr = &np->rcv_saddr; | ||
| 48 | const struct in6_addr *faddr = &np->daddr; | ||
| 49 | const __u16 lport = inet->inet_num; | ||
| 50 | const __be16 fport = inet->inet_dport; | ||
| 51 | struct net *net = sock_net(sk); | ||
| 52 | |||
| 53 | return inet6_ehashfn(net, laddr, lport, faddr, fport); | ||
| 54 | } | 39 | } |
| 55 | 40 | ||
| 56 | extern int __inet6_hash(struct sock *sk, struct inet_timewait_sock *twp); | 41 | int __inet6_hash(struct sock *sk, struct inet_timewait_sock *twp); |
| 57 | 42 | ||
| 58 | /* | 43 | /* |
| 59 | * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so | 44 | * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so |
| @@ -61,21 +46,19 @@ extern int __inet6_hash(struct sock *sk, struct inet_timewait_sock *twp); | |||
| 61 | * | 46 | * |
| 62 | * The sockhash lock must be held as a reader here. | 47 | * The sockhash lock must be held as a reader here. |
| 63 | */ | 48 | */ |
| 64 | extern struct sock *__inet6_lookup_established(struct net *net, | 49 | struct sock *__inet6_lookup_established(struct net *net, |
| 65 | struct inet_hashinfo *hashinfo, | 50 | struct inet_hashinfo *hashinfo, |
| 66 | const struct in6_addr *saddr, | 51 | const struct in6_addr *saddr, |
| 67 | const __be16 sport, | 52 | const __be16 sport, |
| 68 | const struct in6_addr *daddr, | 53 | const struct in6_addr *daddr, |
| 69 | const u16 hnum, | 54 | const u16 hnum, const int dif); |
| 70 | const int dif); | 55 | |
| 71 | 56 | struct sock *inet6_lookup_listener(struct net *net, | |
| 72 | extern struct sock *inet6_lookup_listener(struct net *net, | 57 | struct inet_hashinfo *hashinfo, |
| 73 | struct inet_hashinfo *hashinfo, | 58 | const struct in6_addr *saddr, |
| 74 | const struct in6_addr *saddr, | 59 | const __be16 sport, |
| 75 | const __be16 sport, | 60 | const struct in6_addr *daddr, |
| 76 | const struct in6_addr *daddr, | 61 | const unsigned short hnum, const int dif); |
| 77 | const unsigned short hnum, | ||
| 78 | const int dif); | ||
| 79 | 62 | ||
| 80 | static inline struct sock *__inet6_lookup(struct net *net, | 63 | static inline struct sock *__inet6_lookup(struct net *net, |
| 81 | struct inet_hashinfo *hashinfo, | 64 | struct inet_hashinfo *hashinfo, |
| @@ -110,9 +93,9 @@ static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo, | |||
| 110 | inet6_iif(skb)); | 93 | inet6_iif(skb)); |
| 111 | } | 94 | } |
| 112 | 95 | ||
| 113 | extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, | 96 | struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, |
| 114 | const struct in6_addr *saddr, const __be16 sport, | 97 | const struct in6_addr *saddr, const __be16 sport, |
| 115 | const struct in6_addr *daddr, const __be16 dport, | 98 | const struct in6_addr *daddr, const __be16 dport, |
| 116 | const int dif); | 99 | const int dif); |
| 117 | #endif /* IS_ENABLED(CONFIG_IPV6) */ | 100 | #endif /* IS_ENABLED(CONFIG_IPV6) */ |
| 118 | #endif /* _INET6_HASHTABLES_H */ | 101 | #endif /* _INET6_HASHTABLES_H */ |
diff --git a/include/net/inet_common.h b/include/net/inet_common.h index 234008782c8c..fe7994c48b75 100644 --- a/include/net/inet_common.h +++ b/include/net/inet_common.h | |||
| @@ -13,30 +13,30 @@ struct sock; | |||
| 13 | struct sockaddr; | 13 | struct sockaddr; |
| 14 | struct socket; | 14 | struct socket; |
| 15 | 15 | ||
| 16 | extern int inet_release(struct socket *sock); | 16 | int inet_release(struct socket *sock); |
| 17 | extern int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, | 17 | int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
| 18 | int addr_len, int flags); | 18 | int addr_len, int flags); |
| 19 | extern int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, | 19 | int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
| 20 | int addr_len, int flags); | 20 | int addr_len, int flags); |
| 21 | extern int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, | 21 | int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, |
| 22 | int addr_len, int flags); | 22 | int addr_len, int flags); |
| 23 | extern int inet_accept(struct socket *sock, struct socket *newsock, int flags); | 23 | int inet_accept(struct socket *sock, struct socket *newsock, int flags); |
| 24 | extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock, | 24 | int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, |
| 25 | struct msghdr *msg, size_t size); | 25 | size_t size); |
| 26 | extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, | 26 | ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, |
| 27 | size_t size, int flags); | 27 | size_t size, int flags); |
| 28 | extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock, | 28 | int inet_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, |
| 29 | struct msghdr *msg, size_t size, int flags); | 29 | size_t size, int flags); |
| 30 | extern int inet_shutdown(struct socket *sock, int how); | 30 | int inet_shutdown(struct socket *sock, int how); |
| 31 | extern int inet_listen(struct socket *sock, int backlog); | 31 | int inet_listen(struct socket *sock, int backlog); |
| 32 | extern void inet_sock_destruct(struct sock *sk); | 32 | void inet_sock_destruct(struct sock *sk); |
| 33 | extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); | 33 | int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); |
| 34 | extern int inet_getname(struct socket *sock, struct sockaddr *uaddr, | 34 | int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, |
| 35 | int *uaddr_len, int peer); | 35 | int peer); |
| 36 | extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 36 | int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 37 | extern int inet_ctl_sock_create(struct sock **sk, unsigned short family, | 37 | int inet_ctl_sock_create(struct sock **sk, unsigned short family, |
| 38 | unsigned short type, unsigned char protocol, | 38 | unsigned short type, unsigned char protocol, |
| 39 | struct net *net); | 39 | struct net *net); |
| 40 | 40 | ||
| 41 | static inline void inet_ctl_sock_destroy(struct sock *sk) | 41 | static inline void inet_ctl_sock_destroy(struct sock *sk) |
| 42 | { | 42 | { |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index de2c78529afa..c55aeed41ace 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -146,9 +146,9 @@ static inline void *inet_csk_ca(const struct sock *sk) | |||
| 146 | return (void *)inet_csk(sk)->icsk_ca_priv; | 146 | return (void *)inet_csk(sk)->icsk_ca_priv; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | extern struct sock *inet_csk_clone_lock(const struct sock *sk, | 149 | struct sock *inet_csk_clone_lock(const struct sock *sk, |
| 150 | const struct request_sock *req, | 150 | const struct request_sock *req, |
| 151 | const gfp_t priority); | 151 | const gfp_t priority); |
| 152 | 152 | ||
| 153 | enum inet_csk_ack_state_t { | 153 | enum inet_csk_ack_state_t { |
| 154 | ICSK_ACK_SCHED = 1, | 154 | ICSK_ACK_SCHED = 1, |
| @@ -157,11 +157,11 @@ enum inet_csk_ack_state_t { | |||
| 157 | ICSK_ACK_PUSHED2 = 8 | 157 | ICSK_ACK_PUSHED2 = 8 |
| 158 | }; | 158 | }; |
| 159 | 159 | ||
| 160 | extern void inet_csk_init_xmit_timers(struct sock *sk, | 160 | void inet_csk_init_xmit_timers(struct sock *sk, |
| 161 | void (*retransmit_handler)(unsigned long), | 161 | void (*retransmit_handler)(unsigned long), |
| 162 | void (*delack_handler)(unsigned long), | 162 | void (*delack_handler)(unsigned long), |
| 163 | void (*keepalive_handler)(unsigned long)); | 163 | void (*keepalive_handler)(unsigned long)); |
| 164 | extern void inet_csk_clear_xmit_timers(struct sock *sk); | 164 | void inet_csk_clear_xmit_timers(struct sock *sk); |
| 165 | 165 | ||
| 166 | static inline void inet_csk_schedule_ack(struct sock *sk) | 166 | static inline void inet_csk_schedule_ack(struct sock *sk) |
| 167 | { | 167 | { |
| @@ -178,8 +178,8 @@ static inline void inet_csk_delack_init(struct sock *sk) | |||
| 178 | memset(&inet_csk(sk)->icsk_ack, 0, sizeof(inet_csk(sk)->icsk_ack)); | 178 | memset(&inet_csk(sk)->icsk_ack, 0, sizeof(inet_csk(sk)->icsk_ack)); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | extern void inet_csk_delete_keepalive_timer(struct sock *sk); | 181 | void inet_csk_delete_keepalive_timer(struct sock *sk); |
| 182 | extern void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout); | 182 | void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout); |
| 183 | 183 | ||
| 184 | #ifdef INET_CSK_DEBUG | 184 | #ifdef INET_CSK_DEBUG |
| 185 | extern const char inet_csk_timer_bug_msg[]; | 185 | extern const char inet_csk_timer_bug_msg[]; |
| @@ -241,23 +241,21 @@ static inline void inet_csk_reset_xmit_timer(struct sock *sk, const int what, | |||
| 241 | #endif | 241 | #endif |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | extern struct sock *inet_csk_accept(struct sock *sk, int flags, int *err); | 244 | struct sock *inet_csk_accept(struct sock *sk, int flags, int *err); |
| 245 | 245 | ||
| 246 | extern struct request_sock *inet_csk_search_req(const struct sock *sk, | 246 | struct request_sock *inet_csk_search_req(const struct sock *sk, |
| 247 | struct request_sock ***prevp, | 247 | struct request_sock ***prevp, |
| 248 | const __be16 rport, | 248 | const __be16 rport, |
| 249 | const __be32 raddr, | 249 | const __be32 raddr, |
| 250 | const __be32 laddr); | 250 | const __be32 laddr); |
| 251 | extern int inet_csk_bind_conflict(const struct sock *sk, | 251 | int inet_csk_bind_conflict(const struct sock *sk, |
| 252 | const struct inet_bind_bucket *tb, bool relax); | 252 | const struct inet_bind_bucket *tb, bool relax); |
| 253 | extern int inet_csk_get_port(struct sock *sk, unsigned short snum); | 253 | int inet_csk_get_port(struct sock *sk, unsigned short snum); |
| 254 | 254 | ||
| 255 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, | 255 | struct dst_entry *inet_csk_route_req(struct sock *sk, struct flowi4 *fl4, |
| 256 | struct flowi4 *fl4, | 256 | const struct request_sock *req); |
| 257 | struct dst_entry *inet_csk_route_child_sock(struct sock *sk, struct sock *newsk, | ||
| 257 | const struct request_sock *req); | 258 | const struct request_sock *req); |
| 258 | extern struct dst_entry* inet_csk_route_child_sock(struct sock *sk, | ||
| 259 | struct sock *newsk, | ||
| 260 | const struct request_sock *req); | ||
| 261 | 259 | ||
| 262 | static inline void inet_csk_reqsk_queue_add(struct sock *sk, | 260 | static inline void inet_csk_reqsk_queue_add(struct sock *sk, |
| 263 | struct request_sock *req, | 261 | struct request_sock *req, |
| @@ -266,9 +264,8 @@ static inline void inet_csk_reqsk_queue_add(struct sock *sk, | |||
| 266 | reqsk_queue_add(&inet_csk(sk)->icsk_accept_queue, req, sk, child); | 264 | reqsk_queue_add(&inet_csk(sk)->icsk_accept_queue, req, sk, child); |
| 267 | } | 265 | } |
| 268 | 266 | ||
| 269 | extern void inet_csk_reqsk_queue_hash_add(struct sock *sk, | 267 | void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req, |
| 270 | struct request_sock *req, | 268 | unsigned long timeout); |
| 271 | unsigned long timeout); | ||
| 272 | 269 | ||
| 273 | static inline void inet_csk_reqsk_queue_removed(struct sock *sk, | 270 | static inline void inet_csk_reqsk_queue_removed(struct sock *sk, |
| 274 | struct request_sock *req) | 271 | struct request_sock *req) |
| @@ -315,13 +312,13 @@ static inline void inet_csk_reqsk_queue_drop(struct sock *sk, | |||
| 315 | reqsk_free(req); | 312 | reqsk_free(req); |
| 316 | } | 313 | } |
| 317 | 314 | ||
| 318 | extern void inet_csk_reqsk_queue_prune(struct sock *parent, | 315 | void inet_csk_reqsk_queue_prune(struct sock *parent, |
| 319 | const unsigned long interval, | 316 | const unsigned long interval, |
| 320 | const unsigned long timeout, | 317 | const unsigned long timeout, |
| 321 | const unsigned long max_rto); | 318 | const unsigned long max_rto); |
| 322 | 319 | ||
| 323 | extern void inet_csk_destroy_sock(struct sock *sk); | 320 | void inet_csk_destroy_sock(struct sock *sk); |
| 324 | extern void inet_csk_prepare_forced_close(struct sock *sk); | 321 | void inet_csk_prepare_forced_close(struct sock *sk); |
| 325 | 322 | ||
| 326 | /* | 323 | /* |
| 327 | * LISTEN is a special case for poll.. | 324 | * LISTEN is a special case for poll.. |
| @@ -332,15 +329,15 @@ static inline unsigned int inet_csk_listen_poll(const struct sock *sk) | |||
| 332 | (POLLIN | POLLRDNORM) : 0; | 329 | (POLLIN | POLLRDNORM) : 0; |
| 333 | } | 330 | } |
| 334 | 331 | ||
| 335 | extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); | 332 | int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); |
| 336 | extern void inet_csk_listen_stop(struct sock *sk); | 333 | void inet_csk_listen_stop(struct sock *sk); |
| 337 | 334 | ||
| 338 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 335 | void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
| 339 | 336 | ||
| 340 | extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, | 337 | int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, |
| 341 | char __user *optval, int __user *optlen); | 338 | char __user *optval, int __user *optlen); |
| 342 | extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, | 339 | int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, |
| 343 | char __user *optval, unsigned int optlen); | 340 | char __user *optval, unsigned int optlen); |
| 344 | 341 | ||
| 345 | extern struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu); | 342 | struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu); |
| 346 | #endif /* _INET_CONNECTION_SOCK_H */ | 343 | #endif /* _INET_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index bfcbc0017950..6f59de98dabd 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
| @@ -64,6 +64,10 @@ struct inet_frags { | |||
| 64 | rwlock_t lock ____cacheline_aligned_in_smp; | 64 | rwlock_t lock ____cacheline_aligned_in_smp; |
| 65 | int secret_interval; | 65 | int secret_interval; |
| 66 | struct timer_list secret_timer; | 66 | struct timer_list secret_timer; |
| 67 | |||
| 68 | /* The first call to hashfn is responsible to initialize | ||
| 69 | * rnd. This is best done with net_get_random_once. | ||
| 70 | */ | ||
| 67 | u32 rnd; | 71 | u32 rnd; |
| 68 | int qsize; | 72 | int qsize; |
| 69 | 73 | ||
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index ef83d9e844b5..1bdb47715def 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
| @@ -37,12 +37,11 @@ | |||
| 37 | #include <asm/byteorder.h> | 37 | #include <asm/byteorder.h> |
| 38 | 38 | ||
| 39 | /* This is for all connections with a full identity, no wildcards. | 39 | /* This is for all connections with a full identity, no wildcards. |
| 40 | * One chain is dedicated to TIME_WAIT sockets. | 40 | * The 'e' prefix stands for Establish, but we really put all sockets |
| 41 | * I'll experiment with dynamic table growth later. | 41 | * but LISTEN ones. |
| 42 | */ | 42 | */ |
| 43 | struct inet_ehash_bucket { | 43 | struct inet_ehash_bucket { |
| 44 | struct hlist_nulls_head chain; | 44 | struct hlist_nulls_head chain; |
| 45 | struct hlist_nulls_head twchain; | ||
| 46 | }; | 45 | }; |
| 47 | 46 | ||
| 48 | /* There are a few simple rules, which allow for local port reuse by | 47 | /* There are a few simple rules, which allow for local port reuse by |
| @@ -123,7 +122,6 @@ struct inet_hashinfo { | |||
| 123 | * | 122 | * |
| 124 | * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE | 123 | * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE |
| 125 | * | 124 | * |
| 126 | * TIME_WAIT sockets use a separate chain (twchain). | ||
| 127 | */ | 125 | */ |
| 128 | struct inet_ehash_bucket *ehash; | 126 | struct inet_ehash_bucket *ehash; |
| 129 | spinlock_t *ehash_locks; | 127 | spinlock_t *ehash_locks; |
| @@ -218,22 +216,21 @@ static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo) | |||
| 218 | } | 216 | } |
| 219 | } | 217 | } |
| 220 | 218 | ||
| 221 | extern struct inet_bind_bucket * | 219 | struct inet_bind_bucket * |
| 222 | inet_bind_bucket_create(struct kmem_cache *cachep, | 220 | inet_bind_bucket_create(struct kmem_cache *cachep, struct net *net, |
| 223 | struct net *net, | 221 | struct inet_bind_hashbucket *head, |
| 224 | struct inet_bind_hashbucket *head, | 222 | const unsigned short snum); |
| 225 | const unsigned short snum); | 223 | void inet_bind_bucket_destroy(struct kmem_cache *cachep, |
| 226 | extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, | 224 | struct inet_bind_bucket *tb); |
| 227 | struct inet_bind_bucket *tb); | ||
| 228 | 225 | ||
| 229 | static inline int inet_bhashfn(struct net *net, | 226 | static inline int inet_bhashfn(struct net *net, const __u16 lport, |
| 230 | const __u16 lport, const int bhash_size) | 227 | const int bhash_size) |
| 231 | { | 228 | { |
| 232 | return (lport + net_hash_mix(net)) & (bhash_size - 1); | 229 | return (lport + net_hash_mix(net)) & (bhash_size - 1); |
| 233 | } | 230 | } |
| 234 | 231 | ||
| 235 | extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, | 232 | void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, |
| 236 | const unsigned short snum); | 233 | const unsigned short snum); |
| 237 | 234 | ||
| 238 | /* These can have wildcards, don't try too hard. */ | 235 | /* These can have wildcards, don't try too hard. */ |
| 239 | static inline int inet_lhashfn(struct net *net, const unsigned short num) | 236 | static inline int inet_lhashfn(struct net *net, const unsigned short num) |
| @@ -247,23 +244,22 @@ static inline int inet_sk_listen_hashfn(const struct sock *sk) | |||
| 247 | } | 244 | } |
| 248 | 245 | ||
| 249 | /* Caller must disable local BH processing. */ | 246 | /* Caller must disable local BH processing. */ |
| 250 | extern int __inet_inherit_port(struct sock *sk, struct sock *child); | 247 | int __inet_inherit_port(struct sock *sk, struct sock *child); |
| 251 | 248 | ||
| 252 | extern void inet_put_port(struct sock *sk); | 249 | void inet_put_port(struct sock *sk); |
| 253 | 250 | ||
| 254 | void inet_hashinfo_init(struct inet_hashinfo *h); | 251 | void inet_hashinfo_init(struct inet_hashinfo *h); |
| 255 | 252 | ||
| 256 | extern int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw); | 253 | int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw); |
| 257 | extern void inet_hash(struct sock *sk); | 254 | void inet_hash(struct sock *sk); |
| 258 | extern void inet_unhash(struct sock *sk); | 255 | void inet_unhash(struct sock *sk); |
| 259 | 256 | ||
| 260 | extern struct sock *__inet_lookup_listener(struct net *net, | 257 | struct sock *__inet_lookup_listener(struct net *net, |
| 261 | struct inet_hashinfo *hashinfo, | 258 | struct inet_hashinfo *hashinfo, |
| 262 | const __be32 saddr, | 259 | const __be32 saddr, const __be16 sport, |
| 263 | const __be16 sport, | 260 | const __be32 daddr, |
| 264 | const __be32 daddr, | 261 | const unsigned short hnum, |
| 265 | const unsigned short hnum, | 262 | const int dif); |
| 266 | const int dif); | ||
| 267 | 263 | ||
| 268 | static inline struct sock *inet_lookup_listener(struct net *net, | 264 | static inline struct sock *inet_lookup_listener(struct net *net, |
| 269 | struct inet_hashinfo *hashinfo, | 265 | struct inet_hashinfo *hashinfo, |
| @@ -304,30 +300,17 @@ static inline struct sock *inet_lookup_listener(struct net *net, | |||
| 304 | ((__force __u64)(__be32)(__saddr))); | 300 | ((__force __u64)(__be32)(__saddr))); |
| 305 | #endif /* __BIG_ENDIAN */ | 301 | #endif /* __BIG_ENDIAN */ |
| 306 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ | 302 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ |
| 307 | ((inet_sk(__sk)->inet_portpair == (__ports)) && \ | 303 | (((__sk)->sk_portpair == (__ports)) && \ |
| 308 | (inet_sk(__sk)->inet_addrpair == (__cookie)) && \ | 304 | ((__sk)->sk_addrpair == (__cookie)) && \ |
| 309 | (!(__sk)->sk_bound_dev_if || \ | 305 | (!(__sk)->sk_bound_dev_if || \ |
| 310 | ((__sk)->sk_bound_dev_if == (__dif))) && \ | 306 | ((__sk)->sk_bound_dev_if == (__dif))) && \ |
| 311 | net_eq(sock_net(__sk), (__net))) | 307 | net_eq(sock_net(__sk), (__net))) |
| 312 | #define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif)\ | ||
| 313 | ((inet_twsk(__sk)->tw_portpair == (__ports)) && \ | ||
| 314 | (inet_twsk(__sk)->tw_addrpair == (__cookie)) && \ | ||
| 315 | (!(__sk)->sk_bound_dev_if || \ | ||
| 316 | ((__sk)->sk_bound_dev_if == (__dif))) && \ | ||
| 317 | net_eq(sock_net(__sk), (__net))) | ||
| 318 | #else /* 32-bit arch */ | 308 | #else /* 32-bit arch */ |
| 319 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) | 309 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) |
| 320 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ | 310 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ |
| 321 | ((inet_sk(__sk)->inet_portpair == (__ports)) && \ | 311 | (((__sk)->sk_portpair == (__ports)) && \ |
| 322 | (inet_sk(__sk)->inet_daddr == (__saddr)) && \ | 312 | ((__sk)->sk_daddr == (__saddr)) && \ |
| 323 | (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ | 313 | ((__sk)->sk_rcv_saddr == (__daddr)) && \ |
| 324 | (!(__sk)->sk_bound_dev_if || \ | ||
| 325 | ((__sk)->sk_bound_dev_if == (__dif))) && \ | ||
| 326 | net_eq(sock_net(__sk), (__net))) | ||
| 327 | #define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ | ||
| 328 | ((inet_twsk(__sk)->tw_portpair == (__ports)) && \ | ||
| 329 | (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ | ||
| 330 | (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ | ||
| 331 | (!(__sk)->sk_bound_dev_if || \ | 314 | (!(__sk)->sk_bound_dev_if || \ |
| 332 | ((__sk)->sk_bound_dev_if == (__dif))) && \ | 315 | ((__sk)->sk_bound_dev_if == (__dif))) && \ |
| 333 | net_eq(sock_net(__sk), (__net))) | 316 | net_eq(sock_net(__sk), (__net))) |
| @@ -339,10 +322,11 @@ static inline struct sock *inet_lookup_listener(struct net *net, | |||
| 339 | * | 322 | * |
| 340 | * Local BH must be disabled here. | 323 | * Local BH must be disabled here. |
| 341 | */ | 324 | */ |
| 342 | extern struct sock * __inet_lookup_established(struct net *net, | 325 | struct sock *__inet_lookup_established(struct net *net, |
| 343 | struct inet_hashinfo *hashinfo, | 326 | struct inet_hashinfo *hashinfo, |
| 344 | const __be32 saddr, const __be16 sport, | 327 | const __be32 saddr, const __be16 sport, |
| 345 | const __be32 daddr, const u16 hnum, const int dif); | 328 | const __be32 daddr, const u16 hnum, |
| 329 | const int dif); | ||
| 346 | 330 | ||
| 347 | static inline struct sock * | 331 | static inline struct sock * |
| 348 | inet_lookup_established(struct net *net, struct inet_hashinfo *hashinfo, | 332 | inet_lookup_established(struct net *net, struct inet_hashinfo *hashinfo, |
| @@ -399,13 +383,14 @@ static inline struct sock *__inet_lookup_skb(struct inet_hashinfo *hashinfo, | |||
| 399 | iph->daddr, dport, inet_iif(skb)); | 383 | iph->daddr, dport, inet_iif(skb)); |
| 400 | } | 384 | } |
| 401 | 385 | ||
| 402 | extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, | 386 | int __inet_hash_connect(struct inet_timewait_death_row *death_row, |
| 403 | struct sock *sk, | 387 | struct sock *sk, u32 port_offset, |
| 404 | u32 port_offset, | 388 | int (*check_established)(struct inet_timewait_death_row *, |
| 405 | int (*check_established)(struct inet_timewait_death_row *, | 389 | struct sock *, __u16, |
| 406 | struct sock *, __u16, struct inet_timewait_sock **), | 390 | struct inet_timewait_sock **), |
| 407 | int (*hash)(struct sock *sk, struct inet_timewait_sock *twp)); | 391 | int (*hash)(struct sock *sk, |
| 392 | struct inet_timewait_sock *twp)); | ||
| 408 | 393 | ||
| 409 | extern int inet_hash_connect(struct inet_timewait_death_row *death_row, | 394 | int inet_hash_connect(struct inet_timewait_death_row *death_row, |
| 410 | struct sock *sk); | 395 | struct sock *sk); |
| 411 | #endif /* _INET_HASHTABLES_H */ | 396 | #endif /* _INET_HASHTABLES_H */ |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index b21a7f06d6a4..1833c3f389ee 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -70,13 +70,14 @@ struct ip_options_data { | |||
| 70 | 70 | ||
| 71 | struct inet_request_sock { | 71 | struct inet_request_sock { |
| 72 | struct request_sock req; | 72 | struct request_sock req; |
| 73 | #if IS_ENABLED(CONFIG_IPV6) | 73 | #define ir_loc_addr req.__req_common.skc_rcv_saddr |
| 74 | u16 inet6_rsk_offset; | 74 | #define ir_rmt_addr req.__req_common.skc_daddr |
| 75 | #endif | 75 | #define ir_num req.__req_common.skc_num |
| 76 | __be16 loc_port; | 76 | #define ir_rmt_port req.__req_common.skc_dport |
| 77 | __be32 loc_addr; | 77 | #define ir_v6_rmt_addr req.__req_common.skc_v6_daddr |
| 78 | __be32 rmt_addr; | 78 | #define ir_v6_loc_addr req.__req_common.skc_v6_rcv_saddr |
| 79 | __be16 rmt_port; | 79 | #define ir_iif req.__req_common.skc_bound_dev_if |
| 80 | |||
| 80 | kmemcheck_bitfield_begin(flags); | 81 | kmemcheck_bitfield_begin(flags); |
| 81 | u16 snd_wscale : 4, | 82 | u16 snd_wscale : 4, |
| 82 | rcv_wscale : 4, | 83 | rcv_wscale : 4, |
| @@ -88,6 +89,7 @@ struct inet_request_sock { | |||
| 88 | no_srccheck: 1; | 89 | no_srccheck: 1; |
| 89 | kmemcheck_bitfield_end(flags); | 90 | kmemcheck_bitfield_end(flags); |
| 90 | struct ip_options_rcu *opt; | 91 | struct ip_options_rcu *opt; |
| 92 | struct sk_buff *pktopts; | ||
| 91 | }; | 93 | }; |
| 92 | 94 | ||
| 93 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | 95 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) |
| @@ -103,6 +105,9 @@ struct inet_cork { | |||
| 103 | int length; /* Total length of all frames */ | 105 | int length; /* Total length of all frames */ |
| 104 | struct dst_entry *dst; | 106 | struct dst_entry *dst; |
| 105 | u8 tx_flags; | 107 | u8 tx_flags; |
| 108 | __u8 ttl; | ||
| 109 | __s16 tos; | ||
| 110 | char priority; | ||
| 106 | }; | 111 | }; |
| 107 | 112 | ||
| 108 | struct inet_cork_full { | 113 | struct inet_cork_full { |
| @@ -143,10 +148,8 @@ struct inet_sock { | |||
| 143 | /* Socket demultiplex comparisons on incoming packets. */ | 148 | /* Socket demultiplex comparisons on incoming packets. */ |
| 144 | #define inet_daddr sk.__sk_common.skc_daddr | 149 | #define inet_daddr sk.__sk_common.skc_daddr |
| 145 | #define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr | 150 | #define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr |
| 146 | #define inet_addrpair sk.__sk_common.skc_addrpair | ||
| 147 | #define inet_dport sk.__sk_common.skc_dport | 151 | #define inet_dport sk.__sk_common.skc_dport |
| 148 | #define inet_num sk.__sk_common.skc_num | 152 | #define inet_num sk.__sk_common.skc_num |
| 149 | #define inet_portpair sk.__sk_common.skc_portpair | ||
| 150 | 153 | ||
| 151 | __be32 inet_saddr; | 154 | __be32 inet_saddr; |
| 152 | __s16 uc_ttl; | 155 | __s16 uc_ttl; |
| @@ -199,32 +202,18 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
| 199 | } | 202 | } |
| 200 | #endif | 203 | #endif |
| 201 | 204 | ||
| 202 | extern int inet_sk_rebuild_header(struct sock *sk); | 205 | int inet_sk_rebuild_header(struct sock *sk); |
| 203 | |||
| 204 | extern u32 inet_ehash_secret; | ||
| 205 | extern u32 ipv6_hash_secret; | ||
| 206 | extern void build_ehash_secret(void); | ||
| 207 | 206 | ||
| 208 | static inline unsigned int inet_ehashfn(struct net *net, | 207 | static inline unsigned int __inet_ehashfn(const __be32 laddr, |
| 209 | const __be32 laddr, const __u16 lport, | 208 | const __u16 lport, |
| 210 | const __be32 faddr, const __be16 fport) | 209 | const __be32 faddr, |
| 210 | const __be16 fport, | ||
| 211 | u32 initval) | ||
| 211 | { | 212 | { |
| 212 | return jhash_3words((__force __u32) laddr, | 213 | return jhash_3words((__force __u32) laddr, |
| 213 | (__force __u32) faddr, | 214 | (__force __u32) faddr, |
| 214 | ((__u32) lport) << 16 | (__force __u32)fport, | 215 | ((__u32) lport) << 16 | (__force __u32)fport, |
| 215 | inet_ehash_secret + net_hash_mix(net)); | 216 | initval); |
| 216 | } | ||
| 217 | |||
| 218 | static inline int inet_sk_ehashfn(const struct sock *sk) | ||
| 219 | { | ||
| 220 | const struct inet_sock *inet = inet_sk(sk); | ||
| 221 | const __be32 laddr = inet->inet_rcv_saddr; | ||
| 222 | const __u16 lport = inet->inet_num; | ||
| 223 | const __be32 faddr = inet->inet_daddr; | ||
| 224 | const __be16 fport = inet->inet_dport; | ||
| 225 | struct net *net = sock_net(sk); | ||
| 226 | |||
| 227 | return inet_ehashfn(net, laddr, lport, faddr, fport); | ||
| 228 | } | 217 | } |
| 229 | 218 | ||
| 230 | static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops) | 219 | static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops) |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index f908dfc06505..71c6e264e5b5 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -58,6 +58,11 @@ struct inet_hashinfo; | |||
| 58 | # define INET_TWDR_RECYCLE_TICK (12 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG) | 58 | # define INET_TWDR_RECYCLE_TICK (12 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG) |
| 59 | #endif | 59 | #endif |
| 60 | 60 | ||
| 61 | static inline u32 inet_tw_time_stamp(void) | ||
| 62 | { | ||
| 63 | return jiffies; | ||
| 64 | } | ||
| 65 | |||
| 61 | /* TIME_WAIT reaping mechanism. */ | 66 | /* TIME_WAIT reaping mechanism. */ |
| 62 | #define INET_TWDR_TWKILL_SLOTS 8 /* Please keep this a power of 2. */ | 67 | #define INET_TWDR_TWKILL_SLOTS 8 /* Please keep this a power of 2. */ |
| 63 | 68 | ||
| @@ -83,9 +88,9 @@ struct inet_timewait_death_row { | |||
| 83 | int sysctl_max_tw_buckets; | 88 | int sysctl_max_tw_buckets; |
| 84 | }; | 89 | }; |
| 85 | 90 | ||
| 86 | extern void inet_twdr_hangman(unsigned long data); | 91 | void inet_twdr_hangman(unsigned long data); |
| 87 | extern void inet_twdr_twkill_work(struct work_struct *work); | 92 | void inet_twdr_twkill_work(struct work_struct *work); |
| 88 | extern void inet_twdr_twcal_tick(unsigned long data); | 93 | void inet_twdr_twcal_tick(unsigned long data); |
| 89 | 94 | ||
| 90 | struct inet_bind_bucket; | 95 | struct inet_bind_bucket; |
| 91 | 96 | ||
| @@ -111,11 +116,11 @@ struct inet_timewait_sock { | |||
| 111 | #define tw_prot __tw_common.skc_prot | 116 | #define tw_prot __tw_common.skc_prot |
| 112 | #define tw_net __tw_common.skc_net | 117 | #define tw_net __tw_common.skc_net |
| 113 | #define tw_daddr __tw_common.skc_daddr | 118 | #define tw_daddr __tw_common.skc_daddr |
| 119 | #define tw_v6_daddr __tw_common.skc_v6_daddr | ||
| 114 | #define tw_rcv_saddr __tw_common.skc_rcv_saddr | 120 | #define tw_rcv_saddr __tw_common.skc_rcv_saddr |
| 115 | #define tw_addrpair __tw_common.skc_addrpair | 121 | #define tw_v6_rcv_saddr __tw_common.skc_v6_rcv_saddr |
| 116 | #define tw_dport __tw_common.skc_dport | 122 | #define tw_dport __tw_common.skc_dport |
| 117 | #define tw_num __tw_common.skc_num | 123 | #define tw_num __tw_common.skc_num |
| 118 | #define tw_portpair __tw_common.skc_portpair | ||
| 119 | 124 | ||
| 120 | int tw_timeout; | 125 | int tw_timeout; |
| 121 | volatile unsigned char tw_substate; | 126 | volatile unsigned char tw_substate; |
| @@ -130,26 +135,14 @@ struct inet_timewait_sock { | |||
| 130 | tw_transparent : 1, | 135 | tw_transparent : 1, |
| 131 | tw_pad : 6, /* 6 bits hole */ | 136 | tw_pad : 6, /* 6 bits hole */ |
| 132 | tw_tos : 8, | 137 | tw_tos : 8, |
| 133 | tw_ipv6_offset : 16; | 138 | tw_pad2 : 16; /* 16 bits hole */ |
| 134 | kmemcheck_bitfield_end(flags); | 139 | kmemcheck_bitfield_end(flags); |
| 135 | unsigned long tw_ttd; | 140 | u32 tw_ttd; |
| 136 | struct inet_bind_bucket *tw_tb; | 141 | struct inet_bind_bucket *tw_tb; |
| 137 | struct hlist_node tw_death_node; | 142 | struct hlist_node tw_death_node; |
| 138 | }; | 143 | }; |
| 139 | #define tw_tclass tw_tos | 144 | #define tw_tclass tw_tos |
| 140 | 145 | ||
| 141 | static inline void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw, | ||
| 142 | struct hlist_nulls_head *list) | ||
| 143 | { | ||
| 144 | hlist_nulls_add_head_rcu(&tw->tw_node, list); | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline void inet_twsk_add_bind_node(struct inet_timewait_sock *tw, | ||
| 148 | struct hlist_head *list) | ||
| 149 | { | ||
| 150 | hlist_add_head(&tw->tw_bind_node, list); | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) | 146 | static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) |
| 154 | { | 147 | { |
| 155 | return !hlist_unhashed(&tw->tw_death_node); | 148 | return !hlist_unhashed(&tw->tw_death_node); |
| @@ -189,34 +182,28 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |||
| 189 | return (struct inet_timewait_sock *)sk; | 182 | return (struct inet_timewait_sock *)sk; |
| 190 | } | 183 | } |
| 191 | 184 | ||
| 192 | static inline __be32 sk_rcv_saddr(const struct sock *sk) | 185 | void inet_twsk_free(struct inet_timewait_sock *tw); |
| 193 | { | 186 | void inet_twsk_put(struct inet_timewait_sock *tw); |
| 194 | /* both inet_sk() and inet_twsk() store rcv_saddr in skc_rcv_saddr */ | ||
| 195 | return sk->__sk_common.skc_rcv_saddr; | ||
| 196 | } | ||
| 197 | |||
| 198 | extern void inet_twsk_put(struct inet_timewait_sock *tw); | ||
| 199 | 187 | ||
| 200 | extern int inet_twsk_unhash(struct inet_timewait_sock *tw); | 188 | int inet_twsk_unhash(struct inet_timewait_sock *tw); |
| 201 | 189 | ||
| 202 | extern int inet_twsk_bind_unhash(struct inet_timewait_sock *tw, | 190 | int inet_twsk_bind_unhash(struct inet_timewait_sock *tw, |
| 203 | struct inet_hashinfo *hashinfo); | 191 | struct inet_hashinfo *hashinfo); |
| 204 | 192 | ||
| 205 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, | 193 | struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, |
| 206 | const int state); | 194 | const int state); |
| 207 | 195 | ||
| 208 | extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw, | 196 | void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, |
| 209 | struct sock *sk, | 197 | struct inet_hashinfo *hashinfo); |
| 210 | struct inet_hashinfo *hashinfo); | ||
| 211 | 198 | ||
| 212 | extern void inet_twsk_schedule(struct inet_timewait_sock *tw, | 199 | void inet_twsk_schedule(struct inet_timewait_sock *tw, |
| 213 | struct inet_timewait_death_row *twdr, | 200 | struct inet_timewait_death_row *twdr, |
| 214 | const int timeo, const int timewait_len); | 201 | const int timeo, const int timewait_len); |
| 215 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, | 202 | void inet_twsk_deschedule(struct inet_timewait_sock *tw, |
| 216 | struct inet_timewait_death_row *twdr); | 203 | struct inet_timewait_death_row *twdr); |
| 217 | 204 | ||
| 218 | extern void inet_twsk_purge(struct inet_hashinfo *hashinfo, | 205 | void inet_twsk_purge(struct inet_hashinfo *hashinfo, |
| 219 | struct inet_timewait_death_row *twdr, int family); | 206 | struct inet_timewait_death_row *twdr, int family); |
| 220 | 207 | ||
| 221 | static inline | 208 | static inline |
| 222 | struct net *twsk_net(const struct inet_timewait_sock *twsk) | 209 | struct net *twsk_net(const struct inet_timewait_sock *twsk) |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 53f464d7cddc..f4e127af4e17 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
| @@ -120,9 +120,9 @@ static inline void inetpeer_transfer_peer(unsigned long *to, unsigned long *from | |||
| 120 | } | 120 | } |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | extern void inet_peer_base_init(struct inet_peer_base *); | 123 | void inet_peer_base_init(struct inet_peer_base *); |
| 124 | 124 | ||
| 125 | void inet_initpeers(void) __init; | 125 | void inet_initpeers(void) __init; |
| 126 | 126 | ||
| 127 | #define INETPEER_METRICS_NEW (~(u32) 0) | 127 | #define INETPEER_METRICS_NEW (~(u32) 0) |
| 128 | 128 | ||
| @@ -159,11 +159,11 @@ static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base, | |||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | /* can be called from BH context or outside */ | 161 | /* can be called from BH context or outside */ |
| 162 | extern void inet_putpeer(struct inet_peer *p); | 162 | void inet_putpeer(struct inet_peer *p); |
| 163 | extern bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); | 163 | bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); |
| 164 | 164 | ||
| 165 | extern void inetpeer_invalidate_tree(struct inet_peer_base *); | 165 | void inetpeer_invalidate_tree(struct inet_peer_base *); |
| 166 | extern void inetpeer_invalidate_family(int family); | 166 | void inetpeer_invalidate_family(int family); |
| 167 | 167 | ||
| 168 | /* | 168 | /* |
| 169 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, | 169 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, |
diff --git a/include/net/ip.h b/include/net/ip.h index 5e5268807a1c..217bc5bfc6c6 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/skbuff.h> | 28 | #include <linux/skbuff.h> |
| 29 | 29 | ||
| 30 | #include <net/inet_sock.h> | 30 | #include <net/inet_sock.h> |
| 31 | #include <net/route.h> | ||
| 31 | #include <net/snmp.h> | 32 | #include <net/snmp.h> |
| 32 | #include <net/flow.h> | 33 | #include <net/flow.h> |
| 33 | 34 | ||
| @@ -56,6 +57,9 @@ struct ipcm_cookie { | |||
| 56 | int oif; | 57 | int oif; |
| 57 | struct ip_options_rcu *opt; | 58 | struct ip_options_rcu *opt; |
| 58 | __u8 tx_flags; | 59 | __u8 tx_flags; |
| 60 | __u8 ttl; | ||
| 61 | __s16 tos; | ||
| 62 | char priority; | ||
| 59 | }; | 63 | }; |
| 60 | 64 | ||
| 61 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) | 65 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) |
| @@ -86,64 +90,71 @@ struct packet_type; | |||
| 86 | struct rtable; | 90 | struct rtable; |
| 87 | struct sockaddr; | 91 | struct sockaddr; |
| 88 | 92 | ||
| 89 | extern int igmp_mc_proc_init(void); | 93 | int igmp_mc_proc_init(void); |
| 90 | 94 | ||
| 91 | /* | 95 | /* |
| 92 | * Functions provided by ip.c | 96 | * Functions provided by ip.c |
| 93 | */ | 97 | */ |
| 94 | 98 | ||
| 95 | extern int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, | 99 | int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, |
| 96 | __be32 saddr, __be32 daddr, | 100 | __be32 saddr, __be32 daddr, |
| 97 | struct ip_options_rcu *opt); | 101 | struct ip_options_rcu *opt); |
| 98 | extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, | 102 | int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, |
| 99 | struct packet_type *pt, struct net_device *orig_dev); | 103 | struct net_device *orig_dev); |
| 100 | extern int ip_local_deliver(struct sk_buff *skb); | 104 | int ip_local_deliver(struct sk_buff *skb); |
| 101 | extern int ip_mr_input(struct sk_buff *skb); | 105 | int ip_mr_input(struct sk_buff *skb); |
| 102 | extern int ip_output(struct sk_buff *skb); | 106 | int ip_output(struct sk_buff *skb); |
| 103 | extern int ip_mc_output(struct sk_buff *skb); | 107 | int ip_mc_output(struct sk_buff *skb); |
| 104 | extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 108 | int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); |
| 105 | extern int ip_do_nat(struct sk_buff *skb); | 109 | int ip_do_nat(struct sk_buff *skb); |
| 106 | extern void ip_send_check(struct iphdr *ip); | 110 | void ip_send_check(struct iphdr *ip); |
| 107 | extern int __ip_local_out(struct sk_buff *skb); | 111 | int __ip_local_out(struct sk_buff *skb); |
| 108 | extern int ip_local_out(struct sk_buff *skb); | 112 | int ip_local_out(struct sk_buff *skb); |
| 109 | extern int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl); | 113 | int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl); |
| 110 | extern void ip_init(void); | 114 | void ip_init(void); |
| 111 | extern int ip_append_data(struct sock *sk, struct flowi4 *fl4, | 115 | int ip_append_data(struct sock *sk, struct flowi4 *fl4, |
| 112 | int getfrag(void *from, char *to, int offset, int len, | 116 | int getfrag(void *from, char *to, int offset, int len, |
| 113 | int odd, struct sk_buff *skb), | 117 | int odd, struct sk_buff *skb), |
| 114 | void *from, int len, int protolen, | 118 | void *from, int len, int protolen, |
| 115 | struct ipcm_cookie *ipc, | 119 | struct ipcm_cookie *ipc, |
| 116 | struct rtable **rt, | 120 | struct rtable **rt, |
| 117 | unsigned int flags); | 121 | unsigned int flags); |
| 118 | extern int ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb); | 122 | int ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, |
| 119 | extern ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, | 123 | struct sk_buff *skb); |
| 120 | int offset, size_t size, int flags); | 124 | ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, |
| 121 | extern struct sk_buff *__ip_make_skb(struct sock *sk, | 125 | int offset, size_t size, int flags); |
| 122 | struct flowi4 *fl4, | 126 | struct sk_buff *__ip_make_skb(struct sock *sk, struct flowi4 *fl4, |
| 123 | struct sk_buff_head *queue, | 127 | struct sk_buff_head *queue, |
| 124 | struct inet_cork *cork); | 128 | struct inet_cork *cork); |
| 125 | extern int ip_send_skb(struct net *net, struct sk_buff *skb); | 129 | int ip_send_skb(struct net *net, struct sk_buff *skb); |
| 126 | extern int ip_push_pending_frames(struct sock *sk, struct flowi4 *fl4); | 130 | int ip_push_pending_frames(struct sock *sk, struct flowi4 *fl4); |
| 127 | extern void ip_flush_pending_frames(struct sock *sk); | 131 | void ip_flush_pending_frames(struct sock *sk); |
| 128 | extern struct sk_buff *ip_make_skb(struct sock *sk, | 132 | struct sk_buff *ip_make_skb(struct sock *sk, struct flowi4 *fl4, |
| 129 | struct flowi4 *fl4, | 133 | int getfrag(void *from, char *to, int offset, |
| 130 | int getfrag(void *from, char *to, int offset, int len, | 134 | int len, int odd, struct sk_buff *skb), |
| 131 | int odd, struct sk_buff *skb), | 135 | void *from, int length, int transhdrlen, |
| 132 | void *from, int length, int transhdrlen, | 136 | struct ipcm_cookie *ipc, struct rtable **rtp, |
| 133 | struct ipcm_cookie *ipc, | 137 | unsigned int flags); |
| 134 | struct rtable **rtp, | ||
| 135 | unsigned int flags); | ||
| 136 | 138 | ||
| 137 | static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4) | 139 | static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4) |
| 138 | { | 140 | { |
| 139 | return __ip_make_skb(sk, fl4, &sk->sk_write_queue, &inet_sk(sk)->cork.base); | 141 | return __ip_make_skb(sk, fl4, &sk->sk_write_queue, &inet_sk(sk)->cork.base); |
| 140 | } | 142 | } |
| 141 | 143 | ||
| 144 | static inline __u8 get_rttos(struct ipcm_cookie* ipc, struct inet_sock *inet) | ||
| 145 | { | ||
| 146 | return (ipc->tos != -1) ? RT_TOS(ipc->tos) : RT_TOS(inet->tos); | ||
| 147 | } | ||
| 148 | |||
| 149 | static inline __u8 get_rtconn_flags(struct ipcm_cookie* ipc, struct sock* sk) | ||
| 150 | { | ||
| 151 | return (ipc->tos != -1) ? RT_CONN_FLAGS_TOS(sk, ipc->tos) : RT_CONN_FLAGS(sk); | ||
| 152 | } | ||
| 153 | |||
| 142 | /* datagram.c */ | 154 | /* datagram.c */ |
| 143 | extern int ip4_datagram_connect(struct sock *sk, | 155 | int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 144 | struct sockaddr *uaddr, int addr_len); | ||
| 145 | 156 | ||
| 146 | extern void ip4_datagram_release_cb(struct sock *sk); | 157 | void ip4_datagram_release_cb(struct sock *sk); |
| 147 | 158 | ||
| 148 | struct ip_reply_arg { | 159 | struct ip_reply_arg { |
| 149 | struct kvec iov[1]; | 160 | struct kvec iov[1]; |
| @@ -184,16 +195,16 @@ extern struct ipv4_config ipv4_config; | |||
| 184 | #define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd) | 195 | #define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd) |
| 185 | #define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) | 196 | #define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) |
| 186 | 197 | ||
| 187 | extern unsigned long snmp_fold_field(void __percpu *mib[], int offt); | 198 | unsigned long snmp_fold_field(void __percpu *mib[], int offt); |
| 188 | #if BITS_PER_LONG==32 | 199 | #if BITS_PER_LONG==32 |
| 189 | extern u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t sync_off); | 200 | u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t sync_off); |
| 190 | #else | 201 | #else |
| 191 | static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp_off) | 202 | static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp_off) |
| 192 | { | 203 | { |
| 193 | return snmp_fold_field(mib, offt); | 204 | return snmp_fold_field(mib, offt); |
| 194 | } | 205 | } |
| 195 | #endif | 206 | #endif |
| 196 | extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); | 207 | int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); |
| 197 | 208 | ||
| 198 | static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ]) | 209 | static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ]) |
| 199 | { | 210 | { |
| @@ -206,11 +217,7 @@ static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ]) | |||
| 206 | } | 217 | } |
| 207 | } | 218 | } |
| 208 | 219 | ||
| 209 | extern struct local_ports { | 220 | void inet_get_local_port_range(struct net *net, int *low, int *high); |
| 210 | seqlock_t lock; | ||
| 211 | int range[2]; | ||
| 212 | } sysctl_local_ports; | ||
| 213 | extern void inet_get_local_port_range(int *low, int *high); | ||
| 214 | 221 | ||
| 215 | extern unsigned long *sysctl_local_reserved_ports; | 222 | extern unsigned long *sysctl_local_reserved_ports; |
| 216 | static inline int inet_is_reserved_local_port(int port) | 223 | static inline int inet_is_reserved_local_port(int port) |
| @@ -231,9 +238,9 @@ extern int sysctl_ip_early_demux; | |||
| 231 | /* From ip_output.c */ | 238 | /* From ip_output.c */ |
| 232 | extern int sysctl_ip_dynaddr; | 239 | extern int sysctl_ip_dynaddr; |
| 233 | 240 | ||
| 234 | extern void ipfrag_init(void); | 241 | void ipfrag_init(void); |
| 235 | 242 | ||
| 236 | extern void ip_static_sysctl_init(void); | 243 | void ip_static_sysctl_init(void); |
| 237 | 244 | ||
| 238 | static inline bool ip_is_fragment(const struct iphdr *iph) | 245 | static inline bool ip_is_fragment(const struct iphdr *iph) |
| 239 | { | 246 | { |
| @@ -262,7 +269,7 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) | |||
| 262 | !(dst_metric_locked(dst, RTAX_MTU))); | 269 | !(dst_metric_locked(dst, RTAX_MTU))); |
| 263 | } | 270 | } |
| 264 | 271 | ||
| 265 | extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); | 272 | void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); |
| 266 | 273 | ||
| 267 | static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) | 274 | static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) |
| 268 | { | 275 | { |
| @@ -367,7 +374,7 @@ static __inline__ void inet_reset_saddr(struct sock *sk) | |||
| 367 | struct ipv6_pinfo *np = inet6_sk(sk); | 374 | struct ipv6_pinfo *np = inet6_sk(sk); |
| 368 | 375 | ||
| 369 | memset(&np->saddr, 0, sizeof(np->saddr)); | 376 | memset(&np->saddr, 0, sizeof(np->saddr)); |
| 370 | memset(&np->rcv_saddr, 0, sizeof(np->rcv_saddr)); | 377 | memset(&sk->sk_v6_rcv_saddr, 0, sizeof(sk->sk_v6_rcv_saddr)); |
| 371 | } | 378 | } |
| 372 | #endif | 379 | #endif |
| 373 | } | 380 | } |
| @@ -390,7 +397,7 @@ static inline int sk_mc_loop(struct sock *sk) | |||
| 390 | return 1; | 397 | return 1; |
| 391 | } | 398 | } |
| 392 | 399 | ||
| 393 | extern bool ip_call_ra_chain(struct sk_buff *skb); | 400 | bool ip_call_ra_chain(struct sk_buff *skb); |
| 394 | 401 | ||
| 395 | /* | 402 | /* |
| 396 | * Functions provided by ip_fragment.c | 403 | * Functions provided by ip_fragment.c |
| @@ -428,50 +435,52 @@ int ip_frag_nqueues(struct net *net); | |||
| 428 | * Functions provided by ip_forward.c | 435 | * Functions provided by ip_forward.c |
| 429 | */ | 436 | */ |
| 430 | 437 | ||
| 431 | extern int ip_forward(struct sk_buff *skb); | 438 | int ip_forward(struct sk_buff *skb); |
| 432 | 439 | ||
| 433 | /* | 440 | /* |
| 434 | * Functions provided by ip_options.c | 441 | * Functions provided by ip_options.c |
| 435 | */ | 442 | */ |
| 436 | 443 | ||
| 437 | extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, | 444 | void ip_options_build(struct sk_buff *skb, struct ip_options *opt, |
| 438 | __be32 daddr, struct rtable *rt, int is_frag); | 445 | __be32 daddr, struct rtable *rt, int is_frag); |
| 439 | extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb); | 446 | int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb); |
| 440 | extern void ip_options_fragment(struct sk_buff *skb); | 447 | void ip_options_fragment(struct sk_buff *skb); |
| 441 | extern int ip_options_compile(struct net *net, | 448 | int ip_options_compile(struct net *net, struct ip_options *opt, |
| 442 | struct ip_options *opt, struct sk_buff *skb); | 449 | struct sk_buff *skb); |
| 443 | extern int ip_options_get(struct net *net, struct ip_options_rcu **optp, | 450 | int ip_options_get(struct net *net, struct ip_options_rcu **optp, |
| 444 | unsigned char *data, int optlen); | 451 | unsigned char *data, int optlen); |
| 445 | extern int ip_options_get_from_user(struct net *net, struct ip_options_rcu **optp, | 452 | int ip_options_get_from_user(struct net *net, struct ip_options_rcu **optp, |
| 446 | unsigned char __user *data, int optlen); | 453 | unsigned char __user *data, int optlen); |
| 447 | extern void ip_options_undo(struct ip_options * opt); | 454 | void ip_options_undo(struct ip_options *opt); |
| 448 | extern void ip_forward_options(struct sk_buff *skb); | 455 | void ip_forward_options(struct sk_buff *skb); |
| 449 | extern int ip_options_rcv_srr(struct sk_buff *skb); | 456 | int ip_options_rcv_srr(struct sk_buff *skb); |
| 450 | 457 | ||
| 451 | /* | 458 | /* |
| 452 | * Functions provided by ip_sockglue.c | 459 | * Functions provided by ip_sockglue.c |
| 453 | */ | 460 | */ |
| 454 | 461 | ||
| 455 | extern void ipv4_pktinfo_prepare(struct sk_buff *skb); | 462 | void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb); |
| 456 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | 463 | void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); |
| 457 | extern int ip_cmsg_send(struct net *net, | 464 | int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc); |
| 458 | struct msghdr *msg, struct ipcm_cookie *ipc); | 465 | int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, |
| 459 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen); | 466 | unsigned int optlen); |
| 460 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); | 467 | int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, |
| 461 | extern int compat_ip_setsockopt(struct sock *sk, int level, | 468 | int __user *optlen); |
| 462 | int optname, char __user *optval, unsigned int optlen); | 469 | int compat_ip_setsockopt(struct sock *sk, int level, int optname, |
| 463 | extern int compat_ip_getsockopt(struct sock *sk, int level, | 470 | char __user *optval, unsigned int optlen); |
| 464 | int optname, char __user *optval, int __user *optlen); | 471 | int compat_ip_getsockopt(struct sock *sk, int level, int optname, |
| 465 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); | 472 | char __user *optval, int __user *optlen); |
| 466 | 473 | int ip_ra_control(struct sock *sk, unsigned char on, | |
| 467 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 474 | void (*destructor)(struct sock *)); |
| 468 | extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | 475 | |
| 469 | __be16 port, u32 info, u8 *payload); | 476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); |
| 470 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
| 471 | u32 info); | 478 | u32 info, u8 *payload); |
| 479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | ||
| 480 | u32 info); | ||
| 472 | 481 | ||
| 473 | #ifdef CONFIG_PROC_FS | 482 | #ifdef CONFIG_PROC_FS |
| 474 | extern int ip_misc_proc_init(void); | 483 | int ip_misc_proc_init(void); |
| 475 | #endif | 484 | #endif |
| 476 | 485 | ||
| 477 | #endif /* _IP_H */ | 486 | #endif /* _IP_H */ |
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h index 7686e3f5033d..9e3c540c1b11 100644 --- a/include/net/ip6_checksum.h +++ b/include/net/ip6_checksum.h | |||
| @@ -66,12 +66,14 @@ static inline void __tcp_v6_send_check(struct sk_buff *skb, | |||
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 69 | static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb) | 70 | static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb) |
| 70 | { | 71 | { |
| 71 | struct ipv6_pinfo *np = inet6_sk(sk); | 72 | struct ipv6_pinfo *np = inet6_sk(sk); |
| 72 | 73 | ||
| 73 | __tcp_v6_send_check(skb, &np->saddr, &np->daddr); | 74 | __tcp_v6_send_check(skb, &np->saddr, &sk->sk_v6_daddr); |
| 74 | } | 75 | } |
| 76 | #endif | ||
| 75 | 77 | ||
| 76 | int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto); | 78 | int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto); |
| 77 | #endif | 79 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 48ec25a7fcb6..2182525e4d74 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -165,6 +165,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | |||
| 165 | static inline void rt6_clean_expires(struct rt6_info *rt) | 165 | static inline void rt6_clean_expires(struct rt6_info *rt) |
| 166 | { | 166 | { |
| 167 | rt->rt6i_flags &= ~RTF_EXPIRES; | 167 | rt->rt6i_flags &= ~RTF_EXPIRES; |
| 168 | rt->dst.expires = 0; | ||
| 168 | } | 169 | } |
| 169 | 170 | ||
| 170 | static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) | 171 | static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) |
| @@ -267,48 +268,39 @@ typedef struct rt6_info *(*pol_lookup_t)(struct net *, | |||
| 267 | * exported functions | 268 | * exported functions |
| 268 | */ | 269 | */ |
| 269 | 270 | ||
| 270 | extern struct fib6_table *fib6_get_table(struct net *net, u32 id); | 271 | struct fib6_table *fib6_get_table(struct net *net, u32 id); |
| 271 | extern struct fib6_table *fib6_new_table(struct net *net, u32 id); | 272 | struct fib6_table *fib6_new_table(struct net *net, u32 id); |
| 272 | extern struct dst_entry *fib6_rule_lookup(struct net *net, | 273 | struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6, |
| 273 | struct flowi6 *fl6, int flags, | 274 | int flags, pol_lookup_t lookup); |
| 274 | pol_lookup_t lookup); | ||
| 275 | 275 | ||
| 276 | extern struct fib6_node *fib6_lookup(struct fib6_node *root, | 276 | struct fib6_node *fib6_lookup(struct fib6_node *root, |
| 277 | const struct in6_addr *daddr, | 277 | const struct in6_addr *daddr, |
| 278 | const struct in6_addr *saddr); | 278 | const struct in6_addr *saddr); |
| 279 | 279 | ||
| 280 | struct fib6_node *fib6_locate(struct fib6_node *root, | 280 | struct fib6_node *fib6_locate(struct fib6_node *root, |
| 281 | const struct in6_addr *daddr, int dst_len, | 281 | const struct in6_addr *daddr, int dst_len, |
| 282 | const struct in6_addr *saddr, int src_len); | 282 | const struct in6_addr *saddr, int src_len); |
| 283 | 283 | ||
| 284 | extern void fib6_clean_all_ro(struct net *net, | 284 | void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), |
| 285 | int (*func)(struct rt6_info *, void *arg), | 285 | int prune, void *arg); |
| 286 | int prune, void *arg); | ||
| 287 | 286 | ||
| 288 | extern void fib6_clean_all(struct net *net, | 287 | int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info); |
| 289 | int (*func)(struct rt6_info *, void *arg), | ||
| 290 | int prune, void *arg); | ||
| 291 | 288 | ||
| 292 | extern int fib6_add(struct fib6_node *root, | 289 | int fib6_del(struct rt6_info *rt, struct nl_info *info); |
| 293 | struct rt6_info *rt, | ||
| 294 | struct nl_info *info); | ||
| 295 | 290 | ||
| 296 | extern int fib6_del(struct rt6_info *rt, | 291 | void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info); |
| 297 | struct nl_info *info); | ||
| 298 | 292 | ||
| 299 | extern void inet6_rt_notify(int event, struct rt6_info *rt, | 293 | void fib6_run_gc(unsigned long expires, struct net *net, bool force); |
| 300 | struct nl_info *info); | ||
| 301 | 294 | ||
| 302 | extern void fib6_run_gc(unsigned long expires, | 295 | void fib6_gc_cleanup(void); |
| 303 | struct net *net, bool force); | ||
| 304 | 296 | ||
| 305 | extern void fib6_gc_cleanup(void); | 297 | int fib6_init(void); |
| 306 | 298 | ||
| 307 | extern int fib6_init(void); | 299 | int ipv6_route_open(struct inode *inode, struct file *file); |
| 308 | 300 | ||
| 309 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 301 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
| 310 | extern int fib6_rules_init(void); | 302 | int fib6_rules_init(void); |
| 311 | extern void fib6_rules_cleanup(void); | 303 | void fib6_rules_cleanup(void); |
| 312 | #else | 304 | #else |
| 313 | static inline int fib6_rules_init(void) | 305 | static inline int fib6_rules_init(void) |
| 314 | { | 306 | { |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 2b786b7e3585..733747ce163c 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -51,7 +51,7 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
| 51 | return (flags >> 3) & 7; | 51 | return (flags >> 3) & 7; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | extern void rt6_bind_peer(struct rt6_info *rt, int create); | 54 | void rt6_bind_peer(struct rt6_info *rt, int create); |
| 55 | 55 | ||
| 56 | static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create) | 56 | static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create) |
| 57 | { | 57 | { |
| @@ -72,70 +72,58 @@ static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt) | |||
| 72 | return __rt6_get_peer(rt, 1); | 72 | return __rt6_get_peer(rt, 1); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | extern void ip6_route_input(struct sk_buff *skb); | 75 | void ip6_route_input(struct sk_buff *skb); |
| 76 | 76 | ||
| 77 | extern struct dst_entry * ip6_route_output(struct net *net, | 77 | struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk, |
| 78 | const struct sock *sk, | 78 | struct flowi6 *fl6); |
| 79 | struct flowi6 *fl6); | 79 | struct dst_entry *ip6_route_lookup(struct net *net, struct flowi6 *fl6, |
| 80 | extern struct dst_entry * ip6_route_lookup(struct net *net, | 80 | int flags); |
| 81 | struct flowi6 *fl6, int flags); | ||
| 82 | 81 | ||
| 83 | extern int ip6_route_init(void); | 82 | int ip6_route_init(void); |
| 84 | extern void ip6_route_cleanup(void); | 83 | void ip6_route_cleanup(void); |
| 85 | 84 | ||
| 86 | extern int ipv6_route_ioctl(struct net *net, | 85 | int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg); |
| 87 | unsigned int cmd, | ||
| 88 | void __user *arg); | ||
| 89 | 86 | ||
| 90 | extern int ip6_route_add(struct fib6_config *cfg); | 87 | int ip6_route_add(struct fib6_config *cfg); |
| 91 | extern int ip6_ins_rt(struct rt6_info *); | 88 | int ip6_ins_rt(struct rt6_info *); |
| 92 | extern int ip6_del_rt(struct rt6_info *); | 89 | int ip6_del_rt(struct rt6_info *); |
| 93 | 90 | ||
| 94 | extern int ip6_route_get_saddr(struct net *net, | 91 | int ip6_route_get_saddr(struct net *net, struct rt6_info *rt, |
| 95 | struct rt6_info *rt, | 92 | const struct in6_addr *daddr, unsigned int prefs, |
| 96 | const struct in6_addr *daddr, | 93 | struct in6_addr *saddr); |
| 97 | unsigned int prefs, | ||
| 98 | struct in6_addr *saddr); | ||
| 99 | 94 | ||
| 100 | extern struct rt6_info *rt6_lookup(struct net *net, | 95 | struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr, |
| 101 | const struct in6_addr *daddr, | 96 | const struct in6_addr *saddr, int oif, int flags); |
| 102 | const struct in6_addr *saddr, | ||
| 103 | int oif, int flags); | ||
| 104 | 97 | ||
| 105 | extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | 98 | struct dst_entry *icmp6_dst_alloc(struct net_device *dev, struct flowi6 *fl6); |
| 106 | struct flowi6 *fl6); | 99 | int icmp6_dst_gc(void); |
| 107 | extern int icmp6_dst_gc(void); | ||
| 108 | 100 | ||
| 109 | extern void fib6_force_start_gc(struct net *net); | 101 | void fib6_force_start_gc(struct net *net); |
| 110 | 102 | ||
| 111 | extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | 103 | struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, |
| 112 | const struct in6_addr *addr, | 104 | const struct in6_addr *addr, bool anycast); |
| 113 | bool anycast); | ||
| 114 | 105 | ||
| 115 | /* | 106 | /* |
| 116 | * support functions for ND | 107 | * support functions for ND |
| 117 | * | 108 | * |
| 118 | */ | 109 | */ |
| 119 | extern struct rt6_info * rt6_get_dflt_router(const struct in6_addr *addr, | 110 | struct rt6_info *rt6_get_dflt_router(const struct in6_addr *addr, |
| 120 | struct net_device *dev); | 111 | struct net_device *dev); |
| 121 | extern struct rt6_info * rt6_add_dflt_router(const struct in6_addr *gwaddr, | 112 | struct rt6_info *rt6_add_dflt_router(const struct in6_addr *gwaddr, |
| 122 | struct net_device *dev, | 113 | struct net_device *dev, unsigned int pref); |
| 123 | unsigned int pref); | 114 | |
| 124 | 115 | void rt6_purge_dflt_routers(struct net *net); | |
| 125 | extern void rt6_purge_dflt_routers(struct net *net); | 116 | |
| 126 | 117 | int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, | |
| 127 | extern int rt6_route_rcv(struct net_device *dev, | 118 | const struct in6_addr *gwaddr); |
| 128 | u8 *opt, int len, | 119 | |
| 129 | const struct in6_addr *gwaddr); | 120 | void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu, int oif, |
| 130 | 121 | u32 mark); | |
| 131 | extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu, | 122 | void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu); |
| 132 | int oif, u32 mark); | 123 | void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark); |
| 133 | extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, | 124 | void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif, |
| 134 | __be32 mtu); | 125 | u32 mark); |
| 135 | extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark); | 126 | void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk); |
| 136 | extern void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif, | ||
| 137 | u32 mark); | ||
| 138 | extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk); | ||
| 139 | 127 | ||
| 140 | struct netlink_callback; | 128 | struct netlink_callback; |
| 141 | 129 | ||
| @@ -145,10 +133,10 @@ struct rt6_rtnl_dump_arg { | |||
| 145 | struct net *net; | 133 | struct net *net; |
| 146 | }; | 134 | }; |
| 147 | 135 | ||
| 148 | extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); | 136 | int rt6_dump_route(struct rt6_info *rt, void *p_arg); |
| 149 | extern void rt6_ifdown(struct net *net, struct net_device *dev); | 137 | void rt6_ifdown(struct net *net, struct net_device *dev); |
| 150 | extern void rt6_mtu_change(struct net_device *dev, unsigned int mtu); | 138 | void rt6_mtu_change(struct net_device *dev, unsigned int mtu); |
| 151 | extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp); | 139 | void rt6_remove_prefsrc(struct inet6_ifaddr *ifp); |
| 152 | 140 | ||
| 153 | 141 | ||
| 154 | /* | 142 | /* |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index cbf2be37c91a..9922093f575e 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
| @@ -165,7 +165,7 @@ struct fib_result_nl { | |||
| 165 | #define FIB_TABLE_HASHSZ 2 | 165 | #define FIB_TABLE_HASHSZ 2 |
| 166 | #endif | 166 | #endif |
| 167 | 167 | ||
| 168 | extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); | 168 | __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); |
| 169 | 169 | ||
| 170 | #define FIB_RES_SADDR(net, res) \ | 170 | #define FIB_RES_SADDR(net, res) \ |
| 171 | ((FIB_RES_NH(res).nh_saddr_genid == \ | 171 | ((FIB_RES_NH(res).nh_saddr_genid == \ |
| @@ -187,14 +187,14 @@ struct fib_table { | |||
| 187 | unsigned long tb_data[0]; | 187 | unsigned long tb_data[0]; |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, | 190 | int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, |
| 191 | struct fib_result *res, int fib_flags); | 191 | struct fib_result *res, int fib_flags); |
| 192 | extern int fib_table_insert(struct fib_table *, struct fib_config *); | 192 | int fib_table_insert(struct fib_table *, struct fib_config *); |
| 193 | extern int fib_table_delete(struct fib_table *, struct fib_config *); | 193 | int fib_table_delete(struct fib_table *, struct fib_config *); |
| 194 | extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, | 194 | int fib_table_dump(struct fib_table *table, struct sk_buff *skb, |
| 195 | struct netlink_callback *cb); | 195 | struct netlink_callback *cb); |
| 196 | extern int fib_table_flush(struct fib_table *table); | 196 | int fib_table_flush(struct fib_table *table); |
| 197 | extern void fib_free_table(struct fib_table *tb); | 197 | void fib_free_table(struct fib_table *tb); |
| 198 | 198 | ||
| 199 | 199 | ||
| 200 | 200 | ||
| @@ -234,14 +234,13 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp, | |||
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | #else /* CONFIG_IP_MULTIPLE_TABLES */ | 236 | #else /* CONFIG_IP_MULTIPLE_TABLES */ |
| 237 | extern int __net_init fib4_rules_init(struct net *net); | 237 | int __net_init fib4_rules_init(struct net *net); |
| 238 | extern void __net_exit fib4_rules_exit(struct net *net); | 238 | void __net_exit fib4_rules_exit(struct net *net); |
| 239 | 239 | ||
| 240 | extern struct fib_table *fib_new_table(struct net *net, u32 id); | 240 | struct fib_table *fib_new_table(struct net *net, u32 id); |
| 241 | extern struct fib_table *fib_get_table(struct net *net, u32 id); | 241 | struct fib_table *fib_get_table(struct net *net, u32 id); |
| 242 | 242 | ||
| 243 | extern int __fib_lookup(struct net *net, struct flowi4 *flp, | 243 | int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res); |
| 244 | struct fib_result *res); | ||
| 245 | 244 | ||
| 246 | static inline int fib_lookup(struct net *net, struct flowi4 *flp, | 245 | static inline int fib_lookup(struct net *net, struct flowi4 *flp, |
| 247 | struct fib_result *res) | 246 | struct fib_result *res) |
| @@ -269,12 +268,12 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp, | |||
| 269 | 268 | ||
| 270 | /* Exported by fib_frontend.c */ | 269 | /* Exported by fib_frontend.c */ |
| 271 | extern const struct nla_policy rtm_ipv4_policy[]; | 270 | extern const struct nla_policy rtm_ipv4_policy[]; |
| 272 | extern void ip_fib_init(void); | 271 | void ip_fib_init(void); |
| 273 | extern __be32 fib_compute_spec_dst(struct sk_buff *skb); | 272 | __be32 fib_compute_spec_dst(struct sk_buff *skb); |
| 274 | extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, | 273 | int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, |
| 275 | u8 tos, int oif, struct net_device *dev, | 274 | u8 tos, int oif, struct net_device *dev, |
| 276 | struct in_device *idev, u32 *itag); | 275 | struct in_device *idev, u32 *itag); |
| 277 | extern void fib_select_default(struct fib_result *res); | 276 | void fib_select_default(struct fib_result *res); |
| 278 | #ifdef CONFIG_IP_ROUTE_CLASSID | 277 | #ifdef CONFIG_IP_ROUTE_CLASSID |
| 279 | static inline int fib_num_tclassid_users(struct net *net) | 278 | static inline int fib_num_tclassid_users(struct net *net) |
| 280 | { | 279 | { |
| @@ -288,15 +287,15 @@ static inline int fib_num_tclassid_users(struct net *net) | |||
| 288 | #endif | 287 | #endif |
| 289 | 288 | ||
| 290 | /* Exported by fib_semantics.c */ | 289 | /* Exported by fib_semantics.c */ |
| 291 | extern int ip_fib_check_default(__be32 gw, struct net_device *dev); | 290 | int ip_fib_check_default(__be32 gw, struct net_device *dev); |
| 292 | extern int fib_sync_down_dev(struct net_device *dev, int force); | 291 | int fib_sync_down_dev(struct net_device *dev, int force); |
| 293 | extern int fib_sync_down_addr(struct net *net, __be32 local); | 292 | int fib_sync_down_addr(struct net *net, __be32 local); |
| 294 | extern int fib_sync_up(struct net_device *dev); | 293 | int fib_sync_up(struct net_device *dev); |
| 295 | extern void fib_select_multipath(struct fib_result *res); | 294 | void fib_select_multipath(struct fib_result *res); |
| 296 | 295 | ||
| 297 | /* Exported by fib_trie.c */ | 296 | /* Exported by fib_trie.c */ |
| 298 | extern void fib_trie_init(void); | 297 | void fib_trie_init(void); |
| 299 | extern struct fib_table *fib_trie_table(u32 id); | 298 | struct fib_table *fib_trie_table(u32 id); |
| 300 | 299 | ||
| 301 | static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) | 300 | static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) |
| 302 | { | 301 | { |
| @@ -314,7 +313,7 @@ static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) | |||
| 314 | #endif | 313 | #endif |
| 315 | } | 314 | } |
| 316 | 315 | ||
| 317 | extern void free_fib_info(struct fib_info *fi); | 316 | void free_fib_info(struct fib_info *fi); |
| 318 | 317 | ||
| 319 | static inline void fib_info_put(struct fib_info *fi) | 318 | static inline void fib_info_put(struct fib_info *fi) |
| 320 | { | 319 | { |
| @@ -323,8 +322,8 @@ static inline void fib_info_put(struct fib_info *fi) | |||
| 323 | } | 322 | } |
| 324 | 323 | ||
| 325 | #ifdef CONFIG_PROC_FS | 324 | #ifdef CONFIG_PROC_FS |
| 326 | extern int __net_init fib_proc_init(struct net *net); | 325 | int __net_init fib_proc_init(struct net *net); |
| 327 | extern void __net_exit fib_proc_exit(struct net *net); | 326 | void __net_exit fib_proc_exit(struct net *net); |
| 328 | #else | 327 | #else |
| 329 | static inline int fib_proc_init(struct net *net) | 328 | static inline int fib_proc_init(struct net *net) |
| 330 | { | 329 | { |
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index a0a4a100f5c9..732f8c6ae975 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
| @@ -150,6 +150,9 @@ int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, | |||
| 150 | __be32 src, __be32 dst, __u8 proto, | 150 | __be32 src, __be32 dst, __u8 proto, |
| 151 | __u8 tos, __u8 ttl, __be16 df, bool xnet); | 151 | __u8 tos, __u8 ttl, __be16 df, bool xnet); |
| 152 | 152 | ||
| 153 | struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum, | ||
| 154 | int gso_type_mask); | ||
| 155 | |||
| 153 | static inline void iptunnel_xmit_stats(int err, | 156 | static inline void iptunnel_xmit_stats(int err, |
| 154 | struct net_device_stats *err_stats, | 157 | struct net_device_stats *err_stats, |
| 155 | struct pcpu_tstats __percpu *stats) | 158 | struct pcpu_tstats __percpu *stats) |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 9c4d37ec45a1..5679d927562b 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -109,7 +109,6 @@ extern int ip_vs_conn_tab_size; | |||
| 109 | struct ip_vs_iphdr { | 109 | struct ip_vs_iphdr { |
| 110 | __u32 len; /* IPv4 simply where L4 starts | 110 | __u32 len; /* IPv4 simply where L4 starts |
| 111 | IPv6 where L4 Transport Header starts */ | 111 | IPv6 where L4 Transport Header starts */ |
| 112 | __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */ | ||
| 113 | __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ | 112 | __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ |
| 114 | __s16 protocol; | 113 | __s16 protocol; |
| 115 | __s32 flags; | 114 | __s32 flags; |
| @@ -117,34 +116,12 @@ struct ip_vs_iphdr { | |||
| 117 | union nf_inet_addr daddr; | 116 | union nf_inet_addr daddr; |
| 118 | }; | 117 | }; |
| 119 | 118 | ||
| 120 | /* Dependency to module: nf_defrag_ipv6 */ | ||
| 121 | #if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
| 122 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
| 123 | { | ||
| 124 | return skb->nfct_reasm; | ||
| 125 | } | ||
| 126 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | 119 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, |
| 127 | int len, void *buffer, | 120 | int len, void *buffer, |
| 128 | const struct ip_vs_iphdr *ipvsh) | 121 | const struct ip_vs_iphdr *ipvsh) |
| 129 | { | 122 | { |
| 130 | if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb))) | ||
| 131 | return skb_header_pointer(skb_nfct_reasm(skb), | ||
| 132 | ipvsh->thoff_reasm, len, buffer); | ||
| 133 | |||
| 134 | return skb_header_pointer(skb, offset, len, buffer); | 123 | return skb_header_pointer(skb, offset, len, buffer); |
| 135 | } | 124 | } |
| 136 | #else | ||
| 137 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
| 138 | { | ||
| 139 | return NULL; | ||
| 140 | } | ||
| 141 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | ||
| 142 | int len, void *buffer, | ||
| 143 | const struct ip_vs_iphdr *ipvsh) | ||
| 144 | { | ||
| 145 | return skb_header_pointer(skb, offset, len, buffer); | ||
| 146 | } | ||
| 147 | #endif | ||
| 148 | 125 | ||
| 149 | static inline void | 126 | static inline void |
| 150 | ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) | 127 | ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) |
| @@ -171,19 +148,12 @@ ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr) | |||
| 171 | (struct ipv6hdr *)skb_network_header(skb); | 148 | (struct ipv6hdr *)skb_network_header(skb); |
| 172 | iphdr->saddr.in6 = iph->saddr; | 149 | iphdr->saddr.in6 = iph->saddr; |
| 173 | iphdr->daddr.in6 = iph->daddr; | 150 | iphdr->daddr.in6 = iph->daddr; |
| 174 | /* ipv6_find_hdr() updates len, flags, thoff_reasm */ | 151 | /* ipv6_find_hdr() updates len, flags */ |
| 175 | iphdr->thoff_reasm = 0; | ||
| 176 | iphdr->len = 0; | 152 | iphdr->len = 0; |
| 177 | iphdr->flags = 0; | 153 | iphdr->flags = 0; |
| 178 | iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, | 154 | iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, |
| 179 | &iphdr->fragoffs, | 155 | &iphdr->fragoffs, |
| 180 | &iphdr->flags); | 156 | &iphdr->flags); |
| 181 | /* get proto from re-assembled packet and it's offset */ | ||
| 182 | if (skb_nfct_reasm(skb)) | ||
| 183 | iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb), | ||
| 184 | &iphdr->thoff_reasm, | ||
| 185 | -1, NULL, NULL); | ||
| 186 | |||
| 187 | } else | 157 | } else |
| 188 | #endif | 158 | #endif |
| 189 | { | 159 | { |
| @@ -236,7 +206,7 @@ static inline int ip_vs_addr_equal(int af, const union nf_inet_addr *a, | |||
| 236 | #ifdef CONFIG_IP_VS_DEBUG | 206 | #ifdef CONFIG_IP_VS_DEBUG |
| 237 | #include <linux/net.h> | 207 | #include <linux/net.h> |
| 238 | 208 | ||
| 239 | extern int ip_vs_get_debug_level(void); | 209 | int ip_vs_get_debug_level(void); |
| 240 | 210 | ||
| 241 | static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | 211 | static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, |
| 242 | const union nf_inet_addr *addr, | 212 | const union nf_inet_addr *addr, |
| @@ -532,9 +502,9 @@ struct ip_vs_proto_data { | |||
| 532 | struct tcp_states_t *tcp_state_table; | 502 | struct tcp_states_t *tcp_state_table; |
| 533 | }; | 503 | }; |
| 534 | 504 | ||
| 535 | extern struct ip_vs_protocol *ip_vs_proto_get(unsigned short proto); | 505 | struct ip_vs_protocol *ip_vs_proto_get(unsigned short proto); |
| 536 | extern struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net, | 506 | struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net, |
| 537 | unsigned short proto); | 507 | unsigned short proto); |
| 538 | 508 | ||
| 539 | struct ip_vs_conn_param { | 509 | struct ip_vs_conn_param { |
| 540 | struct net *net; | 510 | struct net *net; |
| @@ -1173,8 +1143,8 @@ static inline int sysctl_backup_only(struct netns_ipvs *ipvs) | |||
| 1173 | * IPVS core functions | 1143 | * IPVS core functions |
| 1174 | * (from ip_vs_core.c) | 1144 | * (from ip_vs_core.c) |
| 1175 | */ | 1145 | */ |
| 1176 | extern const char *ip_vs_proto_name(unsigned int proto); | 1146 | const char *ip_vs_proto_name(unsigned int proto); |
| 1177 | extern void ip_vs_init_hash_table(struct list_head *table, int rows); | 1147 | void ip_vs_init_hash_table(struct list_head *table, int rows); |
| 1178 | #define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table((t), ARRAY_SIZE((t))) | 1148 | #define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table((t), ARRAY_SIZE((t))) |
| 1179 | 1149 | ||
| 1180 | #define IP_VS_APP_TYPE_FTP 1 | 1150 | #define IP_VS_APP_TYPE_FTP 1 |
| @@ -1237,22 +1207,22 @@ static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) | |||
| 1237 | smp_mb__before_atomic_dec(); | 1207 | smp_mb__before_atomic_dec(); |
| 1238 | atomic_dec(&cp->refcnt); | 1208 | atomic_dec(&cp->refcnt); |
| 1239 | } | 1209 | } |
| 1240 | extern void ip_vs_conn_put(struct ip_vs_conn *cp); | 1210 | void ip_vs_conn_put(struct ip_vs_conn *cp); |
| 1241 | extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); | 1211 | void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); |
| 1242 | 1212 | ||
| 1243 | struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, | 1213 | struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, |
| 1244 | const union nf_inet_addr *daddr, | 1214 | const union nf_inet_addr *daddr, |
| 1245 | __be16 dport, unsigned int flags, | 1215 | __be16 dport, unsigned int flags, |
| 1246 | struct ip_vs_dest *dest, __u32 fwmark); | 1216 | struct ip_vs_dest *dest, __u32 fwmark); |
| 1247 | extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); | 1217 | void ip_vs_conn_expire_now(struct ip_vs_conn *cp); |
| 1248 | 1218 | ||
| 1249 | extern const char * ip_vs_state_name(__u16 proto, int state); | 1219 | const char *ip_vs_state_name(__u16 proto, int state); |
| 1250 | 1220 | ||
| 1251 | extern void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp); | 1221 | void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp); |
| 1252 | extern int ip_vs_check_template(struct ip_vs_conn *ct); | 1222 | int ip_vs_check_template(struct ip_vs_conn *ct); |
| 1253 | extern void ip_vs_random_dropentry(struct net *net); | 1223 | void ip_vs_random_dropentry(struct net *net); |
| 1254 | extern int ip_vs_conn_init(void); | 1224 | int ip_vs_conn_init(void); |
| 1255 | extern void ip_vs_conn_cleanup(void); | 1225 | void ip_vs_conn_cleanup(void); |
| 1256 | 1226 | ||
| 1257 | static inline void ip_vs_control_del(struct ip_vs_conn *cp) | 1227 | static inline void ip_vs_control_del(struct ip_vs_conn *cp) |
| 1258 | { | 1228 | { |
| @@ -1317,37 +1287,36 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp) | |||
| 1317 | /* | 1287 | /* |
| 1318 | * IPVS netns init & cleanup functions | 1288 | * IPVS netns init & cleanup functions |
| 1319 | */ | 1289 | */ |
| 1320 | extern int ip_vs_estimator_net_init(struct net *net); | 1290 | int ip_vs_estimator_net_init(struct net *net); |
| 1321 | extern int ip_vs_control_net_init(struct net *net); | 1291 | int ip_vs_control_net_init(struct net *net); |
| 1322 | extern int ip_vs_protocol_net_init(struct net *net); | 1292 | int ip_vs_protocol_net_init(struct net *net); |
| 1323 | extern int ip_vs_app_net_init(struct net *net); | 1293 | int ip_vs_app_net_init(struct net *net); |
| 1324 | extern int ip_vs_conn_net_init(struct net *net); | 1294 | int ip_vs_conn_net_init(struct net *net); |
| 1325 | extern int ip_vs_sync_net_init(struct net *net); | 1295 | int ip_vs_sync_net_init(struct net *net); |
| 1326 | extern void ip_vs_conn_net_cleanup(struct net *net); | 1296 | void ip_vs_conn_net_cleanup(struct net *net); |
| 1327 | extern void ip_vs_app_net_cleanup(struct net *net); | 1297 | void ip_vs_app_net_cleanup(struct net *net); |
| 1328 | extern void ip_vs_protocol_net_cleanup(struct net *net); | 1298 | void ip_vs_protocol_net_cleanup(struct net *net); |
| 1329 | extern void ip_vs_control_net_cleanup(struct net *net); | 1299 | void ip_vs_control_net_cleanup(struct net *net); |
| 1330 | extern void ip_vs_estimator_net_cleanup(struct net *net); | 1300 | void ip_vs_estimator_net_cleanup(struct net *net); |
| 1331 | extern void ip_vs_sync_net_cleanup(struct net *net); | 1301 | void ip_vs_sync_net_cleanup(struct net *net); |
| 1332 | extern void ip_vs_service_net_cleanup(struct net *net); | 1302 | void ip_vs_service_net_cleanup(struct net *net); |
| 1333 | 1303 | ||
| 1334 | /* | 1304 | /* |
| 1335 | * IPVS application functions | 1305 | * IPVS application functions |
| 1336 | * (from ip_vs_app.c) | 1306 | * (from ip_vs_app.c) |
| 1337 | */ | 1307 | */ |
| 1338 | #define IP_VS_APP_MAX_PORTS 8 | 1308 | #define IP_VS_APP_MAX_PORTS 8 |
| 1339 | extern struct ip_vs_app *register_ip_vs_app(struct net *net, | 1309 | struct ip_vs_app *register_ip_vs_app(struct net *net, struct ip_vs_app *app); |
| 1340 | struct ip_vs_app *app); | 1310 | void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); |
| 1341 | extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); | 1311 | int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); |
| 1342 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1312 | void ip_vs_unbind_app(struct ip_vs_conn *cp); |
| 1343 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); | 1313 | int register_ip_vs_app_inc(struct net *net, struct ip_vs_app *app, __u16 proto, |
| 1344 | extern int register_ip_vs_app_inc(struct net *net, struct ip_vs_app *app, | 1314 | __u16 port); |
| 1345 | __u16 proto, __u16 port); | 1315 | int ip_vs_app_inc_get(struct ip_vs_app *inc); |
| 1346 | extern int ip_vs_app_inc_get(struct ip_vs_app *inc); | 1316 | void ip_vs_app_inc_put(struct ip_vs_app *inc); |
| 1347 | extern void ip_vs_app_inc_put(struct ip_vs_app *inc); | 1317 | |
| 1348 | 1318 | int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); | |
| 1349 | extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); | 1319 | int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); |
| 1350 | extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); | ||
| 1351 | 1320 | ||
| 1352 | int register_ip_vs_pe(struct ip_vs_pe *pe); | 1321 | int register_ip_vs_pe(struct ip_vs_pe *pe); |
| 1353 | int unregister_ip_vs_pe(struct ip_vs_pe *pe); | 1322 | int unregister_ip_vs_pe(struct ip_vs_pe *pe); |
| @@ -1368,17 +1337,15 @@ struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name); | |||
| 1368 | /* | 1337 | /* |
| 1369 | * IPVS protocol functions (from ip_vs_proto.c) | 1338 | * IPVS protocol functions (from ip_vs_proto.c) |
| 1370 | */ | 1339 | */ |
| 1371 | extern int ip_vs_protocol_init(void); | 1340 | int ip_vs_protocol_init(void); |
| 1372 | extern void ip_vs_protocol_cleanup(void); | 1341 | void ip_vs_protocol_cleanup(void); |
| 1373 | extern void ip_vs_protocol_timeout_change(struct netns_ipvs *ipvs, int flags); | 1342 | void ip_vs_protocol_timeout_change(struct netns_ipvs *ipvs, int flags); |
| 1374 | extern int *ip_vs_create_timeout_table(int *table, int size); | 1343 | int *ip_vs_create_timeout_table(int *table, int size); |
| 1375 | extern int | 1344 | int ip_vs_set_state_timeout(int *table, int num, const char *const *names, |
| 1376 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, | 1345 | const char *name, int to); |
| 1377 | const char *name, int to); | 1346 | void ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp, |
| 1378 | extern void | 1347 | const struct sk_buff *skb, int offset, |
| 1379 | ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp, | 1348 | const char *msg); |
| 1380 | const struct sk_buff *skb, | ||
| 1381 | int offset, const char *msg); | ||
| 1382 | 1349 | ||
| 1383 | extern struct ip_vs_protocol ip_vs_protocol_tcp; | 1350 | extern struct ip_vs_protocol ip_vs_protocol_tcp; |
| 1384 | extern struct ip_vs_protocol ip_vs_protocol_udp; | 1351 | extern struct ip_vs_protocol ip_vs_protocol_udp; |
| @@ -1391,22 +1358,22 @@ extern struct ip_vs_protocol ip_vs_protocol_sctp; | |||
| 1391 | * Registering/unregistering scheduler functions | 1358 | * Registering/unregistering scheduler functions |
| 1392 | * (from ip_vs_sched.c) | 1359 | * (from ip_vs_sched.c) |
| 1393 | */ | 1360 | */ |
| 1394 | extern int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler); | 1361 | int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler); |
| 1395 | extern int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler); | 1362 | int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler); |
| 1396 | extern int ip_vs_bind_scheduler(struct ip_vs_service *svc, | 1363 | int ip_vs_bind_scheduler(struct ip_vs_service *svc, |
| 1397 | struct ip_vs_scheduler *scheduler); | 1364 | struct ip_vs_scheduler *scheduler); |
| 1398 | extern void ip_vs_unbind_scheduler(struct ip_vs_service *svc, | 1365 | void ip_vs_unbind_scheduler(struct ip_vs_service *svc, |
| 1399 | struct ip_vs_scheduler *sched); | 1366 | struct ip_vs_scheduler *sched); |
| 1400 | extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); | 1367 | struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); |
| 1401 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); | 1368 | void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); |
| 1402 | extern struct ip_vs_conn * | 1369 | struct ip_vs_conn * |
| 1403 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | 1370 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, |
| 1404 | struct ip_vs_proto_data *pd, int *ignored, | 1371 | struct ip_vs_proto_data *pd, int *ignored, |
| 1405 | struct ip_vs_iphdr *iph); | 1372 | struct ip_vs_iphdr *iph); |
| 1406 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 1373 | int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
| 1407 | struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph); | 1374 | struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph); |
| 1408 | 1375 | ||
| 1409 | extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); | 1376 | void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); |
| 1410 | 1377 | ||
| 1411 | 1378 | ||
| 1412 | /* | 1379 | /* |
| @@ -1415,25 +1382,24 @@ extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); | |||
| 1415 | extern struct ip_vs_stats ip_vs_stats; | 1382 | extern struct ip_vs_stats ip_vs_stats; |
| 1416 | extern int sysctl_ip_vs_sync_ver; | 1383 | extern int sysctl_ip_vs_sync_ver; |
| 1417 | 1384 | ||
| 1418 | extern struct ip_vs_service * | 1385 | struct ip_vs_service * |
| 1419 | ip_vs_service_find(struct net *net, int af, __u32 fwmark, __u16 protocol, | 1386 | ip_vs_service_find(struct net *net, int af, __u32 fwmark, __u16 protocol, |
| 1420 | const union nf_inet_addr *vaddr, __be16 vport); | 1387 | const union nf_inet_addr *vaddr, __be16 vport); |
| 1421 | 1388 | ||
| 1422 | extern bool | 1389 | bool ip_vs_has_real_service(struct net *net, int af, __u16 protocol, |
| 1423 | ip_vs_has_real_service(struct net *net, int af, __u16 protocol, | 1390 | const union nf_inet_addr *daddr, __be16 dport); |
| 1424 | const union nf_inet_addr *daddr, __be16 dport); | 1391 | |
| 1425 | 1392 | int ip_vs_use_count_inc(void); | |
| 1426 | extern int ip_vs_use_count_inc(void); | 1393 | void ip_vs_use_count_dec(void); |
| 1427 | extern void ip_vs_use_count_dec(void); | 1394 | int ip_vs_register_nl_ioctl(void); |
| 1428 | extern int ip_vs_register_nl_ioctl(void); | 1395 | void ip_vs_unregister_nl_ioctl(void); |
| 1429 | extern void ip_vs_unregister_nl_ioctl(void); | 1396 | int ip_vs_control_init(void); |
| 1430 | extern int ip_vs_control_init(void); | 1397 | void ip_vs_control_cleanup(void); |
| 1431 | extern void ip_vs_control_cleanup(void); | 1398 | struct ip_vs_dest * |
| 1432 | extern struct ip_vs_dest * | ||
| 1433 | ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr, | 1399 | ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr, |
| 1434 | __be16 dport, const union nf_inet_addr *vaddr, __be16 vport, | 1400 | __be16 dport, const union nf_inet_addr *vaddr, __be16 vport, |
| 1435 | __u16 protocol, __u32 fwmark, __u32 flags); | 1401 | __u16 protocol, __u32 fwmark, __u32 flags); |
| 1436 | extern void ip_vs_try_bind_dest(struct ip_vs_conn *cp); | 1402 | void ip_vs_try_bind_dest(struct ip_vs_conn *cp); |
| 1437 | 1403 | ||
| 1438 | static inline void ip_vs_dest_hold(struct ip_vs_dest *dest) | 1404 | static inline void ip_vs_dest_hold(struct ip_vs_dest *dest) |
| 1439 | { | 1405 | { |
| @@ -1446,60 +1412,59 @@ static inline void ip_vs_dest_put(struct ip_vs_dest *dest) | |||
| 1446 | atomic_dec(&dest->refcnt); | 1412 | atomic_dec(&dest->refcnt); |
| 1447 | } | 1413 | } |
| 1448 | 1414 | ||
| 1415 | static inline void ip_vs_dest_put_and_free(struct ip_vs_dest *dest) | ||
| 1416 | { | ||
| 1417 | if (atomic_dec_return(&dest->refcnt) < 0) | ||
| 1418 | kfree(dest); | ||
| 1419 | } | ||
| 1420 | |||
| 1449 | /* | 1421 | /* |
| 1450 | * IPVS sync daemon data and function prototypes | 1422 | * IPVS sync daemon data and function prototypes |
| 1451 | * (from ip_vs_sync.c) | 1423 | * (from ip_vs_sync.c) |
| 1452 | */ | 1424 | */ |
| 1453 | extern int start_sync_thread(struct net *net, int state, char *mcast_ifn, | 1425 | int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid); |
| 1454 | __u8 syncid); | 1426 | int stop_sync_thread(struct net *net, int state); |
| 1455 | extern int stop_sync_thread(struct net *net, int state); | 1427 | void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts); |
| 1456 | extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts); | ||
| 1457 | |||
| 1458 | 1428 | ||
| 1459 | /* | 1429 | /* |
| 1460 | * IPVS rate estimator prototypes (from ip_vs_est.c) | 1430 | * IPVS rate estimator prototypes (from ip_vs_est.c) |
| 1461 | */ | 1431 | */ |
| 1462 | extern void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats); | 1432 | void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats); |
| 1463 | extern void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats); | 1433 | void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats); |
| 1464 | extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); | 1434 | void ip_vs_zero_estimator(struct ip_vs_stats *stats); |
| 1465 | extern void ip_vs_read_estimator(struct ip_vs_stats_user *dst, | 1435 | void ip_vs_read_estimator(struct ip_vs_stats_user *dst, |
| 1466 | struct ip_vs_stats *stats); | 1436 | struct ip_vs_stats *stats); |
| 1467 | 1437 | ||
| 1468 | /* | 1438 | /* |
| 1469 | * Various IPVS packet transmitters (from ip_vs_xmit.c) | 1439 | * Various IPVS packet transmitters (from ip_vs_xmit.c) |
| 1470 | */ | 1440 | */ |
| 1471 | extern int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | 1441 | int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1472 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); | 1442 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1473 | extern int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | 1443 | int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1474 | struct ip_vs_protocol *pp, | 1444 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1475 | struct ip_vs_iphdr *iph); | 1445 | int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1476 | extern int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | 1446 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1477 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); | 1447 | int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1478 | extern int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | 1448 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1479 | struct ip_vs_protocol *pp, | 1449 | int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1480 | struct ip_vs_iphdr *iph); | 1450 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1481 | extern int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | 1451 | int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1482 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); | 1452 | struct ip_vs_protocol *pp, int offset, |
| 1483 | extern int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | 1453 | unsigned int hooknum, struct ip_vs_iphdr *iph); |
| 1484 | struct ip_vs_protocol *pp, int offset, | 1454 | void ip_vs_dest_dst_rcu_free(struct rcu_head *head); |
| 1485 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
| 1486 | extern void ip_vs_dest_dst_rcu_free(struct rcu_head *head); | ||
| 1487 | 1455 | ||
| 1488 | #ifdef CONFIG_IP_VS_IPV6 | 1456 | #ifdef CONFIG_IP_VS_IPV6 |
| 1489 | extern int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | 1457 | int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1490 | struct ip_vs_protocol *pp, | 1458 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1491 | struct ip_vs_iphdr *iph); | 1459 | int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1492 | extern int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | 1460 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1493 | struct ip_vs_protocol *pp, | 1461 | int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1494 | struct ip_vs_iphdr *iph); | 1462 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1495 | extern int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | 1463 | int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1496 | struct ip_vs_protocol *pp, | 1464 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
| 1497 | struct ip_vs_iphdr *iph); | 1465 | int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1498 | extern int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | 1466 | struct ip_vs_protocol *pp, int offset, |
| 1499 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); | 1467 | unsigned int hooknum, struct ip_vs_iphdr *iph); |
| 1500 | extern int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | ||
| 1501 | struct ip_vs_protocol *pp, int offset, | ||
| 1502 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
| 1503 | #endif | 1468 | #endif |
| 1504 | 1469 | ||
| 1505 | #ifdef CONFIG_SYSCTL | 1470 | #ifdef CONFIG_SYSCTL |
| @@ -1548,15 +1513,15 @@ static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp) | |||
| 1548 | return fwd; | 1513 | return fwd; |
| 1549 | } | 1514 | } |
| 1550 | 1515 | ||
| 1551 | extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, | 1516 | void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, |
| 1552 | struct ip_vs_conn *cp, int dir); | 1517 | struct ip_vs_conn *cp, int dir); |
| 1553 | 1518 | ||
| 1554 | #ifdef CONFIG_IP_VS_IPV6 | 1519 | #ifdef CONFIG_IP_VS_IPV6 |
| 1555 | extern void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp, | 1520 | void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp, |
| 1556 | struct ip_vs_conn *cp, int dir); | 1521 | struct ip_vs_conn *cp, int dir); |
| 1557 | #endif | 1522 | #endif |
| 1558 | 1523 | ||
| 1559 | extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); | 1524 | __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); |
| 1560 | 1525 | ||
| 1561 | static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum) | 1526 | static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum) |
| 1562 | { | 1527 | { |
| @@ -1615,13 +1580,13 @@ static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) | |||
| 1615 | #endif | 1580 | #endif |
| 1616 | } | 1581 | } |
| 1617 | 1582 | ||
| 1618 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, | 1583 | void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 1619 | int outin); | 1584 | int outin); |
| 1620 | extern int ip_vs_confirm_conntrack(struct sk_buff *skb); | 1585 | int ip_vs_confirm_conntrack(struct sk_buff *skb); |
| 1621 | extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, | 1586 | void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, |
| 1622 | struct ip_vs_conn *cp, u_int8_t proto, | 1587 | struct ip_vs_conn *cp, u_int8_t proto, |
| 1623 | const __be16 port, int from_rs); | 1588 | const __be16 port, int from_rs); |
| 1624 | extern void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp); | 1589 | void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp); |
| 1625 | 1590 | ||
| 1626 | #else | 1591 | #else |
| 1627 | 1592 | ||
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index bbf1c8fb8511..2a5f668cd683 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -244,14 +244,15 @@ struct ipv6_fl_socklist { | |||
| 244 | struct rcu_head rcu; | 244 | struct rcu_head rcu; |
| 245 | }; | 245 | }; |
| 246 | 246 | ||
| 247 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); | 247 | struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); |
| 248 | extern struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, | 248 | struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space, |
| 249 | struct ip6_flowlabel * fl, | 249 | struct ip6_flowlabel *fl, |
| 250 | struct ipv6_txoptions * fopt); | 250 | struct ipv6_txoptions *fopt); |
| 251 | extern void fl6_free_socklist(struct sock *sk); | 251 | void fl6_free_socklist(struct sock *sk); |
| 252 | extern int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen); | 252 | int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen); |
| 253 | extern int ip6_flowlabel_init(void); | 253 | int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq); |
| 254 | extern void ip6_flowlabel_cleanup(void); | 254 | int ip6_flowlabel_init(void); |
| 255 | void ip6_flowlabel_cleanup(void); | ||
| 255 | 256 | ||
| 256 | static inline void fl6_sock_release(struct ip6_flowlabel *fl) | 257 | static inline void fl6_sock_release(struct ip6_flowlabel *fl) |
| 257 | { | 258 | { |
| @@ -259,7 +260,7 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl) | |||
| 259 | atomic_dec(&fl->users); | 260 | atomic_dec(&fl->users); |
| 260 | } | 261 | } |
| 261 | 262 | ||
| 262 | extern void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info); | 263 | void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info); |
| 263 | 264 | ||
| 264 | int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, | 265 | int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, |
| 265 | struct icmp6hdr *thdr, int len); | 266 | struct icmp6hdr *thdr, int len); |
| @@ -267,19 +268,21 @@ int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, | |||
| 267 | struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb, | 268 | struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb, |
| 268 | struct sock *sk, struct flowi6 *fl6); | 269 | struct sock *sk, struct flowi6 *fl6); |
| 269 | 270 | ||
| 270 | extern int ip6_ra_control(struct sock *sk, int sel); | 271 | int ip6_ra_control(struct sock *sk, int sel); |
| 271 | 272 | ||
| 272 | extern int ipv6_parse_hopopts(struct sk_buff *skb); | 273 | int ipv6_parse_hopopts(struct sk_buff *skb); |
| 273 | 274 | ||
| 274 | extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); | 275 | struct ipv6_txoptions *ipv6_dup_options(struct sock *sk, |
| 275 | extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, | 276 | struct ipv6_txoptions *opt); |
| 276 | int newtype, | 277 | struct ipv6_txoptions *ipv6_renew_options(struct sock *sk, |
| 277 | struct ipv6_opt_hdr __user *newopt, | 278 | struct ipv6_txoptions *opt, |
| 278 | int newoptlen); | 279 | int newtype, |
| 280 | struct ipv6_opt_hdr __user *newopt, | ||
| 281 | int newoptlen); | ||
| 279 | struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, | 282 | struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, |
| 280 | struct ipv6_txoptions *opt); | 283 | struct ipv6_txoptions *opt); |
| 281 | 284 | ||
| 282 | extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); | 285 | bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); |
| 283 | 286 | ||
| 284 | static inline bool ipv6_accept_ra(struct inet6_dev *idev) | 287 | static inline bool ipv6_accept_ra(struct inet6_dev *idev) |
| 285 | { | 288 | { |
| @@ -306,7 +309,7 @@ static inline int ip6_frag_mem(struct net *net) | |||
| 306 | #define IPV6_FRAG_LOW_THRESH (3 * 1024*1024) /* 3145728 */ | 309 | #define IPV6_FRAG_LOW_THRESH (3 * 1024*1024) /* 3145728 */ |
| 307 | #define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */ | 310 | #define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */ |
| 308 | 311 | ||
| 309 | extern int __ipv6_addr_type(const struct in6_addr *addr); | 312 | int __ipv6_addr_type(const struct in6_addr *addr); |
| 310 | static inline int ipv6_addr_type(const struct in6_addr *addr) | 313 | static inline int ipv6_addr_type(const struct in6_addr *addr) |
| 311 | { | 314 | { |
| 312 | return __ipv6_addr_type(addr) & 0xffff; | 315 | return __ipv6_addr_type(addr) & 0xffff; |
| @@ -537,14 +540,14 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a) | |||
| 537 | } | 540 | } |
| 538 | 541 | ||
| 539 | /* more secured version of ipv6_addr_hash() */ | 542 | /* more secured version of ipv6_addr_hash() */ |
| 540 | static inline u32 ipv6_addr_jhash(const struct in6_addr *a) | 543 | static inline u32 __ipv6_addr_jhash(const struct in6_addr *a, const u32 initval) |
| 541 | { | 544 | { |
| 542 | u32 v = (__force u32)a->s6_addr32[0] ^ (__force u32)a->s6_addr32[1]; | 545 | u32 v = (__force u32)a->s6_addr32[0] ^ (__force u32)a->s6_addr32[1]; |
| 543 | 546 | ||
| 544 | return jhash_3words(v, | 547 | return jhash_3words(v, |
| 545 | (__force u32)a->s6_addr32[2], | 548 | (__force u32)a->s6_addr32[2], |
| 546 | (__force u32)a->s6_addr32[3], | 549 | (__force u32)a->s6_addr32[3], |
| 547 | ipv6_hash_secret); | 550 | initval); |
| 548 | } | 551 | } |
| 549 | 552 | ||
| 550 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) | 553 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) |
| @@ -656,9 +659,9 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add | |||
| 656 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); | 659 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); |
| 657 | } | 660 | } |
| 658 | 661 | ||
| 659 | extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); | 662 | void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); |
| 660 | 663 | ||
| 661 | extern int ip6_dst_hoplimit(struct dst_entry *dst); | 664 | int ip6_dst_hoplimit(struct dst_entry *dst); |
| 662 | 665 | ||
| 663 | /* | 666 | /* |
| 664 | * Header manipulation | 667 | * Header manipulation |
| @@ -682,83 +685,65 @@ static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr) | |||
| 682 | * rcv function (called from netdevice level) | 685 | * rcv function (called from netdevice level) |
| 683 | */ | 686 | */ |
| 684 | 687 | ||
| 685 | extern int ipv6_rcv(struct sk_buff *skb, | 688 | int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, |
| 686 | struct net_device *dev, | 689 | struct packet_type *pt, struct net_device *orig_dev); |
| 687 | struct packet_type *pt, | ||
| 688 | struct net_device *orig_dev); | ||
| 689 | 690 | ||
| 690 | extern int ip6_rcv_finish(struct sk_buff *skb); | 691 | int ip6_rcv_finish(struct sk_buff *skb); |
| 691 | 692 | ||
| 692 | /* | 693 | /* |
| 693 | * upper-layer output functions | 694 | * upper-layer output functions |
| 694 | */ | 695 | */ |
| 695 | extern int ip6_xmit(struct sock *sk, | 696 | int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, |
| 696 | struct sk_buff *skb, | 697 | struct ipv6_txoptions *opt, int tclass); |
| 697 | struct flowi6 *fl6, | 698 | |
| 698 | struct ipv6_txoptions *opt, | 699 | int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); |
| 699 | int tclass); | 700 | |
| 700 | 701 | int ip6_append_data(struct sock *sk, | |
| 701 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); | 702 | int getfrag(void *from, char *to, int offset, int len, |
| 702 | 703 | int odd, struct sk_buff *skb), | |
| 703 | extern int ip6_append_data(struct sock *sk, | 704 | void *from, int length, int transhdrlen, int hlimit, |
| 704 | int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), | 705 | int tclass, struct ipv6_txoptions *opt, struct flowi6 *fl6, |
| 705 | void *from, | 706 | struct rt6_info *rt, unsigned int flags, int dontfrag); |
| 706 | int length, | 707 | |
| 707 | int transhdrlen, | 708 | int ip6_push_pending_frames(struct sock *sk); |
| 708 | int hlimit, | 709 | |
| 709 | int tclass, | 710 | void ip6_flush_pending_frames(struct sock *sk); |
| 710 | struct ipv6_txoptions *opt, | 711 | |
| 711 | struct flowi6 *fl6, | 712 | int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); |
| 712 | struct rt6_info *rt, | 713 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
| 713 | unsigned int flags, | 714 | const struct in6_addr *final_dst, |
| 714 | int dontfrag); | 715 | bool can_sleep); |
| 715 | 716 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |
| 716 | extern int ip6_push_pending_frames(struct sock *sk); | 717 | const struct in6_addr *final_dst, |
| 717 | 718 | bool can_sleep); | |
| 718 | extern void ip6_flush_pending_frames(struct sock *sk); | 719 | struct dst_entry *ip6_blackhole_route(struct net *net, |
| 719 | 720 | struct dst_entry *orig_dst); | |
| 720 | extern int ip6_dst_lookup(struct sock *sk, | ||
| 721 | struct dst_entry **dst, | ||
| 722 | struct flowi6 *fl6); | ||
| 723 | extern struct dst_entry * ip6_dst_lookup_flow(struct sock *sk, | ||
| 724 | struct flowi6 *fl6, | ||
| 725 | const struct in6_addr *final_dst, | ||
| 726 | bool can_sleep); | ||
| 727 | extern struct dst_entry * ip6_sk_dst_lookup_flow(struct sock *sk, | ||
| 728 | struct flowi6 *fl6, | ||
| 729 | const struct in6_addr *final_dst, | ||
| 730 | bool can_sleep); | ||
| 731 | extern struct dst_entry * ip6_blackhole_route(struct net *net, | ||
| 732 | struct dst_entry *orig_dst); | ||
| 733 | 721 | ||
| 734 | /* | 722 | /* |
| 735 | * skb processing functions | 723 | * skb processing functions |
| 736 | */ | 724 | */ |
| 737 | 725 | ||
| 738 | extern int ip6_output(struct sk_buff *skb); | 726 | int ip6_output(struct sk_buff *skb); |
| 739 | extern int ip6_forward(struct sk_buff *skb); | 727 | int ip6_forward(struct sk_buff *skb); |
| 740 | extern int ip6_input(struct sk_buff *skb); | 728 | int ip6_input(struct sk_buff *skb); |
| 741 | extern int ip6_mc_input(struct sk_buff *skb); | 729 | int ip6_mc_input(struct sk_buff *skb); |
| 742 | 730 | ||
| 743 | extern int __ip6_local_out(struct sk_buff *skb); | 731 | int __ip6_local_out(struct sk_buff *skb); |
| 744 | extern int ip6_local_out(struct sk_buff *skb); | 732 | int ip6_local_out(struct sk_buff *skb); |
| 745 | 733 | ||
| 746 | /* | 734 | /* |
| 747 | * Extension header (options) processing | 735 | * Extension header (options) processing |
| 748 | */ | 736 | */ |
| 749 | 737 | ||
| 750 | extern void ipv6_push_nfrag_opts(struct sk_buff *skb, | 738 | void ipv6_push_nfrag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, |
| 751 | struct ipv6_txoptions *opt, | 739 | u8 *proto, struct in6_addr **daddr_p); |
| 752 | u8 *proto, | 740 | void ipv6_push_frag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, |
| 753 | struct in6_addr **daddr_p); | 741 | u8 *proto); |
| 754 | extern void ipv6_push_frag_opts(struct sk_buff *skb, | ||
| 755 | struct ipv6_txoptions *opt, | ||
| 756 | u8 *proto); | ||
| 757 | 742 | ||
| 758 | extern int ipv6_skip_exthdr(const struct sk_buff *, int start, | 743 | int ipv6_skip_exthdr(const struct sk_buff *, int start, u8 *nexthdrp, |
| 759 | u8 *nexthdrp, __be16 *frag_offp); | 744 | __be16 *frag_offp); |
| 760 | 745 | ||
| 761 | extern bool ipv6_ext_hdr(u8 nexthdr); | 746 | bool ipv6_ext_hdr(u8 nexthdr); |
| 762 | 747 | ||
| 763 | enum { | 748 | enum { |
| 764 | IP6_FH_F_FRAG = (1 << 0), | 749 | IP6_FH_F_FRAG = (1 << 0), |
| @@ -767,57 +752,44 @@ enum { | |||
| 767 | }; | 752 | }; |
| 768 | 753 | ||
| 769 | /* find specified header and get offset to it */ | 754 | /* find specified header and get offset to it */ |
| 770 | extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | 755 | int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, int target, |
| 771 | int target, unsigned short *fragoff, int *fragflg); | 756 | unsigned short *fragoff, int *fragflg); |
| 772 | 757 | ||
| 773 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); | 758 | int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); |
| 774 | 759 | ||
| 775 | extern struct in6_addr *fl6_update_dst(struct flowi6 *fl6, | 760 | struct in6_addr *fl6_update_dst(struct flowi6 *fl6, |
| 776 | const struct ipv6_txoptions *opt, | 761 | const struct ipv6_txoptions *opt, |
| 777 | struct in6_addr *orig); | 762 | struct in6_addr *orig); |
| 778 | 763 | ||
| 779 | /* | 764 | /* |
| 780 | * socket options (ipv6_sockglue.c) | 765 | * socket options (ipv6_sockglue.c) |
| 781 | */ | 766 | */ |
| 782 | 767 | ||
| 783 | extern int ipv6_setsockopt(struct sock *sk, int level, | 768 | int ipv6_setsockopt(struct sock *sk, int level, int optname, |
| 784 | int optname, | 769 | char __user *optval, unsigned int optlen); |
| 785 | char __user *optval, | 770 | int ipv6_getsockopt(struct sock *sk, int level, int optname, |
| 786 | unsigned int optlen); | 771 | char __user *optval, int __user *optlen); |
| 787 | extern int ipv6_getsockopt(struct sock *sk, int level, | 772 | int compat_ipv6_setsockopt(struct sock *sk, int level, int optname, |
| 788 | int optname, | 773 | char __user *optval, unsigned int optlen); |
| 789 | char __user *optval, | 774 | int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, |
| 790 | int __user *optlen); | 775 | char __user *optval, int __user *optlen); |
| 791 | extern int compat_ipv6_setsockopt(struct sock *sk, | 776 | |
| 792 | int level, | 777 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); |
| 793 | int optname, | 778 | |
| 794 | char __user *optval, | 779 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); |
| 795 | unsigned int optlen); | 780 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); |
| 796 | extern int compat_ipv6_getsockopt(struct sock *sk, | 781 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
| 797 | int level, | 782 | u32 info, u8 *payload); |
| 798 | int optname, | 783 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); |
| 799 | char __user *optval, | 784 | void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu); |
| 800 | int __user *optlen); | 785 | |
| 801 | 786 | int inet6_release(struct socket *sock); | |
| 802 | extern int ip6_datagram_connect(struct sock *sk, | 787 | int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); |
| 803 | struct sockaddr *addr, int addr_len); | 788 | int inet6_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, |
| 804 | 789 | int peer); | |
| 805 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 790 | int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 806 | extern int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); | 791 | |
| 807 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 792 | int inet6_hash_connect(struct inet_timewait_death_row *death_row, |
| 808 | u32 info, u8 *payload); | ||
| 809 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); | ||
| 810 | extern void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu); | ||
| 811 | |||
| 812 | extern int inet6_release(struct socket *sock); | ||
| 813 | extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr, | ||
| 814 | int addr_len); | ||
| 815 | extern int inet6_getname(struct socket *sock, struct sockaddr *uaddr, | ||
| 816 | int *uaddr_len, int peer); | ||
| 817 | extern int inet6_ioctl(struct socket *sock, unsigned int cmd, | ||
| 818 | unsigned long arg); | ||
| 819 | |||
| 820 | extern int inet6_hash_connect(struct inet_timewait_death_row *death_row, | ||
| 821 | struct sock *sk); | 793 | struct sock *sk); |
| 822 | 794 | ||
| 823 | /* | 795 | /* |
| @@ -829,30 +801,27 @@ extern const struct proto_ops inet6_dgram_ops; | |||
| 829 | struct group_source_req; | 801 | struct group_source_req; |
| 830 | struct group_filter; | 802 | struct group_filter; |
| 831 | 803 | ||
| 832 | extern int ip6_mc_source(int add, int omode, struct sock *sk, | 804 | int ip6_mc_source(int add, int omode, struct sock *sk, |
| 833 | struct group_source_req *pgsr); | 805 | struct group_source_req *pgsr); |
| 834 | extern int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf); | 806 | int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf); |
| 835 | extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, | 807 | int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, |
| 836 | struct group_filter __user *optval, | 808 | struct group_filter __user *optval, int __user *optlen); |
| 837 | int __user *optlen); | ||
| 838 | extern unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr, | ||
| 839 | const struct in6_addr *daddr, u32 rnd); | ||
| 840 | 809 | ||
| 841 | #ifdef CONFIG_PROC_FS | 810 | #ifdef CONFIG_PROC_FS |
| 842 | extern int ac6_proc_init(struct net *net); | 811 | int ac6_proc_init(struct net *net); |
| 843 | extern void ac6_proc_exit(struct net *net); | 812 | void ac6_proc_exit(struct net *net); |
| 844 | extern int raw6_proc_init(void); | 813 | int raw6_proc_init(void); |
| 845 | extern void raw6_proc_exit(void); | 814 | void raw6_proc_exit(void); |
| 846 | extern int tcp6_proc_init(struct net *net); | 815 | int tcp6_proc_init(struct net *net); |
| 847 | extern void tcp6_proc_exit(struct net *net); | 816 | void tcp6_proc_exit(struct net *net); |
| 848 | extern int udp6_proc_init(struct net *net); | 817 | int udp6_proc_init(struct net *net); |
| 849 | extern void udp6_proc_exit(struct net *net); | 818 | void udp6_proc_exit(struct net *net); |
| 850 | extern int udplite6_proc_init(void); | 819 | int udplite6_proc_init(void); |
| 851 | extern void udplite6_proc_exit(void); | 820 | void udplite6_proc_exit(void); |
| 852 | extern int ipv6_misc_proc_init(void); | 821 | int ipv6_misc_proc_init(void); |
| 853 | extern void ipv6_misc_proc_exit(void); | 822 | void ipv6_misc_proc_exit(void); |
| 854 | extern int snmp6_register_dev(struct inet6_dev *idev); | 823 | int snmp6_register_dev(struct inet6_dev *idev); |
| 855 | extern int snmp6_unregister_dev(struct inet6_dev *idev); | 824 | int snmp6_unregister_dev(struct inet6_dev *idev); |
| 856 | 825 | ||
| 857 | #else | 826 | #else |
| 858 | static inline int ac6_proc_init(struct net *net) { return 0; } | 827 | static inline int ac6_proc_init(struct net *net) { return 0; } |
| @@ -865,10 +834,10 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; } | |||
| 865 | extern struct ctl_table ipv6_route_table_template[]; | 834 | extern struct ctl_table ipv6_route_table_template[]; |
| 866 | extern struct ctl_table ipv6_icmp_table_template[]; | 835 | extern struct ctl_table ipv6_icmp_table_template[]; |
| 867 | 836 | ||
| 868 | extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); | 837 | struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); |
| 869 | extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); | 838 | struct ctl_table *ipv6_route_sysctl_init(struct net *net); |
| 870 | extern int ipv6_sysctl_register(void); | 839 | int ipv6_sysctl_register(void); |
| 871 | extern void ipv6_sysctl_unregister(void); | 840 | void ipv6_sysctl_unregister(void); |
| 872 | #endif | 841 | #endif |
| 873 | 842 | ||
| 874 | #endif /* _NET_IPV6_H */ | 843 | #endif /* _NET_IPV6_H */ |
diff --git a/include/net/ipx.h b/include/net/ipx.h index c1fec6b464cc..9e9e35465baf 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
| @@ -123,23 +123,23 @@ extern struct list_head ipx_routes; | |||
| 123 | extern rwlock_t ipx_routes_lock; | 123 | extern rwlock_t ipx_routes_lock; |
| 124 | 124 | ||
| 125 | extern struct list_head ipx_interfaces; | 125 | extern struct list_head ipx_interfaces; |
| 126 | extern struct ipx_interface *ipx_interfaces_head(void); | 126 | struct ipx_interface *ipx_interfaces_head(void); |
| 127 | extern spinlock_t ipx_interfaces_lock; | 127 | extern spinlock_t ipx_interfaces_lock; |
| 128 | 128 | ||
| 129 | extern struct ipx_interface *ipx_primary_net; | 129 | extern struct ipx_interface *ipx_primary_net; |
| 130 | 130 | ||
| 131 | extern int ipx_proc_init(void); | 131 | int ipx_proc_init(void); |
| 132 | extern void ipx_proc_exit(void); | 132 | void ipx_proc_exit(void); |
| 133 | 133 | ||
| 134 | extern const char *ipx_frame_name(__be16); | 134 | const char *ipx_frame_name(__be16); |
| 135 | extern const char *ipx_device_name(struct ipx_interface *intrfc); | 135 | const char *ipx_device_name(struct ipx_interface *intrfc); |
| 136 | 136 | ||
| 137 | static __inline__ void ipxitf_hold(struct ipx_interface *intrfc) | 137 | static __inline__ void ipxitf_hold(struct ipx_interface *intrfc) |
| 138 | { | 138 | { |
| 139 | atomic_inc(&intrfc->refcnt); | 139 | atomic_inc(&intrfc->refcnt); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | extern void ipxitf_down(struct ipx_interface *intrfc); | 142 | void ipxitf_down(struct ipx_interface *intrfc); |
| 143 | 143 | ||
| 144 | static __inline__ void ipxitf_put(struct ipx_interface *intrfc) | 144 | static __inline__ void ipxitf_put(struct ipx_interface *intrfc) |
| 145 | { | 145 | { |
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 80ffde3bb164..0224402260a7 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h | |||
| @@ -105,13 +105,13 @@ struct ircomm_tty_cb { | |||
| 105 | void ircomm_tty_start(struct tty_struct *tty); | 105 | void ircomm_tty_start(struct tty_struct *tty); |
| 106 | void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self); | 106 | void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self); |
| 107 | 107 | ||
| 108 | extern int ircomm_tty_tiocmget(struct tty_struct *tty); | 108 | int ircomm_tty_tiocmget(struct tty_struct *tty); |
| 109 | extern int ircomm_tty_tiocmset(struct tty_struct *tty, | 109 | int ircomm_tty_tiocmset(struct tty_struct *tty, unsigned int set, |
| 110 | unsigned int set, unsigned int clear); | 110 | unsigned int clear); |
| 111 | extern int ircomm_tty_ioctl(struct tty_struct *tty, | 111 | int ircomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, |
| 112 | unsigned int cmd, unsigned long arg); | 112 | unsigned long arg); |
| 113 | extern void ircomm_tty_set_termios(struct tty_struct *tty, | 113 | void ircomm_tty_set_termios(struct tty_struct *tty, |
| 114 | struct ktermios *old_termios); | 114 | struct ktermios *old_termios); |
| 115 | 115 | ||
| 116 | #endif | 116 | #endif |
| 117 | 117 | ||
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h index 3bed61d379a8..a059465101ff 100644 --- a/include/net/irda/irda.h +++ b/include/net/irda/irda.h | |||
| @@ -112,20 +112,19 @@ do { if(!(expr)) { \ | |||
| 112 | struct net_device; | 112 | struct net_device; |
| 113 | struct packet_type; | 113 | struct packet_type; |
| 114 | 114 | ||
| 115 | extern void irda_proc_register(void); | 115 | void irda_proc_register(void); |
| 116 | extern void irda_proc_unregister(void); | 116 | void irda_proc_unregister(void); |
| 117 | 117 | ||
| 118 | extern int irda_sysctl_register(void); | 118 | int irda_sysctl_register(void); |
| 119 | extern void irda_sysctl_unregister(void); | 119 | void irda_sysctl_unregister(void); |
| 120 | 120 | ||
| 121 | extern int irsock_init(void); | 121 | int irsock_init(void); |
| 122 | extern void irsock_cleanup(void); | 122 | void irsock_cleanup(void); |
| 123 | 123 | ||
| 124 | extern int irda_nl_register(void); | 124 | int irda_nl_register(void); |
| 125 | extern void irda_nl_unregister(void); | 125 | void irda_nl_unregister(void); |
| 126 | 126 | ||
| 127 | extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, | 127 | int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, |
| 128 | struct packet_type *ptype, | 128 | struct packet_type *ptype, struct net_device *orig_dev); |
| 129 | struct net_device *orig_dev); | ||
| 130 | 129 | ||
| 131 | #endif /* NET_IRDA_H */ | 130 | #endif /* NET_IRDA_H */ |
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index 94c852d47d0f..11417475a6c3 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h | |||
| @@ -162,7 +162,7 @@ typedef struct { | |||
| 162 | int irq, irq2; /* Interrupts used */ | 162 | int irq, irq2; /* Interrupts used */ |
| 163 | int dma, dma2; /* DMA channel(s) used */ | 163 | int dma, dma2; /* DMA channel(s) used */ |
| 164 | int fifo_size; /* FIFO size */ | 164 | int fifo_size; /* FIFO size */ |
| 165 | int irqflags; /* interrupt flags (ie, IRQF_SHARED|IRQF_DISABLED) */ | 165 | int irqflags; /* interrupt flags (ie, IRQF_SHARED) */ |
| 166 | int direction; /* Link direction, used by some FIR drivers */ | 166 | int direction; /* Link direction, used by some FIR drivers */ |
| 167 | int enabled; /* Powered on? */ | 167 | int enabled; /* Powered on? */ |
| 168 | int suspended; /* Suspended by APM */ | 168 | int suspended; /* Suspended by APM */ |
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h index 4c90824c50fb..f9d88da97af2 100644 --- a/include/net/irda/irlap_event.h +++ b/include/net/irda/irlap_event.h | |||
| @@ -126,6 +126,6 @@ void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, | |||
| 126 | struct sk_buff *skb, struct irlap_info *info); | 126 | struct sk_buff *skb, struct irlap_info *info); |
| 127 | void irlap_print_event(IRLAP_EVENT event); | 127 | void irlap_print_event(IRLAP_EVENT event); |
| 128 | 128 | ||
| 129 | extern int irlap_qos_negotiate(struct irlap_cb *self, struct sk_buff *skb); | 129 | int irlap_qos_negotiate(struct irlap_cb *self, struct sk_buff *skb); |
| 130 | 130 | ||
| 131 | #endif | 131 | #endif |
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h index 6b1dc4f8eca5..57173ae398ae 100644 --- a/include/net/irda/irlap_frame.h +++ b/include/net/irda/irlap_frame.h | |||
| @@ -163,7 +163,7 @@ void irlap_resend_rejected_frame(struct irlap_cb *self, int command); | |||
| 163 | void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, | 163 | void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, |
| 164 | __u8 caddr, int command); | 164 | __u8 caddr, int command); |
| 165 | 165 | ||
| 166 | extern int irlap_insert_qos_negotiation_params(struct irlap_cb *self, | 166 | int irlap_insert_qos_negotiation_params(struct irlap_cb *self, |
| 167 | struct sk_buff *skb); | 167 | struct sk_buff *skb); |
| 168 | 168 | ||
| 169 | #endif | 169 | #endif |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 5d5a6a4732ef..a830b01baba4 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
| @@ -432,44 +432,32 @@ struct iw_public_data { | |||
| 432 | /* First : function strictly used inside the kernel */ | 432 | /* First : function strictly used inside the kernel */ |
| 433 | 433 | ||
| 434 | /* Handle /proc/net/wireless, called in net/code/dev.c */ | 434 | /* Handle /proc/net/wireless, called in net/code/dev.c */ |
| 435 | extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, | 435 | int dev_get_wireless_info(char *buffer, char **start, off_t offset, int length); |
| 436 | int length); | ||
| 437 | 436 | ||
| 438 | /* Second : functions that may be called by driver modules */ | 437 | /* Second : functions that may be called by driver modules */ |
| 439 | 438 | ||
| 440 | /* Send a single event to user space */ | 439 | /* Send a single event to user space */ |
| 441 | extern void wireless_send_event(struct net_device * dev, | 440 | void wireless_send_event(struct net_device *dev, unsigned int cmd, |
| 442 | unsigned int cmd, | 441 | union iwreq_data *wrqu, const char *extra); |
| 443 | union iwreq_data * wrqu, | ||
| 444 | const char * extra); | ||
| 445 | 442 | ||
| 446 | /* We may need a function to send a stream of events to user space. | 443 | /* We may need a function to send a stream of events to user space. |
| 447 | * More on that later... */ | 444 | * More on that later... */ |
| 448 | 445 | ||
| 449 | /* Standard handler for SIOCSIWSPY */ | 446 | /* Standard handler for SIOCSIWSPY */ |
| 450 | extern int iw_handler_set_spy(struct net_device * dev, | 447 | int iw_handler_set_spy(struct net_device *dev, struct iw_request_info *info, |
| 451 | struct iw_request_info * info, | 448 | union iwreq_data *wrqu, char *extra); |
| 452 | union iwreq_data * wrqu, | ||
| 453 | char * extra); | ||
| 454 | /* Standard handler for SIOCGIWSPY */ | 449 | /* Standard handler for SIOCGIWSPY */ |
| 455 | extern int iw_handler_get_spy(struct net_device * dev, | 450 | int iw_handler_get_spy(struct net_device *dev, struct iw_request_info *info, |
| 456 | struct iw_request_info * info, | 451 | union iwreq_data *wrqu, char *extra); |
| 457 | union iwreq_data * wrqu, | ||
| 458 | char * extra); | ||
| 459 | /* Standard handler for SIOCSIWTHRSPY */ | 452 | /* Standard handler for SIOCSIWTHRSPY */ |
| 460 | extern int iw_handler_set_thrspy(struct net_device * dev, | 453 | int iw_handler_set_thrspy(struct net_device *dev, struct iw_request_info *info, |
| 461 | struct iw_request_info *info, | 454 | union iwreq_data *wrqu, char *extra); |
| 462 | union iwreq_data * wrqu, | ||
| 463 | char * extra); | ||
| 464 | /* Standard handler for SIOCGIWTHRSPY */ | 455 | /* Standard handler for SIOCGIWTHRSPY */ |
| 465 | extern int iw_handler_get_thrspy(struct net_device * dev, | 456 | int iw_handler_get_thrspy(struct net_device *dev, struct iw_request_info *info, |
| 466 | struct iw_request_info *info, | 457 | union iwreq_data *wrqu, char *extra); |
| 467 | union iwreq_data * wrqu, | ||
| 468 | char * extra); | ||
| 469 | /* Driver call to update spy records */ | 458 | /* Driver call to update spy records */ |
| 470 | extern void wireless_spy_update(struct net_device * dev, | 459 | void wireless_spy_update(struct net_device *dev, unsigned char *address, |
| 471 | unsigned char * address, | 460 | struct iw_quality *wstats); |
| 472 | struct iw_quality * wstats); | ||
| 473 | 461 | ||
| 474 | /************************* INLINE FUNTIONS *************************/ | 462 | /************************* INLINE FUNTIONS *************************/ |
| 475 | /* | 463 | /* |
diff --git a/include/net/lapb.h b/include/net/lapb.h index df892a94f2c6..9510f8725f03 100644 --- a/include/net/lapb.h +++ b/include/net/lapb.h | |||
| @@ -105,40 +105,40 @@ struct lapb_cb { | |||
| 105 | }; | 105 | }; |
| 106 | 106 | ||
| 107 | /* lapb_iface.c */ | 107 | /* lapb_iface.c */ |
| 108 | extern void lapb_connect_confirmation(struct lapb_cb *lapb, int); | 108 | void lapb_connect_confirmation(struct lapb_cb *lapb, int); |
| 109 | extern void lapb_connect_indication(struct lapb_cb *lapb, int); | 109 | void lapb_connect_indication(struct lapb_cb *lapb, int); |
| 110 | extern void lapb_disconnect_confirmation(struct lapb_cb *lapb, int); | 110 | void lapb_disconnect_confirmation(struct lapb_cb *lapb, int); |
| 111 | extern void lapb_disconnect_indication(struct lapb_cb *lapb, int); | 111 | void lapb_disconnect_indication(struct lapb_cb *lapb, int); |
| 112 | extern int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *); | 112 | int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *); |
| 113 | extern int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *); | 113 | int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *); |
| 114 | 114 | ||
| 115 | /* lapb_in.c */ | 115 | /* lapb_in.c */ |
| 116 | extern void lapb_data_input(struct lapb_cb *lapb, struct sk_buff *); | 116 | void lapb_data_input(struct lapb_cb *lapb, struct sk_buff *); |
| 117 | 117 | ||
| 118 | /* lapb_out.c */ | 118 | /* lapb_out.c */ |
| 119 | extern void lapb_kick(struct lapb_cb *lapb); | 119 | void lapb_kick(struct lapb_cb *lapb); |
| 120 | extern void lapb_transmit_buffer(struct lapb_cb *lapb, struct sk_buff *, int); | 120 | void lapb_transmit_buffer(struct lapb_cb *lapb, struct sk_buff *, int); |
| 121 | extern void lapb_establish_data_link(struct lapb_cb *lapb); | 121 | void lapb_establish_data_link(struct lapb_cb *lapb); |
| 122 | extern void lapb_enquiry_response(struct lapb_cb *lapb); | 122 | void lapb_enquiry_response(struct lapb_cb *lapb); |
| 123 | extern void lapb_timeout_response(struct lapb_cb *lapb); | 123 | void lapb_timeout_response(struct lapb_cb *lapb); |
| 124 | extern void lapb_check_iframes_acked(struct lapb_cb *lapb, unsigned short); | 124 | void lapb_check_iframes_acked(struct lapb_cb *lapb, unsigned short); |
| 125 | extern void lapb_check_need_response(struct lapb_cb *lapb, int, int); | 125 | void lapb_check_need_response(struct lapb_cb *lapb, int, int); |
| 126 | 126 | ||
| 127 | /* lapb_subr.c */ | 127 | /* lapb_subr.c */ |
| 128 | extern void lapb_clear_queues(struct lapb_cb *lapb); | 128 | void lapb_clear_queues(struct lapb_cb *lapb); |
| 129 | extern void lapb_frames_acked(struct lapb_cb *lapb, unsigned short); | 129 | void lapb_frames_acked(struct lapb_cb *lapb, unsigned short); |
| 130 | extern void lapb_requeue_frames(struct lapb_cb *lapb); | 130 | void lapb_requeue_frames(struct lapb_cb *lapb); |
| 131 | extern int lapb_validate_nr(struct lapb_cb *lapb, unsigned short); | 131 | int lapb_validate_nr(struct lapb_cb *lapb, unsigned short); |
| 132 | extern int lapb_decode(struct lapb_cb *lapb, struct sk_buff *, struct lapb_frame *); | 132 | int lapb_decode(struct lapb_cb *lapb, struct sk_buff *, struct lapb_frame *); |
| 133 | extern void lapb_send_control(struct lapb_cb *lapb, int, int, int); | 133 | void lapb_send_control(struct lapb_cb *lapb, int, int, int); |
| 134 | extern void lapb_transmit_frmr(struct lapb_cb *lapb); | 134 | void lapb_transmit_frmr(struct lapb_cb *lapb); |
| 135 | 135 | ||
| 136 | /* lapb_timer.c */ | 136 | /* lapb_timer.c */ |
| 137 | extern void lapb_start_t1timer(struct lapb_cb *lapb); | 137 | void lapb_start_t1timer(struct lapb_cb *lapb); |
| 138 | extern void lapb_start_t2timer(struct lapb_cb *lapb); | 138 | void lapb_start_t2timer(struct lapb_cb *lapb); |
| 139 | extern void lapb_stop_t1timer(struct lapb_cb *lapb); | 139 | void lapb_stop_t1timer(struct lapb_cb *lapb); |
| 140 | extern void lapb_stop_t2timer(struct lapb_cb *lapb); | 140 | void lapb_stop_t2timer(struct lapb_cb *lapb); |
| 141 | extern int lapb_t1timer_running(struct lapb_cb *lapb); | 141 | int lapb_t1timer_running(struct lapb_cb *lapb); |
| 142 | 142 | ||
| 143 | /* | 143 | /* |
| 144 | * Debug levels. | 144 | * Debug levels. |
diff --git a/include/net/llc.h b/include/net/llc.h index 9e7d7f08ef77..68490cbc8a65 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
| @@ -95,29 +95,29 @@ struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap, | |||
| 95 | extern struct list_head llc_sap_list; | 95 | extern struct list_head llc_sap_list; |
| 96 | extern spinlock_t llc_sap_list_lock; | 96 | extern spinlock_t llc_sap_list_lock; |
| 97 | 97 | ||
| 98 | extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, | 98 | int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, |
| 99 | struct packet_type *pt, struct net_device *orig_dev); | 99 | struct net_device *orig_dev); |
| 100 | 100 | ||
| 101 | extern int llc_mac_hdr_init(struct sk_buff *skb, | 101 | int llc_mac_hdr_init(struct sk_buff *skb, const unsigned char *sa, |
| 102 | const unsigned char *sa, const unsigned char *da); | 102 | const unsigned char *da); |
| 103 | 103 | ||
| 104 | extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, | 104 | void llc_add_pack(int type, |
| 105 | struct sk_buff *skb)); | 105 | void (*handler)(struct llc_sap *sap, struct sk_buff *skb)); |
| 106 | extern void llc_remove_pack(int type); | 106 | void llc_remove_pack(int type); |
| 107 | 107 | ||
| 108 | extern void llc_set_station_handler(void (*handler)(struct sk_buff *skb)); | 108 | void llc_set_station_handler(void (*handler)(struct sk_buff *skb)); |
| 109 | 109 | ||
| 110 | extern struct llc_sap *llc_sap_open(unsigned char lsap, | 110 | struct llc_sap *llc_sap_open(unsigned char lsap, |
| 111 | int (*rcv)(struct sk_buff *skb, | 111 | int (*rcv)(struct sk_buff *skb, |
| 112 | struct net_device *dev, | 112 | struct net_device *dev, |
| 113 | struct packet_type *pt, | 113 | struct packet_type *pt, |
| 114 | struct net_device *orig_dev)); | 114 | struct net_device *orig_dev)); |
| 115 | static inline void llc_sap_hold(struct llc_sap *sap) | 115 | static inline void llc_sap_hold(struct llc_sap *sap) |
| 116 | { | 116 | { |
| 117 | atomic_inc(&sap->refcnt); | 117 | atomic_inc(&sap->refcnt); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | extern void llc_sap_close(struct llc_sap *sap); | 120 | void llc_sap_close(struct llc_sap *sap); |
| 121 | 121 | ||
| 122 | static inline void llc_sap_put(struct llc_sap *sap) | 122 | static inline void llc_sap_put(struct llc_sap *sap) |
| 123 | { | 123 | { |
| @@ -125,27 +125,27 @@ static inline void llc_sap_put(struct llc_sap *sap) | |||
| 125 | llc_sap_close(sap); | 125 | llc_sap_close(sap); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | extern struct llc_sap *llc_sap_find(unsigned char sap_value); | 128 | struct llc_sap *llc_sap_find(unsigned char sap_value); |
| 129 | 129 | ||
| 130 | extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, | 130 | int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, |
| 131 | unsigned char *dmac, unsigned char dsap); | 131 | unsigned char *dmac, unsigned char dsap); |
| 132 | 132 | ||
| 133 | extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb); | 133 | void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb); |
| 134 | extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb); | 134 | void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb); |
| 135 | 135 | ||
| 136 | extern void llc_station_init(void); | 136 | void llc_station_init(void); |
| 137 | extern void llc_station_exit(void); | 137 | void llc_station_exit(void); |
| 138 | 138 | ||
| 139 | #ifdef CONFIG_PROC_FS | 139 | #ifdef CONFIG_PROC_FS |
| 140 | extern int llc_proc_init(void); | 140 | int llc_proc_init(void); |
| 141 | extern void llc_proc_exit(void); | 141 | void llc_proc_exit(void); |
| 142 | #else | 142 | #else |
| 143 | #define llc_proc_init() (0) | 143 | #define llc_proc_init() (0) |
| 144 | #define llc_proc_exit() do { } while(0) | 144 | #define llc_proc_exit() do { } while(0) |
| 145 | #endif /* CONFIG_PROC_FS */ | 145 | #endif /* CONFIG_PROC_FS */ |
| 146 | #ifdef CONFIG_SYSCTL | 146 | #ifdef CONFIG_SYSCTL |
| 147 | extern int llc_sysctl_init(void); | 147 | int llc_sysctl_init(void); |
| 148 | extern void llc_sysctl_exit(void); | 148 | void llc_sysctl_exit(void); |
| 149 | 149 | ||
| 150 | extern int sysctl_llc2_ack_timeout; | 150 | extern int sysctl_llc2_ack_timeout; |
| 151 | extern int sysctl_llc2_busy_timeout; | 151 | extern int sysctl_llc2_busy_timeout; |
diff --git a/include/net/llc_c_ac.h b/include/net/llc_c_ac.h index df83f69d2de4..f3be818e73c1 100644 --- a/include/net/llc_c_ac.h +++ b/include/net/llc_c_ac.h | |||
| @@ -89,114 +89,92 @@ | |||
| 89 | 89 | ||
| 90 | typedef int (*llc_conn_action_t)(struct sock *sk, struct sk_buff *skb); | 90 | typedef int (*llc_conn_action_t)(struct sock *sk, struct sk_buff *skb); |
| 91 | 91 | ||
| 92 | extern int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb); | 92 | int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb); |
| 93 | extern int llc_conn_ac_conn_ind(struct sock *sk, struct sk_buff *skb); | 93 | int llc_conn_ac_conn_ind(struct sock *sk, struct sk_buff *skb); |
| 94 | extern int llc_conn_ac_conn_confirm(struct sock* sk, struct sk_buff *skb); | 94 | int llc_conn_ac_conn_confirm(struct sock *sk, struct sk_buff *skb); |
| 95 | extern int llc_conn_ac_data_ind(struct sock* sk, struct sk_buff *skb); | 95 | int llc_conn_ac_data_ind(struct sock *sk, struct sk_buff *skb); |
| 96 | extern int llc_conn_ac_disc_ind(struct sock* sk, struct sk_buff *skb); | 96 | int llc_conn_ac_disc_ind(struct sock *sk, struct sk_buff *skb); |
| 97 | extern int llc_conn_ac_rst_ind(struct sock* sk, struct sk_buff *skb); | 97 | int llc_conn_ac_rst_ind(struct sock *sk, struct sk_buff *skb); |
| 98 | extern int llc_conn_ac_rst_confirm(struct sock* sk, struct sk_buff *skb); | 98 | int llc_conn_ac_rst_confirm(struct sock *sk, struct sk_buff *skb); |
| 99 | extern int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock* sk, | 99 | int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock *sk, |
| 100 | struct sk_buff *skb); | ||
| 101 | extern int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock* sk, | ||
| 102 | struct sk_buff *skb); | ||
| 103 | extern int llc_conn_ac_send_disc_cmd_p_set_x(struct sock* sk, | ||
| 104 | struct sk_buff *skb); | ||
| 105 | extern int llc_conn_ac_send_dm_rsp_f_set_p(struct sock* sk, | ||
| 106 | struct sk_buff *skb); | ||
| 107 | extern int llc_conn_ac_send_dm_rsp_f_set_1(struct sock* sk, | ||
| 108 | struct sk_buff *skb); | ||
| 109 | extern int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock* sk, | ||
| 110 | struct sk_buff *skb); | ||
| 111 | extern int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock* sk, | ||
| 112 | struct sk_buff *skb); | ||
| 113 | extern int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock* sk, | ||
| 114 | struct sk_buff *skb); | ||
| 115 | extern int llc_conn_ac_send_i_cmd_p_set_1(struct sock* sk, struct sk_buff *skb); | ||
| 116 | extern int llc_conn_ac_send_i_xxx_x_set_0(struct sock* sk, struct sk_buff *skb); | ||
| 117 | extern int llc_conn_ac_resend_i_xxx_x_set_0(struct sock* sk, | ||
| 118 | struct sk_buff *skb); | ||
| 119 | extern int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock* sk, | ||
| 120 | struct sk_buff *skb); | ||
| 121 | extern int llc_conn_ac_resend_i_rsp_f_set_1(struct sock* sk, | ||
| 122 | struct sk_buff *skb); | ||
| 123 | extern int llc_conn_ac_send_rej_cmd_p_set_1(struct sock* sk, | ||
| 124 | struct sk_buff *skb); | ||
| 125 | extern int llc_conn_ac_send_rej_rsp_f_set_1(struct sock* sk, | ||
| 126 | struct sk_buff *skb); | ||
| 127 | extern int llc_conn_ac_send_rej_xxx_x_set_0(struct sock* sk, | ||
| 128 | struct sk_buff *skb); | 100 | struct sk_buff *skb); |
| 129 | extern int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock* sk, | 101 | int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock *sk, |
| 130 | struct sk_buff *skb); | 102 | struct sk_buff *skb); |
| 131 | extern int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock* sk, | 103 | int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb); |
| 132 | struct sk_buff *skb); | 104 | int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb); |
| 133 | extern int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock* sk, | 105 | int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb); |
| 134 | struct sk_buff *skb); | 106 | int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb); |
| 135 | extern int llc_conn_ac_set_remote_busy(struct sock* sk, struct sk_buff *skb); | 107 | int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb); |
| 136 | extern int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock* sk, | 108 | int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb); |
| 109 | int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb); | ||
| 110 | int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb); | ||
| 111 | int llc_conn_ac_resend_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb); | ||
| 112 | int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk, | ||
| 137 | struct sk_buff *skb); | 113 | struct sk_buff *skb); |
| 138 | extern int llc_conn_ac_send_rr_cmd_p_set_1(struct sock* sk, | 114 | int llc_conn_ac_resend_i_rsp_f_set_1(struct sock *sk, struct sk_buff *skb); |
| 139 | struct sk_buff *skb); | 115 | int llc_conn_ac_send_rej_cmd_p_set_1(struct sock *sk, struct sk_buff *skb); |
| 140 | extern int llc_conn_ac_send_rr_rsp_f_set_1(struct sock* sk, | 116 | int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb); |
| 141 | struct sk_buff *skb); | 117 | int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb); |
| 142 | extern int llc_conn_ac_send_ack_rsp_f_set_1(struct sock* sk, | 118 | int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb); |
| 143 | struct sk_buff *skb); | 119 | int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb); |
| 144 | extern int llc_conn_ac_send_rr_xxx_x_set_0(struct sock* sk, | 120 | int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb); |
| 145 | struct sk_buff *skb); | 121 | int llc_conn_ac_set_remote_busy(struct sock *sk, struct sk_buff *skb); |
| 146 | extern int llc_conn_ac_send_ack_xxx_x_set_0(struct sock* sk, | 122 | int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb); |
| 147 | struct sk_buff *skb); | 123 | int llc_conn_ac_send_rr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb); |
| 148 | extern int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock* sk, | 124 | int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb); |
| 149 | struct sk_buff *skb); | 125 | int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb); |
| 150 | extern int llc_conn_ac_send_ua_rsp_f_set_p(struct sock* sk, | 126 | int llc_conn_ac_send_rr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb); |
| 151 | struct sk_buff *skb); | 127 | int llc_conn_ac_send_ack_xxx_x_set_0(struct sock *sk, struct sk_buff *skb); |
| 152 | extern int llc_conn_ac_set_s_flag_0(struct sock* sk, struct sk_buff *skb); | 128 | int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb); |
| 153 | extern int llc_conn_ac_set_s_flag_1(struct sock* sk, struct sk_buff *skb); | 129 | int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb); |
| 154 | extern int llc_conn_ac_start_p_timer(struct sock* sk, struct sk_buff *skb); | 130 | int llc_conn_ac_set_s_flag_0(struct sock *sk, struct sk_buff *skb); |
| 155 | extern int llc_conn_ac_start_ack_timer(struct sock* sk, struct sk_buff *skb); | 131 | int llc_conn_ac_set_s_flag_1(struct sock *sk, struct sk_buff *skb); |
| 156 | extern int llc_conn_ac_start_rej_timer(struct sock* sk, struct sk_buff *skb); | 132 | int llc_conn_ac_start_p_timer(struct sock *sk, struct sk_buff *skb); |
| 157 | extern int llc_conn_ac_start_ack_tmr_if_not_running(struct sock* sk, | 133 | int llc_conn_ac_start_ack_timer(struct sock *sk, struct sk_buff *skb); |
| 158 | struct sk_buff *skb); | 134 | int llc_conn_ac_start_rej_timer(struct sock *sk, struct sk_buff *skb); |
| 159 | extern int llc_conn_ac_stop_ack_timer(struct sock* sk, struct sk_buff *skb); | 135 | int llc_conn_ac_start_ack_tmr_if_not_running(struct sock *sk, |
| 160 | extern int llc_conn_ac_stop_p_timer(struct sock* sk, struct sk_buff *skb); | 136 | struct sk_buff *skb); |
| 161 | extern int llc_conn_ac_stop_rej_timer(struct sock* sk, struct sk_buff *skb); | 137 | int llc_conn_ac_stop_ack_timer(struct sock *sk, struct sk_buff *skb); |
| 162 | extern int llc_conn_ac_stop_all_timers(struct sock* sk, struct sk_buff *skb); | 138 | int llc_conn_ac_stop_p_timer(struct sock *sk, struct sk_buff *skb); |
| 163 | extern int llc_conn_ac_stop_other_timers(struct sock* sk, struct sk_buff *skb); | 139 | int llc_conn_ac_stop_rej_timer(struct sock *sk, struct sk_buff *skb); |
| 164 | extern int llc_conn_ac_upd_nr_received(struct sock* sk, struct sk_buff *skb); | 140 | int llc_conn_ac_stop_all_timers(struct sock *sk, struct sk_buff *skb); |
| 165 | extern int llc_conn_ac_inc_tx_win_size(struct sock* sk, struct sk_buff *skb); | 141 | int llc_conn_ac_stop_other_timers(struct sock *sk, struct sk_buff *skb); |
| 166 | extern int llc_conn_ac_dec_tx_win_size(struct sock* sk, struct sk_buff *skb); | 142 | int llc_conn_ac_upd_nr_received(struct sock *sk, struct sk_buff *skb); |
| 167 | extern int llc_conn_ac_upd_p_flag(struct sock* sk, struct sk_buff *skb); | 143 | int llc_conn_ac_inc_tx_win_size(struct sock *sk, struct sk_buff *skb); |
| 168 | extern int llc_conn_ac_set_data_flag_2(struct sock* sk, struct sk_buff *skb); | 144 | int llc_conn_ac_dec_tx_win_size(struct sock *sk, struct sk_buff *skb); |
| 169 | extern int llc_conn_ac_set_data_flag_0(struct sock* sk, struct sk_buff *skb); | 145 | int llc_conn_ac_upd_p_flag(struct sock *sk, struct sk_buff *skb); |
| 170 | extern int llc_conn_ac_set_data_flag_1(struct sock* sk, struct sk_buff *skb); | 146 | int llc_conn_ac_set_data_flag_2(struct sock *sk, struct sk_buff *skb); |
| 171 | extern int llc_conn_ac_set_data_flag_1_if_data_flag_eq_0(struct sock* sk, | 147 | int llc_conn_ac_set_data_flag_0(struct sock *sk, struct sk_buff *skb); |
| 172 | struct sk_buff *skb); | 148 | int llc_conn_ac_set_data_flag_1(struct sock *sk, struct sk_buff *skb); |
| 173 | extern int llc_conn_ac_set_p_flag_0(struct sock* sk, struct sk_buff *skb); | 149 | int llc_conn_ac_set_data_flag_1_if_data_flag_eq_0(struct sock *sk, |
| 174 | extern int llc_conn_ac_set_remote_busy_0(struct sock* sk, struct sk_buff *skb); | 150 | struct sk_buff *skb); |
| 175 | extern int llc_conn_ac_set_retry_cnt_0(struct sock* sk, struct sk_buff *skb); | 151 | int llc_conn_ac_set_p_flag_0(struct sock *sk, struct sk_buff *skb); |
| 176 | extern int llc_conn_ac_set_cause_flag_0(struct sock* sk, struct sk_buff *skb); | 152 | int llc_conn_ac_set_remote_busy_0(struct sock *sk, struct sk_buff *skb); |
| 177 | extern int llc_conn_ac_set_cause_flag_1(struct sock* sk, struct sk_buff *skb); | 153 | int llc_conn_ac_set_retry_cnt_0(struct sock *sk, struct sk_buff *skb); |
| 178 | extern int llc_conn_ac_inc_retry_cnt_by_1(struct sock* sk, struct sk_buff *skb); | 154 | int llc_conn_ac_set_cause_flag_0(struct sock *sk, struct sk_buff *skb); |
| 179 | extern int llc_conn_ac_set_vr_0(struct sock* sk, struct sk_buff *skb); | 155 | int llc_conn_ac_set_cause_flag_1(struct sock *sk, struct sk_buff *skb); |
| 180 | extern int llc_conn_ac_inc_vr_by_1(struct sock* sk, struct sk_buff *skb); | 156 | int llc_conn_ac_inc_retry_cnt_by_1(struct sock *sk, struct sk_buff *skb); |
| 181 | extern int llc_conn_ac_set_vs_0(struct sock* sk, struct sk_buff *skb); | 157 | int llc_conn_ac_set_vr_0(struct sock *sk, struct sk_buff *skb); |
| 182 | extern int llc_conn_ac_set_vs_nr(struct sock* sk, struct sk_buff *skb); | 158 | int llc_conn_ac_inc_vr_by_1(struct sock *sk, struct sk_buff *skb); |
| 183 | extern int llc_conn_ac_rst_vs(struct sock* sk, struct sk_buff *skb); | 159 | int llc_conn_ac_set_vs_0(struct sock *sk, struct sk_buff *skb); |
| 184 | extern int llc_conn_ac_upd_vs(struct sock* sk, struct sk_buff *skb); | 160 | int llc_conn_ac_set_vs_nr(struct sock *sk, struct sk_buff *skb); |
| 185 | extern int llc_conn_disc(struct sock* sk, struct sk_buff *skb); | 161 | int llc_conn_ac_rst_vs(struct sock *sk, struct sk_buff *skb); |
| 186 | extern int llc_conn_reset(struct sock* sk, struct sk_buff *skb); | 162 | int llc_conn_ac_upd_vs(struct sock *sk, struct sk_buff *skb); |
| 187 | extern int llc_conn_ac_disc_confirm(struct sock* sk, struct sk_buff *skb); | 163 | int llc_conn_disc(struct sock *sk, struct sk_buff *skb); |
| 188 | extern u8 llc_circular_between(u8 a, u8 b, u8 c); | 164 | int llc_conn_reset(struct sock *sk, struct sk_buff *skb); |
| 189 | extern int llc_conn_ac_send_ack_if_needed(struct sock* sk, struct sk_buff *skb); | 165 | int llc_conn_ac_disc_confirm(struct sock *sk, struct sk_buff *skb); |
| 190 | extern int llc_conn_ac_adjust_npta_by_rr(struct sock* sk, struct sk_buff *skb); | 166 | u8 llc_circular_between(u8 a, u8 b, u8 c); |
| 191 | extern int llc_conn_ac_adjust_npta_by_rnr(struct sock* sk, struct sk_buff *skb); | 167 | int llc_conn_ac_send_ack_if_needed(struct sock *sk, struct sk_buff *skb); |
| 192 | extern int llc_conn_ac_rst_sendack_flag(struct sock* sk, struct sk_buff *skb); | 168 | int llc_conn_ac_adjust_npta_by_rr(struct sock *sk, struct sk_buff *skb); |
| 193 | extern int llc_conn_ac_send_i_rsp_as_ack(struct sock* sk, struct sk_buff *skb); | 169 | int llc_conn_ac_adjust_npta_by_rnr(struct sock *sk, struct sk_buff *skb); |
| 194 | extern int llc_conn_ac_send_i_as_ack(struct sock* sk, struct sk_buff *skb); | 170 | int llc_conn_ac_rst_sendack_flag(struct sock *sk, struct sk_buff *skb); |
| 171 | int llc_conn_ac_send_i_rsp_as_ack(struct sock *sk, struct sk_buff *skb); | ||
| 172 | int llc_conn_ac_send_i_as_ack(struct sock *sk, struct sk_buff *skb); | ||
| 195 | 173 | ||
| 196 | extern void llc_conn_busy_tmr_cb(unsigned long timeout_data); | 174 | void llc_conn_busy_tmr_cb(unsigned long timeout_data); |
| 197 | extern void llc_conn_pf_cycle_tmr_cb(unsigned long timeout_data); | 175 | void llc_conn_pf_cycle_tmr_cb(unsigned long timeout_data); |
| 198 | extern void llc_conn_ack_tmr_cb(unsigned long timeout_data); | 176 | void llc_conn_ack_tmr_cb(unsigned long timeout_data); |
| 199 | extern void llc_conn_rej_tmr_cb(unsigned long timeout_data); | 177 | void llc_conn_rej_tmr_cb(unsigned long timeout_data); |
| 200 | 178 | ||
| 201 | extern void llc_conn_set_p_flag(struct sock *sk, u8 value); | 179 | void llc_conn_set_p_flag(struct sock *sk, u8 value); |
| 202 | #endif /* LLC_C_AC_H */ | 180 | #endif /* LLC_C_AC_H */ |
diff --git a/include/net/llc_c_ev.h b/include/net/llc_c_ev.h index 6ca3113df39e..3948cf111dd0 100644 --- a/include/net/llc_c_ev.h +++ b/include/net/llc_c_ev.h | |||
| @@ -128,138 +128,93 @@ static __inline__ struct llc_conn_state_ev *llc_conn_ev(struct sk_buff *skb) | |||
| 128 | typedef int (*llc_conn_ev_t)(struct sock *sk, struct sk_buff *skb); | 128 | typedef int (*llc_conn_ev_t)(struct sock *sk, struct sk_buff *skb); |
| 129 | typedef int (*llc_conn_ev_qfyr_t)(struct sock *sk, struct sk_buff *skb); | 129 | typedef int (*llc_conn_ev_qfyr_t)(struct sock *sk, struct sk_buff *skb); |
| 130 | 130 | ||
| 131 | extern int llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb); | 131 | int llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb); |
| 132 | extern int llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb); | 132 | int llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb); |
| 133 | extern int llc_conn_ev_disc_req(struct sock *sk, struct sk_buff *skb); | 133 | int llc_conn_ev_disc_req(struct sock *sk, struct sk_buff *skb); |
| 134 | extern int llc_conn_ev_rst_req(struct sock *sk, struct sk_buff *skb); | 134 | int llc_conn_ev_rst_req(struct sock *sk, struct sk_buff *skb); |
| 135 | extern int llc_conn_ev_local_busy_detected(struct sock *sk, | 135 | int llc_conn_ev_local_busy_detected(struct sock *sk, struct sk_buff *skb); |
| 136 | struct sk_buff *skb); | 136 | int llc_conn_ev_local_busy_cleared(struct sock *sk, struct sk_buff *skb); |
| 137 | extern int llc_conn_ev_local_busy_cleared(struct sock *sk, struct sk_buff *skb); | 137 | int llc_conn_ev_rx_bad_pdu(struct sock *sk, struct sk_buff *skb); |
| 138 | extern int llc_conn_ev_rx_bad_pdu(struct sock *sk, struct sk_buff *skb); | 138 | int llc_conn_ev_rx_disc_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb); |
| 139 | extern int llc_conn_ev_rx_disc_cmd_pbit_set_x(struct sock *sk, | 139 | int llc_conn_ev_rx_dm_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb); |
| 140 | int llc_conn_ev_rx_frmr_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb); | ||
| 141 | int llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns(struct sock *sk, | ||
| 142 | struct sk_buff *skb); | ||
| 143 | int llc_conn_ev_rx_i_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb); | ||
| 144 | int llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns(struct sock *sk, | ||
| 140 | struct sk_buff *skb); | 145 | struct sk_buff *skb); |
| 141 | extern int llc_conn_ev_rx_dm_rsp_fbit_set_x(struct sock *sk, | 146 | int llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns(struct sock *sk, |
| 142 | struct sk_buff *skb); | 147 | struct sk_buff *skb); |
| 143 | extern int llc_conn_ev_rx_frmr_rsp_fbit_set_x(struct sock *sk, | 148 | int llc_conn_ev_rx_rej_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb); |
| 144 | struct sk_buff *skb); | 149 | int llc_conn_ev_rx_sabme_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb); |
| 145 | extern int llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns(struct sock *sk, | 150 | int llc_conn_ev_rx_ua_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb); |
| 146 | struct sk_buff *skb); | 151 | int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb); |
| 147 | extern int llc_conn_ev_rx_i_rsp_fbit_set_x(struct sock *sk, | 152 | int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb); |
| 148 | struct sk_buff *skb); | 153 | int llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk, |
| 149 | extern int llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns(struct sock *sk, | ||
| 150 | struct sk_buff *skb); | ||
| 151 | extern int llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns(struct sock *sk, | ||
| 152 | struct sk_buff *skb); | ||
| 153 | extern int llc_conn_ev_rx_rej_rsp_fbit_set_x(struct sock *sk, | ||
| 154 | struct sk_buff *skb); | ||
| 155 | extern int llc_conn_ev_rx_sabme_cmd_pbit_set_x(struct sock *sk, | ||
| 156 | struct sk_buff *skb); | 154 | struct sk_buff *skb); |
| 157 | extern int llc_conn_ev_rx_ua_rsp_fbit_set_x(struct sock *sk, | 155 | int llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr(struct sock *sk, |
| 158 | struct sk_buff *skb); | 156 | struct sk_buff *skb); |
| 159 | extern int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, | 157 | int llc_conn_ev_p_tmr_exp(struct sock *sk, struct sk_buff *skb); |
| 160 | struct sk_buff *skb); | 158 | int llc_conn_ev_ack_tmr_exp(struct sock *sk, struct sk_buff *skb); |
| 161 | extern int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, | 159 | int llc_conn_ev_rej_tmr_exp(struct sock *sk, struct sk_buff *skb); |
| 162 | struct sk_buff *skb); | 160 | int llc_conn_ev_busy_tmr_exp(struct sock *sk, struct sk_buff *skb); |
| 163 | extern int llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk, | 161 | int llc_conn_ev_sendack_tmr_exp(struct sock *sk, struct sk_buff *skb); |
| 164 | struct sk_buff *skb); | ||
| 165 | extern int llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr(struct sock *sk, | ||
| 166 | struct sk_buff *skb); | ||
| 167 | extern int llc_conn_ev_p_tmr_exp(struct sock *sk, struct sk_buff *skb); | ||
| 168 | extern int llc_conn_ev_ack_tmr_exp(struct sock *sk, struct sk_buff *skb); | ||
| 169 | extern int llc_conn_ev_rej_tmr_exp(struct sock *sk, struct sk_buff *skb); | ||
| 170 | extern int llc_conn_ev_busy_tmr_exp(struct sock *sk, struct sk_buff *skb); | ||
| 171 | extern int llc_conn_ev_sendack_tmr_exp(struct sock *sk, struct sk_buff *skb); | ||
| 172 | /* NOT_USED functions and their variations */ | 162 | /* NOT_USED functions and their variations */ |
| 173 | extern int llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk, | 163 | int llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 174 | struct sk_buff *skb); | 164 | int llc_conn_ev_rx_xxx_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 175 | extern int llc_conn_ev_rx_xxx_rsp_fbit_set_1(struct sock *sk, | 165 | int llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk, |
| 176 | struct sk_buff *skb); | 166 | struct sk_buff *skb); |
| 177 | extern int llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk, | 167 | int llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns(struct sock *sk, |
| 178 | struct sk_buff *skb); | 168 | struct sk_buff *skb); |
| 179 | extern int llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns(struct sock *sk, | 169 | int llc_conn_ev_rx_i_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 180 | struct sk_buff *skb); | 170 | int llc_conn_ev_rx_i_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 181 | extern int llc_conn_ev_rx_i_cmd_pbit_set_0(struct sock *sk, | 171 | int llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns(struct sock *sk, |
| 182 | struct sk_buff *skb); | 172 | struct sk_buff *skb); |
| 183 | extern int llc_conn_ev_rx_i_cmd_pbit_set_1(struct sock *sk, | 173 | int llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns(struct sock *sk, |
| 184 | struct sk_buff *skb); | 174 | struct sk_buff *skb); |
| 185 | extern int llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns(struct sock *sk, | 175 | int llc_conn_ev_rx_i_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 186 | struct sk_buff *skb); | 176 | int llc_conn_ev_rx_i_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 187 | extern int llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns(struct sock *sk, | 177 | int llc_conn_ev_rx_rr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 188 | struct sk_buff *skb); | 178 | int llc_conn_ev_rx_rr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 189 | extern int llc_conn_ev_rx_i_rsp_fbit_set_0(struct sock *sk, | 179 | int llc_conn_ev_rx_rr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 190 | struct sk_buff *skb); | 180 | int llc_conn_ev_rx_rr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 191 | extern int llc_conn_ev_rx_i_rsp_fbit_set_1(struct sock *sk, | 181 | int llc_conn_ev_rx_rnr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 192 | struct sk_buff *skb); | 182 | int llc_conn_ev_rx_rnr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 193 | extern int llc_conn_ev_rx_rr_cmd_pbit_set_0(struct sock *sk, | 183 | int llc_conn_ev_rx_rnr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 194 | struct sk_buff *skb); | 184 | int llc_conn_ev_rx_rnr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 195 | extern int llc_conn_ev_rx_rr_cmd_pbit_set_1(struct sock *sk, | 185 | int llc_conn_ev_rx_rej_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 196 | struct sk_buff *skb); | 186 | int llc_conn_ev_rx_rej_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 197 | extern int llc_conn_ev_rx_rr_rsp_fbit_set_0(struct sock *sk, | 187 | int llc_conn_ev_rx_rej_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb); |
| 198 | struct sk_buff *skb); | 188 | int llc_conn_ev_rx_rej_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb); |
| 199 | extern int llc_conn_ev_rx_rr_rsp_fbit_set_1(struct sock *sk, | 189 | int llc_conn_ev_rx_any_frame(struct sock *sk, struct sk_buff *skb); |
| 200 | struct sk_buff *skb); | 190 | int llc_conn_ev_tx_buffer_full(struct sock *sk, struct sk_buff *skb); |
| 201 | extern int llc_conn_ev_rx_rnr_cmd_pbit_set_0(struct sock *sk, | 191 | int llc_conn_ev_init_p_f_cycle(struct sock *sk, struct sk_buff *skb); |
| 202 | struct sk_buff *skb); | ||
| 203 | extern int llc_conn_ev_rx_rnr_cmd_pbit_set_1(struct sock *sk, | ||
| 204 | struct sk_buff *skb); | ||
| 205 | extern int llc_conn_ev_rx_rnr_rsp_fbit_set_0(struct sock *sk, | ||
| 206 | struct sk_buff *skb); | ||
| 207 | extern int llc_conn_ev_rx_rnr_rsp_fbit_set_1(struct sock *sk, | ||
| 208 | struct sk_buff *skb); | ||
| 209 | extern int llc_conn_ev_rx_rej_cmd_pbit_set_0(struct sock *sk, | ||
| 210 | struct sk_buff *skb); | ||
| 211 | extern int llc_conn_ev_rx_rej_cmd_pbit_set_1(struct sock *sk, | ||
| 212 | struct sk_buff *skb); | ||
| 213 | extern int llc_conn_ev_rx_rej_rsp_fbit_set_0(struct sock *sk, | ||
| 214 | struct sk_buff *skb); | ||
| 215 | extern int llc_conn_ev_rx_rej_rsp_fbit_set_1(struct sock *sk, | ||
| 216 | struct sk_buff *skb); | ||
| 217 | extern int llc_conn_ev_rx_any_frame(struct sock *sk, struct sk_buff *skb); | ||
| 218 | extern int llc_conn_ev_tx_buffer_full(struct sock *sk, struct sk_buff *skb); | ||
| 219 | extern int llc_conn_ev_init_p_f_cycle(struct sock *sk, struct sk_buff *skb); | ||
| 220 | 192 | ||
| 221 | /* Available connection action qualifiers */ | 193 | /* Available connection action qualifiers */ |
| 222 | extern int llc_conn_ev_qlfy_data_flag_eq_1(struct sock *sk, | 194 | int llc_conn_ev_qlfy_data_flag_eq_1(struct sock *sk, struct sk_buff *skb); |
| 223 | struct sk_buff *skb); | 195 | int llc_conn_ev_qlfy_data_flag_eq_0(struct sock *sk, struct sk_buff *skb); |
| 224 | extern int llc_conn_ev_qlfy_data_flag_eq_0(struct sock *sk, | 196 | int llc_conn_ev_qlfy_data_flag_eq_2(struct sock *sk, struct sk_buff *skb); |
| 225 | struct sk_buff *skb); | 197 | int llc_conn_ev_qlfy_p_flag_eq_1(struct sock *sk, struct sk_buff *skb); |
| 226 | extern int llc_conn_ev_qlfy_data_flag_eq_2(struct sock *sk, | 198 | int llc_conn_ev_qlfy_last_frame_eq_1(struct sock *sk, struct sk_buff *skb); |
| 227 | struct sk_buff *skb); | 199 | int llc_conn_ev_qlfy_last_frame_eq_0(struct sock *sk, struct sk_buff *skb); |
| 228 | extern int llc_conn_ev_qlfy_p_flag_eq_1(struct sock *sk, struct sk_buff *skb); | 200 | int llc_conn_ev_qlfy_p_flag_eq_0(struct sock *sk, struct sk_buff *skb); |
| 229 | extern int llc_conn_ev_qlfy_last_frame_eq_1(struct sock *sk, | 201 | int llc_conn_ev_qlfy_p_flag_eq_f(struct sock *sk, struct sk_buff *skb); |
| 230 | struct sk_buff *skb); | 202 | int llc_conn_ev_qlfy_remote_busy_eq_0(struct sock *sk, struct sk_buff *skb); |
| 231 | extern int llc_conn_ev_qlfy_last_frame_eq_0(struct sock *sk, | 203 | int llc_conn_ev_qlfy_remote_busy_eq_1(struct sock *sk, struct sk_buff *skb); |
| 232 | struct sk_buff *skb); | 204 | int llc_conn_ev_qlfy_retry_cnt_lt_n2(struct sock *sk, struct sk_buff *skb); |
| 233 | extern int llc_conn_ev_qlfy_p_flag_eq_0(struct sock *sk, struct sk_buff *skb); | 205 | int llc_conn_ev_qlfy_retry_cnt_gte_n2(struct sock *sk, struct sk_buff *skb); |
| 234 | extern int llc_conn_ev_qlfy_p_flag_eq_f(struct sock *sk, struct sk_buff *skb); | 206 | int llc_conn_ev_qlfy_s_flag_eq_1(struct sock *sk, struct sk_buff *skb); |
| 235 | extern int llc_conn_ev_qlfy_remote_busy_eq_0(struct sock *sk, | 207 | int llc_conn_ev_qlfy_s_flag_eq_0(struct sock *sk, struct sk_buff *skb); |
| 236 | struct sk_buff *skb); | 208 | int llc_conn_ev_qlfy_cause_flag_eq_1(struct sock *sk, struct sk_buff *skb); |
| 237 | extern int llc_conn_ev_qlfy_remote_busy_eq_1(struct sock *sk, | 209 | int llc_conn_ev_qlfy_cause_flag_eq_0(struct sock *sk, struct sk_buff *skb); |
| 238 | struct sk_buff *skb); | 210 | int llc_conn_ev_qlfy_set_status_conn(struct sock *sk, struct sk_buff *skb); |
| 239 | extern int llc_conn_ev_qlfy_retry_cnt_lt_n2(struct sock *sk, | 211 | int llc_conn_ev_qlfy_set_status_disc(struct sock *sk, struct sk_buff *skb); |
| 240 | struct sk_buff *skb); | 212 | int llc_conn_ev_qlfy_set_status_failed(struct sock *sk, struct sk_buff *skb); |
| 241 | extern int llc_conn_ev_qlfy_retry_cnt_gte_n2(struct sock *sk, | 213 | int llc_conn_ev_qlfy_set_status_remote_busy(struct sock *sk, |
| 242 | struct sk_buff *skb); | ||
| 243 | extern int llc_conn_ev_qlfy_s_flag_eq_1(struct sock *sk, struct sk_buff *skb); | ||
| 244 | extern int llc_conn_ev_qlfy_s_flag_eq_0(struct sock *sk, struct sk_buff *skb); | ||
| 245 | extern int llc_conn_ev_qlfy_cause_flag_eq_1(struct sock *sk, | ||
| 246 | struct sk_buff *skb); | ||
| 247 | extern int llc_conn_ev_qlfy_cause_flag_eq_0(struct sock *sk, | ||
| 248 | struct sk_buff *skb); | 214 | struct sk_buff *skb); |
| 249 | extern int llc_conn_ev_qlfy_set_status_conn(struct sock *sk, | 215 | int llc_conn_ev_qlfy_set_status_refuse(struct sock *sk, struct sk_buff *skb); |
| 250 | struct sk_buff *skb); | 216 | int llc_conn_ev_qlfy_set_status_conflict(struct sock *sk, struct sk_buff *skb); |
| 251 | extern int llc_conn_ev_qlfy_set_status_disc(struct sock *sk, | 217 | int llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, struct sk_buff *skb); |
| 252 | struct sk_buff *skb); | ||
| 253 | extern int llc_conn_ev_qlfy_set_status_failed(struct sock *sk, | ||
| 254 | struct sk_buff *skb); | ||
| 255 | extern int llc_conn_ev_qlfy_set_status_remote_busy(struct sock *sk, | ||
| 256 | struct sk_buff *skb); | ||
| 257 | extern int llc_conn_ev_qlfy_set_status_refuse(struct sock *sk, | ||
| 258 | struct sk_buff *skb); | ||
| 259 | extern int llc_conn_ev_qlfy_set_status_conflict(struct sock *sk, | ||
| 260 | struct sk_buff *skb); | ||
| 261 | extern int llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, | ||
| 262 | struct sk_buff *skb); | ||
| 263 | 218 | ||
| 264 | static __inline__ int llc_conn_space(struct sock *sk, struct sk_buff *skb) | 219 | static __inline__ int llc_conn_space(struct sock *sk, struct sk_buff *skb) |
| 265 | { | 220 | { |
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index 2f97d8ddce92..0134681acc4c 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h | |||
| @@ -95,28 +95,24 @@ static __inline__ char llc_backlog_type(struct sk_buff *skb) | |||
| 95 | return skb->cb[sizeof(skb->cb) - 1]; | 95 | return skb->cb[sizeof(skb->cb) - 1]; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | extern struct sock *llc_sk_alloc(struct net *net, int family, gfp_t priority, | 98 | struct sock *llc_sk_alloc(struct net *net, int family, gfp_t priority, |
| 99 | struct proto *prot); | 99 | struct proto *prot); |
| 100 | extern void llc_sk_free(struct sock *sk); | 100 | void llc_sk_free(struct sock *sk); |
| 101 | 101 | ||
| 102 | extern void llc_sk_reset(struct sock *sk); | 102 | void llc_sk_reset(struct sock *sk); |
| 103 | 103 | ||
| 104 | /* Access to a connection */ | 104 | /* Access to a connection */ |
| 105 | extern int llc_conn_state_process(struct sock *sk, struct sk_buff *skb); | 105 | int llc_conn_state_process(struct sock *sk, struct sk_buff *skb); |
| 106 | extern void llc_conn_send_pdu(struct sock *sk, struct sk_buff *skb); | 106 | void llc_conn_send_pdu(struct sock *sk, struct sk_buff *skb); |
| 107 | extern void llc_conn_rtn_pdu(struct sock *sk, struct sk_buff *skb); | 107 | void llc_conn_rtn_pdu(struct sock *sk, struct sk_buff *skb); |
| 108 | extern void llc_conn_resend_i_pdu_as_cmd(struct sock *sk, u8 nr, | 108 | void llc_conn_resend_i_pdu_as_cmd(struct sock *sk, u8 nr, u8 first_p_bit); |
| 109 | u8 first_p_bit); | 109 | void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, u8 first_f_bit); |
| 110 | extern void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, | 110 | int llc_conn_remove_acked_pdus(struct sock *conn, u8 nr, u16 *how_many_unacked); |
| 111 | u8 first_f_bit); | 111 | struct sock *llc_lookup_established(struct llc_sap *sap, struct llc_addr *daddr, |
| 112 | extern int llc_conn_remove_acked_pdus(struct sock *conn, u8 nr, | 112 | struct llc_addr *laddr); |
| 113 | u16 *how_many_unacked); | 113 | void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk); |
| 114 | extern struct sock *llc_lookup_established(struct llc_sap *sap, | 114 | void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk); |
| 115 | struct llc_addr *daddr, | ||
| 116 | struct llc_addr *laddr); | ||
| 117 | extern void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk); | ||
| 118 | extern void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk); | ||
| 119 | 115 | ||
| 120 | extern u8 llc_data_accept_state(u8 state); | 116 | u8 llc_data_accept_state(u8 state); |
| 121 | extern void llc_build_offset_table(void); | 117 | void llc_build_offset_table(void); |
| 122 | #endif /* LLC_CONN_H */ | 118 | #endif /* LLC_CONN_H */ |
diff --git a/include/net/llc_if.h b/include/net/llc_if.h index f0cb909b60eb..8d5c543cd620 100644 --- a/include/net/llc_if.h +++ b/include/net/llc_if.h | |||
| @@ -62,8 +62,7 @@ | |||
| 62 | #define LLC_STATUS_CONFLICT 7 /* disconnect conn */ | 62 | #define LLC_STATUS_CONFLICT 7 /* disconnect conn */ |
| 63 | #define LLC_STATUS_RESET_DONE 8 /* */ | 63 | #define LLC_STATUS_RESET_DONE 8 /* */ |
| 64 | 64 | ||
| 65 | extern int llc_establish_connection(struct sock *sk, u8 *lmac, | 65 | int llc_establish_connection(struct sock *sk, u8 *lmac, u8 *dmac, u8 dsap); |
| 66 | u8 *dmac, u8 dsap); | 66 | int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb); |
| 67 | extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb); | 67 | int llc_send_disc(struct sock *sk); |
| 68 | extern int llc_send_disc(struct sock *sk); | ||
| 69 | #endif /* LLC_IF_H */ | 68 | #endif /* LLC_IF_H */ |
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index 5a93d13ac95c..31e2de7d57c5 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
| @@ -410,21 +410,20 @@ struct llc_frmr_info { | |||
| 410 | u8 ind_bits; /* indicator bits set with macro */ | 410 | u8 ind_bits; /* indicator bits set with macro */ |
| 411 | } __packed; | 411 | } __packed; |
| 412 | 412 | ||
| 413 | extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type); | 413 | void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type); |
| 414 | extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value); | 414 | void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value); |
| 415 | extern void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit); | 415 | void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit); |
| 416 | extern void llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit); | 416 | void llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit); |
| 417 | extern void llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr); | 417 | void llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr); |
| 418 | extern void llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); | 418 | void llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); |
| 419 | extern void llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); | 419 | void llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); |
| 420 | extern void llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); | 420 | void llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); |
| 421 | extern void llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit); | 421 | void llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit); |
| 422 | extern void llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit); | 422 | void llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit); |
| 423 | extern void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, | 423 | void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, struct llc_pdu_sn *prev_pdu, |
| 424 | struct llc_pdu_sn *prev_pdu, | 424 | u8 f_bit, u8 vs, u8 vr, u8 vzyxw); |
| 425 | u8 f_bit, u8 vs, u8 vr, u8 vzyxw); | 425 | void llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); |
| 426 | extern void llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); | 426 | void llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); |
| 427 | extern void llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); | 427 | void llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); |
| 428 | extern void llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); | 428 | void llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit); |
| 429 | extern void llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit); | ||
| 430 | #endif /* LLC_PDU_H */ | 429 | #endif /* LLC_PDU_H */ |
diff --git a/include/net/llc_s_ac.h b/include/net/llc_s_ac.h index 37a3bbd02394..a61b98c108ee 100644 --- a/include/net/llc_s_ac.h +++ b/include/net/llc_s_ac.h | |||
| @@ -25,15 +25,13 @@ | |||
| 25 | /* All action functions must look like this */ | 25 | /* All action functions must look like this */ |
| 26 | typedef int (*llc_sap_action_t)(struct llc_sap *sap, struct sk_buff *skb); | 26 | typedef int (*llc_sap_action_t)(struct llc_sap *sap, struct sk_buff *skb); |
| 27 | 27 | ||
| 28 | extern int llc_sap_action_unitdata_ind(struct llc_sap *sap, | 28 | int llc_sap_action_unitdata_ind(struct llc_sap *sap, struct sk_buff *skb); |
| 29 | struct sk_buff *skb); | 29 | int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb); |
| 30 | extern int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb); | 30 | int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb); |
| 31 | extern int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb); | 31 | int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb); |
| 32 | extern int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb); | 32 | int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb); |
| 33 | extern int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb); | 33 | int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb); |
| 34 | extern int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb); | 34 | int llc_sap_action_report_status(struct llc_sap *sap, struct sk_buff *skb); |
| 35 | extern int llc_sap_action_report_status(struct llc_sap *sap, | 35 | int llc_sap_action_xid_ind(struct llc_sap *sap, struct sk_buff *skb); |
| 36 | struct sk_buff *skb); | 36 | int llc_sap_action_test_ind(struct llc_sap *sap, struct sk_buff *skb); |
| 37 | extern int llc_sap_action_xid_ind(struct llc_sap *sap, struct sk_buff *skb); | ||
| 38 | extern int llc_sap_action_test_ind(struct llc_sap *sap, struct sk_buff *skb); | ||
| 39 | #endif /* LLC_S_AC_H */ | 37 | #endif /* LLC_S_AC_H */ |
diff --git a/include/net/llc_s_ev.h b/include/net/llc_s_ev.h index e3acb9329e4a..84db3a59ed28 100644 --- a/include/net/llc_s_ev.h +++ b/include/net/llc_s_ev.h | |||
| @@ -53,15 +53,14 @@ struct llc_sap; | |||
| 53 | 53 | ||
| 54 | typedef int (*llc_sap_ev_t)(struct llc_sap *sap, struct sk_buff *skb); | 54 | typedef int (*llc_sap_ev_t)(struct llc_sap *sap, struct sk_buff *skb); |
| 55 | 55 | ||
| 56 | extern int llc_sap_ev_activation_req(struct llc_sap *sap, struct sk_buff *skb); | 56 | int llc_sap_ev_activation_req(struct llc_sap *sap, struct sk_buff *skb); |
| 57 | extern int llc_sap_ev_rx_ui(struct llc_sap *sap, struct sk_buff *skb); | 57 | int llc_sap_ev_rx_ui(struct llc_sap *sap, struct sk_buff *skb); |
| 58 | extern int llc_sap_ev_unitdata_req(struct llc_sap *sap, struct sk_buff *skb); | 58 | int llc_sap_ev_unitdata_req(struct llc_sap *sap, struct sk_buff *skb); |
| 59 | extern int llc_sap_ev_xid_req(struct llc_sap *sap, struct sk_buff *skb); | 59 | int llc_sap_ev_xid_req(struct llc_sap *sap, struct sk_buff *skb); |
| 60 | extern int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct sk_buff *skb); | 60 | int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct sk_buff *skb); |
| 61 | extern int llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct sk_buff *skb); | 61 | int llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct sk_buff *skb); |
| 62 | extern int llc_sap_ev_test_req(struct llc_sap *sap, struct sk_buff *skb); | 62 | int llc_sap_ev_test_req(struct llc_sap *sap, struct sk_buff *skb); |
| 63 | extern int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct sk_buff *skb); | 63 | int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct sk_buff *skb); |
| 64 | extern int llc_sap_ev_rx_test_r(struct llc_sap *sap, struct sk_buff *skb); | 64 | int llc_sap_ev_rx_test_r(struct llc_sap *sap, struct sk_buff *skb); |
| 65 | extern int llc_sap_ev_deactivation_req(struct llc_sap *sap, | 65 | int llc_sap_ev_deactivation_req(struct llc_sap *sap, struct sk_buff *skb); |
| 66 | struct sk_buff *skb); | ||
| 67 | #endif /* LLC_S_EV_H */ | 66 | #endif /* LLC_S_EV_H */ |
diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h index ed25bec2f648..1e4df9fd9fb2 100644 --- a/include/net/llc_sap.h +++ b/include/net/llc_sap.h | |||
| @@ -19,18 +19,14 @@ struct net_device; | |||
| 19 | struct sk_buff; | 19 | struct sk_buff; |
| 20 | struct sock; | 20 | struct sock; |
| 21 | 21 | ||
| 22 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); | 22 | void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); |
| 23 | extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb, | 23 | void llc_save_primitive(struct sock *sk, struct sk_buff *skb, |
| 24 | unsigned char prim); | 24 | unsigned char prim); |
| 25 | extern struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev, | 25 | struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev, |
| 26 | u8 type, u32 data_size); | 26 | u8 type, u32 data_size); |
| 27 | 27 | ||
| 28 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, | 28 | void llc_build_and_send_test_pkt(struct llc_sap *sap, struct sk_buff *skb, |
| 29 | struct sk_buff *skb, | 29 | unsigned char *dmac, unsigned char dsap); |
| 30 | unsigned char *dmac, | 30 | void llc_build_and_send_xid_pkt(struct llc_sap *sap, struct sk_buff *skb, |
| 31 | unsigned char dsap); | 31 | unsigned char *dmac, unsigned char dsap); |
| 32 | extern void llc_build_and_send_xid_pkt(struct llc_sap *sap, | ||
| 33 | struct sk_buff *skb, | ||
| 34 | unsigned char *dmac, | ||
| 35 | unsigned char dsap); | ||
| 36 | #endif /* LLC_SAP_H */ | 32 | #endif /* LLC_SAP_H */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index cc6035f1a2f1..7ceed99a05bc 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -829,6 +829,15 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
| 829 | * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 | 829 | * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 |
| 830 | * @RX_FLAG_10MHZ: 10 MHz (half channel) was used | 830 | * @RX_FLAG_10MHZ: 10 MHz (half channel) was used |
| 831 | * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used | 831 | * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used |
| 832 | * @RX_FLAG_AMSDU_MORE: Some drivers may prefer to report separate A-MSDU | ||
| 833 | * subframes instead of a one huge frame for performance reasons. | ||
| 834 | * All, but the last MSDU from an A-MSDU should have this flag set. E.g. | ||
| 835 | * if an A-MSDU has 3 frames, the first 2 must have the flag set, while | ||
| 836 | * the 3rd (last) one must not have this flag set. The flag is used to | ||
| 837 | * deal with retransmission/duplication recovery properly since A-MSDU | ||
| 838 | * subframes share the same sequence number. Reported subframes can be | ||
| 839 | * either regular MSDU or singly A-MSDUs. Subframes must not be | ||
| 840 | * interleaved with other frames. | ||
| 832 | */ | 841 | */ |
| 833 | enum mac80211_rx_flags { | 842 | enum mac80211_rx_flags { |
| 834 | RX_FLAG_MMIC_ERROR = BIT(0), | 843 | RX_FLAG_MMIC_ERROR = BIT(0), |
| @@ -859,6 +868,7 @@ enum mac80211_rx_flags { | |||
| 859 | RX_FLAG_STBC_MASK = BIT(26) | BIT(27), | 868 | RX_FLAG_STBC_MASK = BIT(26) | BIT(27), |
| 860 | RX_FLAG_10MHZ = BIT(28), | 869 | RX_FLAG_10MHZ = BIT(28), |
| 861 | RX_FLAG_5MHZ = BIT(29), | 870 | RX_FLAG_5MHZ = BIT(29), |
| 871 | RX_FLAG_AMSDU_MORE = BIT(30), | ||
| 862 | }; | 872 | }; |
| 863 | 873 | ||
| 864 | #define RX_FLAG_STBC_SHIFT 26 | 874 | #define RX_FLAG_STBC_SHIFT 26 |
| @@ -1492,6 +1502,15 @@ struct ieee80211_tx_control { | |||
| 1492 | * | 1502 | * |
| 1493 | * @IEEE80211_HW_TIMING_BEACON_ONLY: Use sync timing from beacon frames | 1503 | * @IEEE80211_HW_TIMING_BEACON_ONLY: Use sync timing from beacon frames |
| 1494 | * only, to allow getting TBTT of a DTIM beacon. | 1504 | * only, to allow getting TBTT of a DTIM beacon. |
| 1505 | * | ||
| 1506 | * @IEEE80211_HW_SUPPORTS_HT_CCK_RATES: Hardware supports mixing HT/CCK rates | ||
| 1507 | * and can cope with CCK rates in an aggregation session (e.g. by not | ||
| 1508 | * using aggregation for such frames.) | ||
| 1509 | * | ||
| 1510 | * @IEEE80211_HW_CHANCTX_STA_CSA: Support 802.11h based channel-switch (CSA) | ||
| 1511 | * for a single active channel while using channel contexts. When support | ||
| 1512 | * is not enabled the default action is to disconnect when getting the | ||
| 1513 | * CSA frame. | ||
| 1495 | */ | 1514 | */ |
| 1496 | enum ieee80211_hw_flags { | 1515 | enum ieee80211_hw_flags { |
| 1497 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1516 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
| @@ -1522,6 +1541,7 @@ enum ieee80211_hw_flags { | |||
| 1522 | IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, | 1541 | IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, |
| 1523 | IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, | 1542 | IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, |
| 1524 | IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, | 1543 | IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, |
| 1544 | IEEE80211_HW_CHANCTX_STA_CSA = 1<<28, | ||
| 1525 | }; | 1545 | }; |
| 1526 | 1546 | ||
| 1527 | /** | 1547 | /** |
| @@ -2666,6 +2686,10 @@ enum ieee80211_roc_type { | |||
| 2666 | * zero using ieee80211_csa_is_complete() after the beacon has been | 2686 | * zero using ieee80211_csa_is_complete() after the beacon has been |
| 2667 | * transmitted and then call ieee80211_csa_finish(). | 2687 | * transmitted and then call ieee80211_csa_finish(). |
| 2668 | * | 2688 | * |
| 2689 | * @join_ibss: Join an IBSS (on an IBSS interface); this is called after all | ||
| 2690 | * information in bss_conf is set up and the beacon can be retrieved. A | ||
| 2691 | * channel context is bound before this is called. | ||
| 2692 | * @leave_ibss: Leave the IBSS again. | ||
| 2669 | */ | 2693 | */ |
| 2670 | struct ieee80211_ops { | 2694 | struct ieee80211_ops { |
| 2671 | void (*tx)(struct ieee80211_hw *hw, | 2695 | void (*tx)(struct ieee80211_hw *hw, |
| @@ -2857,6 +2881,9 @@ struct ieee80211_ops { | |||
| 2857 | void (*channel_switch_beacon)(struct ieee80211_hw *hw, | 2881 | void (*channel_switch_beacon)(struct ieee80211_hw *hw, |
| 2858 | struct ieee80211_vif *vif, | 2882 | struct ieee80211_vif *vif, |
| 2859 | struct cfg80211_chan_def *chandef); | 2883 | struct cfg80211_chan_def *chandef); |
| 2884 | |||
| 2885 | int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
| 2886 | void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
| 2860 | }; | 2887 | }; |
| 2861 | 2888 | ||
| 2862 | /** | 2889 | /** |
| @@ -3920,6 +3947,25 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, | |||
| 3920 | void *data); | 3947 | void *data); |
| 3921 | 3948 | ||
| 3922 | /** | 3949 | /** |
| 3950 | * ieee80211_iterate_active_interfaces_rtnl - iterate active interfaces | ||
| 3951 | * | ||
| 3952 | * This function iterates over the interfaces associated with a given | ||
| 3953 | * hardware that are currently active and calls the callback for them. | ||
| 3954 | * This version can only be used while holding the RTNL. | ||
| 3955 | * | ||
| 3956 | * @hw: the hardware struct of which the interfaces should be iterated over | ||
| 3957 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
| 3958 | * @iterator: the iterator function to call, cannot sleep | ||
| 3959 | * @data: first argument of the iterator function | ||
| 3960 | */ | ||
| 3961 | void ieee80211_iterate_active_interfaces_rtnl(struct ieee80211_hw *hw, | ||
| 3962 | u32 iter_flags, | ||
| 3963 | void (*iterator)(void *data, | ||
| 3964 | u8 *mac, | ||
| 3965 | struct ieee80211_vif *vif), | ||
| 3966 | void *data); | ||
| 3967 | |||
| 3968 | /** | ||
| 3923 | * ieee80211_queue_work - add work onto the mac80211 workqueue | 3969 | * ieee80211_queue_work - add work onto the mac80211 workqueue |
| 3924 | * | 3970 | * |
| 3925 | * Drivers and mac80211 use this to add work onto the mac80211 workqueue. | 3971 | * Drivers and mac80211 use this to add work onto the mac80211 workqueue. |
| @@ -4525,4 +4571,18 @@ void ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif, | |||
| 4525 | struct cfg80211_wowlan_wakeup *wakeup, | 4571 | struct cfg80211_wowlan_wakeup *wakeup, |
| 4526 | gfp_t gfp); | 4572 | gfp_t gfp); |
| 4527 | 4573 | ||
| 4574 | /** | ||
| 4575 | * ieee80211_tx_prepare_skb - prepare an 802.11 skb for transmission | ||
| 4576 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
| 4577 | * @vif: virtual interface | ||
| 4578 | * @skb: frame to be sent from within the driver | ||
| 4579 | * @band: the band to transmit on | ||
| 4580 | * @sta: optional pointer to get the station to send the frame to | ||
| 4581 | * | ||
| 4582 | * Note: must be called under RCU lock | ||
| 4583 | */ | ||
| 4584 | bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, | ||
| 4585 | struct ieee80211_vif *vif, struct sk_buff *skb, | ||
| 4586 | int band, struct ieee80211_sta **sta); | ||
| 4587 | |||
| 4528 | #endif /* MAC80211_H */ | 4588 | #endif /* MAC80211_H */ |
diff --git a/include/net/mrp.h b/include/net/mrp.h index 0f7558b638ae..31912c3be772 100644 --- a/include/net/mrp.h +++ b/include/net/mrp.h | |||
| @@ -126,19 +126,17 @@ struct mrp_port { | |||
| 126 | struct rcu_head rcu; | 126 | struct rcu_head rcu; |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | extern int mrp_register_application(struct mrp_application *app); | 129 | int mrp_register_application(struct mrp_application *app); |
| 130 | extern void mrp_unregister_application(struct mrp_application *app); | 130 | void mrp_unregister_application(struct mrp_application *app); |
| 131 | 131 | ||
| 132 | extern int mrp_init_applicant(struct net_device *dev, | 132 | int mrp_init_applicant(struct net_device *dev, struct mrp_application *app); |
| 133 | struct mrp_application *app); | 133 | void mrp_uninit_applicant(struct net_device *dev, struct mrp_application *app); |
| 134 | extern void mrp_uninit_applicant(struct net_device *dev, | 134 | |
| 135 | struct mrp_application *app); | 135 | int mrp_request_join(const struct net_device *dev, |
| 136 | 136 | const struct mrp_application *app, | |
| 137 | extern int mrp_request_join(const struct net_device *dev, | 137 | const void *value, u8 len, u8 type); |
| 138 | const struct mrp_application *app, | 138 | void mrp_request_leave(const struct net_device *dev, |
| 139 | const void *value, u8 len, u8 type); | 139 | const struct mrp_application *app, |
| 140 | extern void mrp_request_leave(const struct net_device *dev, | 140 | const void *value, u8 len, u8 type); |
| 141 | const struct mrp_application *app, | ||
| 142 | const void *value, u8 len, u8 type); | ||
| 143 | 141 | ||
| 144 | #endif /* _NET_MRP_H */ | 142 | #endif /* _NET_MRP_H */ |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index ea0cc26ab70e..6bbda34d5e59 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
| @@ -110,8 +110,8 @@ struct ndisc_options { | |||
| 110 | 110 | ||
| 111 | #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) | 111 | #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) |
| 112 | 112 | ||
| 113 | extern struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len, | 113 | struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len, |
| 114 | struct ndisc_options *ndopts); | 114 | struct ndisc_options *ndopts); |
| 115 | 115 | ||
| 116 | /* | 116 | /* |
| 117 | * Return the padding between the option length and the start of the | 117 | * Return the padding between the option length and the start of the |
| @@ -189,60 +189,51 @@ static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, cons | |||
| 189 | return n; | 189 | return n; |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | extern int ndisc_init(void); | 192 | int ndisc_init(void); |
| 193 | extern int ndisc_late_init(void); | 193 | int ndisc_late_init(void); |
| 194 | 194 | ||
| 195 | extern void ndisc_late_cleanup(void); | 195 | void ndisc_late_cleanup(void); |
| 196 | extern void ndisc_cleanup(void); | 196 | void ndisc_cleanup(void); |
| 197 | 197 | ||
| 198 | extern int ndisc_rcv(struct sk_buff *skb); | 198 | int ndisc_rcv(struct sk_buff *skb); |
| 199 | 199 | ||
| 200 | extern void ndisc_send_ns(struct net_device *dev, | 200 | void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, |
| 201 | struct neighbour *neigh, | 201 | const struct in6_addr *solicit, |
| 202 | const struct in6_addr *solicit, | 202 | const struct in6_addr *daddr, const struct in6_addr *saddr); |
| 203 | const struct in6_addr *daddr, | ||
| 204 | const struct in6_addr *saddr); | ||
| 205 | 203 | ||
| 206 | extern void ndisc_send_rs(struct net_device *dev, | 204 | void ndisc_send_rs(struct net_device *dev, |
| 207 | const struct in6_addr *saddr, | 205 | const struct in6_addr *saddr, const struct in6_addr *daddr); |
| 208 | const struct in6_addr *daddr); | 206 | void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, |
| 209 | extern void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, | 207 | const struct in6_addr *daddr, |
| 210 | const struct in6_addr *daddr, | 208 | const struct in6_addr *solicited_addr, |
| 211 | const struct in6_addr *solicited_addr, | 209 | bool router, bool solicited, bool override, bool inc_opt); |
| 212 | bool router, bool solicited, bool override, | ||
| 213 | bool inc_opt); | ||
| 214 | 210 | ||
| 215 | extern void ndisc_send_redirect(struct sk_buff *skb, | 211 | void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target); |
| 216 | const struct in6_addr *target); | ||
| 217 | 212 | ||
| 218 | extern int ndisc_mc_map(const struct in6_addr *addr, char *buf, | 213 | int ndisc_mc_map(const struct in6_addr *addr, char *buf, struct net_device *dev, |
| 219 | struct net_device *dev, int dir); | 214 | int dir); |
| 220 | 215 | ||
| 221 | 216 | ||
| 222 | /* | 217 | /* |
| 223 | * IGMP | 218 | * IGMP |
| 224 | */ | 219 | */ |
| 225 | extern int igmp6_init(void); | 220 | int igmp6_init(void); |
| 226 | 221 | ||
| 227 | extern void igmp6_cleanup(void); | 222 | void igmp6_cleanup(void); |
| 228 | 223 | ||
| 229 | extern int igmp6_event_query(struct sk_buff *skb); | 224 | int igmp6_event_query(struct sk_buff *skb); |
| 230 | 225 | ||
| 231 | extern int igmp6_event_report(struct sk_buff *skb); | 226 | int igmp6_event_report(struct sk_buff *skb); |
| 232 | 227 | ||
| 233 | 228 | ||
| 234 | #ifdef CONFIG_SYSCTL | 229 | #ifdef CONFIG_SYSCTL |
| 235 | extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, | 230 | int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, |
| 236 | int write, | 231 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 237 | void __user *buffer, | ||
| 238 | size_t *lenp, | ||
| 239 | loff_t *ppos); | ||
| 240 | int ndisc_ifinfo_sysctl_strategy(struct ctl_table *ctl, | 232 | int ndisc_ifinfo_sysctl_strategy(struct ctl_table *ctl, |
| 241 | void __user *oldval, size_t __user *oldlenp, | 233 | void __user *oldval, size_t __user *oldlenp, |
| 242 | void __user *newval, size_t newlen); | 234 | void __user *newval, size_t newlen); |
| 243 | #endif | 235 | #endif |
| 244 | 236 | ||
| 245 | extern void inet6_ifinfo_notify(int event, | 237 | void inet6_ifinfo_notify(int event, struct inet6_dev *idev); |
| 246 | struct inet6_dev *idev); | ||
| 247 | 238 | ||
| 248 | #endif | 239 | #endif |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 9d22f08896c6..da68c9a90ac5 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 22 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 23 | #include <net/netns/conntrack.h> | 23 | #include <net/netns/conntrack.h> |
| 24 | #endif | 24 | #endif |
| 25 | #include <net/netns/nftables.h> | ||
| 25 | #include <net/netns/xfrm.h> | 26 | #include <net/netns/xfrm.h> |
| 26 | 27 | ||
| 27 | struct user_namespace; | 28 | struct user_namespace; |
| @@ -101,6 +102,9 @@ struct net { | |||
| 101 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 102 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 102 | struct netns_ct ct; | 103 | struct netns_ct ct; |
| 103 | #endif | 104 | #endif |
| 105 | #if defined(CONFIG_NF_TABLES) || defined(CONFIG_NF_TABLES_MODULE) | ||
| 106 | struct netns_nftables nft; | ||
| 107 | #endif | ||
| 104 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) | 108 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) |
| 105 | struct netns_nf_frag nf_frag; | 109 | struct netns_nf_frag nf_frag; |
| 106 | #endif | 110 | #endif |
| @@ -137,8 +141,8 @@ struct net { | |||
| 137 | extern struct net init_net; | 141 | extern struct net init_net; |
| 138 | 142 | ||
| 139 | #ifdef CONFIG_NET_NS | 143 | #ifdef CONFIG_NET_NS |
| 140 | extern struct net *copy_net_ns(unsigned long flags, | 144 | struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns, |
| 141 | struct user_namespace *user_ns, struct net *old_net); | 145 | struct net *old_net); |
| 142 | 146 | ||
| 143 | #else /* CONFIG_NET_NS */ | 147 | #else /* CONFIG_NET_NS */ |
| 144 | #include <linux/sched.h> | 148 | #include <linux/sched.h> |
| @@ -155,11 +159,11 @@ static inline struct net *copy_net_ns(unsigned long flags, | |||
| 155 | 159 | ||
| 156 | extern struct list_head net_namespace_list; | 160 | extern struct list_head net_namespace_list; |
| 157 | 161 | ||
| 158 | extern struct net *get_net_ns_by_pid(pid_t pid); | 162 | struct net *get_net_ns_by_pid(pid_t pid); |
| 159 | extern struct net *get_net_ns_by_fd(int pid); | 163 | struct net *get_net_ns_by_fd(int pid); |
| 160 | 164 | ||
| 161 | #ifdef CONFIG_NET_NS | 165 | #ifdef CONFIG_NET_NS |
| 162 | extern void __put_net(struct net *net); | 166 | void __put_net(struct net *net); |
| 163 | 167 | ||
| 164 | static inline struct net *get_net(struct net *net) | 168 | static inline struct net *get_net(struct net *net) |
| 165 | { | 169 | { |
| @@ -191,7 +195,7 @@ int net_eq(const struct net *net1, const struct net *net2) | |||
| 191 | return net1 == net2; | 195 | return net1 == net2; |
| 192 | } | 196 | } |
| 193 | 197 | ||
| 194 | extern void net_drop_ns(void *); | 198 | void net_drop_ns(void *); |
| 195 | 199 | ||
| 196 | #else | 200 | #else |
| 197 | 201 | ||
| @@ -308,19 +312,19 @@ struct pernet_operations { | |||
| 308 | * device which caused kernel oops, and panics during network | 312 | * device which caused kernel oops, and panics during network |
| 309 | * namespace cleanup. So please don't get this wrong. | 313 | * namespace cleanup. So please don't get this wrong. |
| 310 | */ | 314 | */ |
| 311 | extern int register_pernet_subsys(struct pernet_operations *); | 315 | int register_pernet_subsys(struct pernet_operations *); |
| 312 | extern void unregister_pernet_subsys(struct pernet_operations *); | 316 | void unregister_pernet_subsys(struct pernet_operations *); |
| 313 | extern int register_pernet_device(struct pernet_operations *); | 317 | int register_pernet_device(struct pernet_operations *); |
| 314 | extern void unregister_pernet_device(struct pernet_operations *); | 318 | void unregister_pernet_device(struct pernet_operations *); |
| 315 | 319 | ||
| 316 | struct ctl_table; | 320 | struct ctl_table; |
| 317 | struct ctl_table_header; | 321 | struct ctl_table_header; |
| 318 | 322 | ||
| 319 | #ifdef CONFIG_SYSCTL | 323 | #ifdef CONFIG_SYSCTL |
| 320 | extern int net_sysctl_init(void); | 324 | int net_sysctl_init(void); |
| 321 | extern struct ctl_table_header *register_net_sysctl(struct net *net, | 325 | struct ctl_table_header *register_net_sysctl(struct net *net, const char *path, |
| 322 | const char *path, struct ctl_table *table); | 326 | struct ctl_table *table); |
| 323 | extern void unregister_net_sysctl_table(struct ctl_table_header *header); | 327 | void unregister_net_sysctl_table(struct ctl_table_header *header); |
| 324 | #else | 328 | #else |
| 325 | static inline int net_sysctl_init(void) { return 0; } | 329 | static inline int net_sysctl_init(void) { return 0; } |
| 326 | static inline struct ctl_table_header *register_net_sysctl(struct net *net, | 330 | static inline struct ctl_table_header *register_net_sysctl(struct net *net, |
diff --git a/include/net/netevent.h b/include/net/netevent.h index fe630dde35c3..d8bbb38584b6 100644 --- a/include/net/netevent.h +++ b/include/net/netevent.h | |||
| @@ -26,8 +26,8 @@ enum netevent_notif_type { | |||
| 26 | NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */ | 26 | NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */ |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | extern int register_netevent_notifier(struct notifier_block *nb); | 29 | int register_netevent_notifier(struct notifier_block *nb); |
| 30 | extern int unregister_netevent_notifier(struct notifier_block *nb); | 30 | int unregister_netevent_notifier(struct notifier_block *nb); |
| 31 | extern int call_netevent_notifiers(unsigned long val, void *v); | 31 | int call_netevent_notifiers(unsigned long val, void *v); |
| 32 | 32 | ||
| 33 | #endif | 33 | #endif |
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h index 7573d52a4346..6c3d12e2949f 100644 --- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h +++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h | |||
| @@ -16,9 +16,9 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; | |||
| 16 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; | 16 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; |
| 17 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; | 17 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; |
| 18 | 18 | ||
| 19 | extern int nf_conntrack_ipv4_compat_init(void); | 19 | int nf_conntrack_ipv4_compat_init(void); |
| 20 | extern void nf_conntrack_ipv4_compat_fini(void); | 20 | void nf_conntrack_ipv4_compat_fini(void); |
| 21 | 21 | ||
| 22 | extern void need_ipv4_conntrack(void); | 22 | void need_ipv4_conntrack(void); |
| 23 | 23 | ||
| 24 | #endif /*_NF_CONNTRACK_IPV4_H*/ | 24 | #endif /*_NF_CONNTRACK_IPV4_H*/ |
diff --git a/include/net/netfilter/ipv4/nf_defrag_ipv4.h b/include/net/netfilter/ipv4/nf_defrag_ipv4.h index 6b00ea38546b..f01ef208dff6 100644 --- a/include/net/netfilter/ipv4/nf_defrag_ipv4.h +++ b/include/net/netfilter/ipv4/nf_defrag_ipv4.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #ifndef _NF_DEFRAG_IPV4_H | 1 | #ifndef _NF_DEFRAG_IPV4_H |
| 2 | #define _NF_DEFRAG_IPV4_H | 2 | #define _NF_DEFRAG_IPV4_H |
| 3 | 3 | ||
| 4 | extern void nf_defrag_ipv4_enable(void); | 4 | void nf_defrag_ipv4_enable(void); |
| 5 | 5 | ||
| 6 | #endif /* _NF_DEFRAG_IPV4_H */ | 6 | #endif /* _NF_DEFRAG_IPV4_H */ |
diff --git a/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/include/net/netfilter/ipv6/nf_defrag_ipv6.h index fd79c9a1779d..27666d8a0bd0 100644 --- a/include/net/netfilter/ipv6/nf_defrag_ipv6.h +++ b/include/net/netfilter/ipv6/nf_defrag_ipv6.h | |||
| @@ -1,15 +1,12 @@ | |||
| 1 | #ifndef _NF_DEFRAG_IPV6_H | 1 | #ifndef _NF_DEFRAG_IPV6_H |
| 2 | #define _NF_DEFRAG_IPV6_H | 2 | #define _NF_DEFRAG_IPV6_H |
| 3 | 3 | ||
| 4 | extern void nf_defrag_ipv6_enable(void); | 4 | void nf_defrag_ipv6_enable(void); |
| 5 | 5 | ||
| 6 | extern int nf_ct_frag6_init(void); | 6 | int nf_ct_frag6_init(void); |
| 7 | extern void nf_ct_frag6_cleanup(void); | 7 | void nf_ct_frag6_cleanup(void); |
| 8 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); | 8 | struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); |
| 9 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | 9 | void nf_ct_frag6_consume_orig(struct sk_buff *skb); |
| 10 | struct net_device *in, | ||
| 11 | struct net_device *out, | ||
| 12 | int (*okfn)(struct sk_buff *)); | ||
| 13 | 10 | ||
| 14 | struct inet_frags_ctl; | 11 | struct inet_frags_ctl; |
| 15 | 12 | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 0c1288a50e8b..01ea6eed1bb1 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
| @@ -139,15 +139,13 @@ static inline struct net *nf_ct_net(const struct nf_conn *ct) | |||
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | /* Alter reply tuple (maybe alter helper). */ | 141 | /* Alter reply tuple (maybe alter helper). */ |
| 142 | extern void | 142 | void nf_conntrack_alter_reply(struct nf_conn *ct, |
| 143 | nf_conntrack_alter_reply(struct nf_conn *ct, | 143 | const struct nf_conntrack_tuple *newreply); |
| 144 | const struct nf_conntrack_tuple *newreply); | ||
| 145 | 144 | ||
| 146 | /* Is this tuple taken? (ignoring any belonging to the given | 145 | /* Is this tuple taken? (ignoring any belonging to the given |
| 147 | conntrack). */ | 146 | conntrack). */ |
| 148 | extern int | 147 | int nf_conntrack_tuple_taken(const struct nf_conntrack_tuple *tuple, |
| 149 | nf_conntrack_tuple_taken(const struct nf_conntrack_tuple *tuple, | 148 | const struct nf_conn *ignored_conntrack); |
| 150 | const struct nf_conn *ignored_conntrack); | ||
| 151 | 149 | ||
| 152 | /* Return conntrack_info and tuple hash for given skb. */ | 150 | /* Return conntrack_info and tuple hash for given skb. */ |
| 153 | static inline struct nf_conn * | 151 | static inline struct nf_conn * |
| @@ -165,37 +163,34 @@ static inline void nf_ct_put(struct nf_conn *ct) | |||
| 165 | } | 163 | } |
| 166 | 164 | ||
| 167 | /* Protocol module loading */ | 165 | /* Protocol module loading */ |
| 168 | extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); | 166 | int nf_ct_l3proto_try_module_get(unsigned short l3proto); |
| 169 | extern void nf_ct_l3proto_module_put(unsigned short l3proto); | 167 | void nf_ct_l3proto_module_put(unsigned short l3proto); |
| 170 | 168 | ||
| 171 | /* | 169 | /* |
| 172 | * Allocate a hashtable of hlist_head (if nulls == 0), | 170 | * Allocate a hashtable of hlist_head (if nulls == 0), |
| 173 | * or hlist_nulls_head (if nulls == 1) | 171 | * or hlist_nulls_head (if nulls == 1) |
| 174 | */ | 172 | */ |
| 175 | extern void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls); | 173 | void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls); |
| 176 | 174 | ||
| 177 | extern void nf_ct_free_hashtable(void *hash, unsigned int size); | 175 | void nf_ct_free_hashtable(void *hash, unsigned int size); |
| 178 | 176 | ||
| 179 | extern struct nf_conntrack_tuple_hash * | 177 | struct nf_conntrack_tuple_hash * |
| 180 | __nf_conntrack_find(struct net *net, u16 zone, | 178 | __nf_conntrack_find(struct net *net, u16 zone, |
| 181 | const struct nf_conntrack_tuple *tuple); | 179 | const struct nf_conntrack_tuple *tuple); |
| 182 | 180 | ||
| 183 | extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); | 181 | int nf_conntrack_hash_check_insert(struct nf_conn *ct); |
| 184 | bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report); | 182 | bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report); |
| 185 | 183 | ||
| 186 | extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report); | 184 | void nf_conntrack_flush_report(struct net *net, u32 portid, int report); |
| 187 | 185 | ||
| 188 | extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, | 186 | bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff, |
| 189 | unsigned int nhoff, u_int16_t l3num, | 187 | u_int16_t l3num, struct nf_conntrack_tuple *tuple); |
| 190 | struct nf_conntrack_tuple *tuple); | 188 | bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, |
| 191 | extern bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, | 189 | const struct nf_conntrack_tuple *orig); |
| 192 | const struct nf_conntrack_tuple *orig); | ||
| 193 | 190 | ||
| 194 | extern void __nf_ct_refresh_acct(struct nf_conn *ct, | 191 | void __nf_ct_refresh_acct(struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
| 195 | enum ip_conntrack_info ctinfo, | 192 | const struct sk_buff *skb, |
| 196 | const struct sk_buff *skb, | 193 | unsigned long extra_jiffies, int do_acct); |
| 197 | unsigned long extra_jiffies, | ||
| 198 | int do_acct); | ||
| 199 | 194 | ||
| 200 | /* Refresh conntrack for this many jiffies and do accounting */ | 195 | /* Refresh conntrack for this many jiffies and do accounting */ |
| 201 | static inline void nf_ct_refresh_acct(struct nf_conn *ct, | 196 | static inline void nf_ct_refresh_acct(struct nf_conn *ct, |
| @@ -214,10 +209,8 @@ static inline void nf_ct_refresh(struct nf_conn *ct, | |||
| 214 | __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); | 209 | __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); |
| 215 | } | 210 | } |
| 216 | 211 | ||
| 217 | extern bool __nf_ct_kill_acct(struct nf_conn *ct, | 212 | bool __nf_ct_kill_acct(struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
| 218 | enum ip_conntrack_info ctinfo, | 213 | const struct sk_buff *skb, int do_acct); |
| 219 | const struct sk_buff *skb, | ||
| 220 | int do_acct); | ||
| 221 | 214 | ||
| 222 | /* kill conntrack and do accounting */ | 215 | /* kill conntrack and do accounting */ |
| 223 | static inline bool nf_ct_kill_acct(struct nf_conn *ct, | 216 | static inline bool nf_ct_kill_acct(struct nf_conn *ct, |
| @@ -244,19 +237,17 @@ static inline struct nf_conn *nf_ct_untracked_get(void) | |||
| 244 | { | 237 | { |
| 245 | return &__raw_get_cpu_var(nf_conntrack_untracked); | 238 | return &__raw_get_cpu_var(nf_conntrack_untracked); |
| 246 | } | 239 | } |
| 247 | extern void nf_ct_untracked_status_or(unsigned long bits); | 240 | void nf_ct_untracked_status_or(unsigned long bits); |
| 248 | 241 | ||
| 249 | /* Iterate over all conntracks: if iter returns true, it's deleted. */ | 242 | /* Iterate over all conntracks: if iter returns true, it's deleted. */ |
| 250 | extern void | 243 | void nf_ct_iterate_cleanup(struct net *net, |
| 251 | nf_ct_iterate_cleanup(struct net *net, | 244 | int (*iter)(struct nf_conn *i, void *data), |
| 252 | int (*iter)(struct nf_conn *i, void *data), | 245 | void *data, u32 portid, int report); |
| 253 | void *data, u32 portid, int report); | 246 | void nf_conntrack_free(struct nf_conn *ct); |
| 254 | extern void nf_conntrack_free(struct nf_conn *ct); | 247 | struct nf_conn *nf_conntrack_alloc(struct net *net, u16 zone, |
| 255 | extern struct nf_conn * | 248 | const struct nf_conntrack_tuple *orig, |
| 256 | nf_conntrack_alloc(struct net *net, u16 zone, | 249 | const struct nf_conntrack_tuple *repl, |
| 257 | const struct nf_conntrack_tuple *orig, | 250 | gfp_t gfp); |
| 258 | const struct nf_conntrack_tuple *repl, | ||
| 259 | gfp_t gfp); | ||
| 260 | 251 | ||
| 261 | static inline int nf_ct_is_template(const struct nf_conn *ct) | 252 | static inline int nf_ct_is_template(const struct nf_conn *ct) |
| 262 | { | 253 | { |
| @@ -287,7 +278,7 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb) | |||
| 287 | 278 | ||
| 288 | struct kernel_param; | 279 | struct kernel_param; |
| 289 | 280 | ||
| 290 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); | 281 | int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); |
| 291 | extern unsigned int nf_conntrack_htable_size; | 282 | extern unsigned int nf_conntrack_htable_size; |
| 292 | extern unsigned int nf_conntrack_max; | 283 | extern unsigned int nf_conntrack_max; |
| 293 | extern unsigned int nf_conntrack_hash_rnd; | 284 | extern unsigned int nf_conntrack_hash_rnd; |
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h index 2bdb7a15fe06..79d8d16732b4 100644 --- a/include/net/netfilter/nf_conntrack_acct.h +++ b/include/net/netfilter/nf_conntrack_acct.h | |||
| @@ -19,17 +19,21 @@ struct nf_conn_counter { | |||
| 19 | atomic64_t bytes; | 19 | atomic64_t bytes; |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | struct nf_conn_acct { | ||
| 23 | struct nf_conn_counter counter[IP_CT_DIR_MAX]; | ||
| 24 | }; | ||
| 25 | |||
| 22 | static inline | 26 | static inline |
| 23 | struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct) | 27 | struct nf_conn_acct *nf_conn_acct_find(const struct nf_conn *ct) |
| 24 | { | 28 | { |
| 25 | return nf_ct_ext_find(ct, NF_CT_EXT_ACCT); | 29 | return nf_ct_ext_find(ct, NF_CT_EXT_ACCT); |
| 26 | } | 30 | } |
| 27 | 31 | ||
| 28 | static inline | 32 | static inline |
| 29 | struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) | 33 | struct nf_conn_acct *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) |
| 30 | { | 34 | { |
| 31 | struct net *net = nf_ct_net(ct); | 35 | struct net *net = nf_ct_net(ct); |
| 32 | struct nf_conn_counter *acct; | 36 | struct nf_conn_acct *acct; |
| 33 | 37 | ||
| 34 | if (!net->ct.sysctl_acct) | 38 | if (!net->ct.sysctl_acct) |
| 35 | return NULL; | 39 | return NULL; |
| @@ -42,8 +46,8 @@ struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) | |||
| 42 | return acct; | 46 | return acct; |
| 43 | }; | 47 | }; |
| 44 | 48 | ||
| 45 | extern unsigned int | 49 | unsigned int seq_print_acct(struct seq_file *s, const struct nf_conn *ct, |
| 46 | seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir); | 50 | int dir); |
| 47 | 51 | ||
| 48 | /* Check if connection tracking accounting is enabled */ | 52 | /* Check if connection tracking accounting is enabled */ |
| 49 | static inline bool nf_ct_acct_enabled(struct net *net) | 53 | static inline bool nf_ct_acct_enabled(struct net *net) |
| @@ -57,9 +61,9 @@ static inline void nf_ct_set_acct(struct net *net, bool enable) | |||
| 57 | net->ct.sysctl_acct = enable; | 61 | net->ct.sysctl_acct = enable; |
| 58 | } | 62 | } |
| 59 | 63 | ||
| 60 | extern int nf_conntrack_acct_pernet_init(struct net *net); | 64 | int nf_conntrack_acct_pernet_init(struct net *net); |
| 61 | extern void nf_conntrack_acct_pernet_fini(struct net *net); | 65 | void nf_conntrack_acct_pernet_fini(struct net *net); |
| 62 | 66 | ||
| 63 | extern int nf_conntrack_acct_init(void); | 67 | int nf_conntrack_acct_init(void); |
| 64 | extern void nf_conntrack_acct_fini(void); | 68 | void nf_conntrack_acct_fini(void); |
| 65 | #endif /* _NF_CONNTRACK_ACCT_H */ | 69 | #endif /* _NF_CONNTRACK_ACCT_H */ |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index fb2b6234e937..15308b8eb5b5 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
| @@ -20,49 +20,42 @@ | |||
| 20 | /* This header is used to share core functionality between the | 20 | /* This header is used to share core functionality between the |
| 21 | standalone connection tracking module, and the compatibility layer's use | 21 | standalone connection tracking module, and the compatibility layer's use |
| 22 | of connection tracking. */ | 22 | of connection tracking. */ |
| 23 | extern unsigned int nf_conntrack_in(struct net *net, | 23 | unsigned int nf_conntrack_in(struct net *net, u_int8_t pf, unsigned int hooknum, |
| 24 | u_int8_t pf, | 24 | struct sk_buff *skb); |
| 25 | unsigned int hooknum, | 25 | |
| 26 | struct sk_buff *skb); | 26 | int nf_conntrack_init_net(struct net *net); |
| 27 | 27 | void nf_conntrack_cleanup_net(struct net *net); | |
| 28 | extern int nf_conntrack_init_net(struct net *net); | 28 | void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list); |
| 29 | extern void nf_conntrack_cleanup_net(struct net *net); | 29 | |
| 30 | extern void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list); | 30 | int nf_conntrack_proto_pernet_init(struct net *net); |
| 31 | 31 | void nf_conntrack_proto_pernet_fini(struct net *net); | |
| 32 | extern int nf_conntrack_proto_pernet_init(struct net *net); | 32 | |
| 33 | extern void nf_conntrack_proto_pernet_fini(struct net *net); | 33 | int nf_conntrack_proto_init(void); |
| 34 | 34 | void nf_conntrack_proto_fini(void); | |
| 35 | extern int nf_conntrack_proto_init(void); | 35 | |
| 36 | extern void nf_conntrack_proto_fini(void); | 36 | int nf_conntrack_init_start(void); |
| 37 | 37 | void nf_conntrack_cleanup_start(void); | |
| 38 | extern int nf_conntrack_init_start(void); | 38 | |
| 39 | extern void nf_conntrack_cleanup_start(void); | 39 | void nf_conntrack_init_end(void); |
| 40 | 40 | void nf_conntrack_cleanup_end(void); | |
| 41 | extern void nf_conntrack_init_end(void); | 41 | |
| 42 | extern void nf_conntrack_cleanup_end(void); | 42 | bool nf_ct_get_tuple(const struct sk_buff *skb, unsigned int nhoff, |
| 43 | 43 | unsigned int dataoff, u_int16_t l3num, u_int8_t protonum, | |
| 44 | extern bool | 44 | struct nf_conntrack_tuple *tuple, |
| 45 | nf_ct_get_tuple(const struct sk_buff *skb, | 45 | const struct nf_conntrack_l3proto *l3proto, |
| 46 | unsigned int nhoff, | 46 | const struct nf_conntrack_l4proto *l4proto); |
| 47 | unsigned int dataoff, | 47 | |
| 48 | u_int16_t l3num, | 48 | bool nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, |
| 49 | u_int8_t protonum, | 49 | const struct nf_conntrack_tuple *orig, |
| 50 | struct nf_conntrack_tuple *tuple, | 50 | const struct nf_conntrack_l3proto *l3proto, |
| 51 | const struct nf_conntrack_l3proto *l3proto, | 51 | const struct nf_conntrack_l4proto *l4proto); |
| 52 | const struct nf_conntrack_l4proto *l4proto); | ||
| 53 | |||
| 54 | extern bool | ||
| 55 | nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, | ||
| 56 | const struct nf_conntrack_tuple *orig, | ||
| 57 | const struct nf_conntrack_l3proto *l3proto, | ||
| 58 | const struct nf_conntrack_l4proto *l4proto); | ||
| 59 | 52 | ||
| 60 | /* Find a connection corresponding to a tuple. */ | 53 | /* Find a connection corresponding to a tuple. */ |
| 61 | extern struct nf_conntrack_tuple_hash * | 54 | struct nf_conntrack_tuple_hash * |
| 62 | nf_conntrack_find_get(struct net *net, u16 zone, | 55 | nf_conntrack_find_get(struct net *net, u16 zone, |
| 63 | const struct nf_conntrack_tuple *tuple); | 56 | const struct nf_conntrack_tuple *tuple); |
| 64 | 57 | ||
| 65 | extern int __nf_conntrack_confirm(struct sk_buff *skb); | 58 | int __nf_conntrack_confirm(struct sk_buff *skb); |
| 66 | 59 | ||
| 67 | /* Confirm a connection: returns NF_DROP if packet must be dropped. */ | 60 | /* Confirm a connection: returns NF_DROP if packet must be dropped. */ |
| 68 | static inline int nf_conntrack_confirm(struct sk_buff *skb) | 61 | static inline int nf_conntrack_confirm(struct sk_buff *skb) |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 092dc651689f..0e3d08e4b1d3 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
| @@ -68,10 +68,12 @@ struct nf_ct_event_notifier { | |||
| 68 | int (*fcn)(unsigned int events, struct nf_ct_event *item); | 68 | int (*fcn)(unsigned int events, struct nf_ct_event *item); |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | extern int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *nb); | 71 | int nf_conntrack_register_notifier(struct net *net, |
| 72 | extern void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *nb); | 72 | struct nf_ct_event_notifier *nb); |
| 73 | void nf_conntrack_unregister_notifier(struct net *net, | ||
| 74 | struct nf_ct_event_notifier *nb); | ||
| 73 | 75 | ||
| 74 | extern void nf_ct_deliver_cached_events(struct nf_conn *ct); | 76 | void nf_ct_deliver_cached_events(struct nf_conn *ct); |
| 75 | 77 | ||
| 76 | static inline void | 78 | static inline void |
| 77 | nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | 79 | nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) |
| @@ -166,8 +168,10 @@ struct nf_exp_event_notifier { | |||
| 166 | int (*fcn)(unsigned int events, struct nf_exp_event *item); | 168 | int (*fcn)(unsigned int events, struct nf_exp_event *item); |
| 167 | }; | 169 | }; |
| 168 | 170 | ||
| 169 | extern int nf_ct_expect_register_notifier(struct net *net, struct nf_exp_event_notifier *nb); | 171 | int nf_ct_expect_register_notifier(struct net *net, |
| 170 | extern void nf_ct_expect_unregister_notifier(struct net *net, struct nf_exp_event_notifier *nb); | 172 | struct nf_exp_event_notifier *nb); |
| 173 | void nf_ct_expect_unregister_notifier(struct net *net, | ||
| 174 | struct nf_exp_event_notifier *nb); | ||
| 171 | 175 | ||
| 172 | static inline void | 176 | static inline void |
| 173 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | 177 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, |
| @@ -207,11 +211,11 @@ nf_ct_expect_event(enum ip_conntrack_expect_events event, | |||
| 207 | nf_ct_expect_event_report(event, exp, 0, 0); | 211 | nf_ct_expect_event_report(event, exp, 0, 0); |
| 208 | } | 212 | } |
| 209 | 213 | ||
| 210 | extern int nf_conntrack_ecache_pernet_init(struct net *net); | 214 | int nf_conntrack_ecache_pernet_init(struct net *net); |
| 211 | extern void nf_conntrack_ecache_pernet_fini(struct net *net); | 215 | void nf_conntrack_ecache_pernet_fini(struct net *net); |
| 212 | 216 | ||
| 213 | extern int nf_conntrack_ecache_init(void); | 217 | int nf_conntrack_ecache_init(void); |
| 214 | extern void nf_conntrack_ecache_fini(void); | 218 | void nf_conntrack_ecache_fini(void); |
| 215 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ | 219 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ |
| 216 | 220 | ||
| 217 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | 221 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 88a1d4060d52..956b175523ff 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
| @@ -36,7 +36,7 @@ enum nf_ct_ext_id { | |||
| 36 | #define NF_CT_EXT_HELPER_TYPE struct nf_conn_help | 36 | #define NF_CT_EXT_HELPER_TYPE struct nf_conn_help |
| 37 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat | 37 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat |
| 38 | #define NF_CT_EXT_SEQADJ_TYPE struct nf_conn_seqadj | 38 | #define NF_CT_EXT_SEQADJ_TYPE struct nf_conn_seqadj |
| 39 | #define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter | 39 | #define NF_CT_EXT_ACCT_TYPE struct nf_conn_acct |
| 40 | #define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache | 40 | #define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache |
| 41 | #define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone | 41 | #define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone |
| 42 | #define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp | 42 | #define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp |
| @@ -73,7 +73,7 @@ static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id) | |||
| 73 | ((id##_TYPE *)__nf_ct_ext_find((ext), (id))) | 73 | ((id##_TYPE *)__nf_ct_ext_find((ext), (id))) |
| 74 | 74 | ||
| 75 | /* Destroy all relationships */ | 75 | /* Destroy all relationships */ |
| 76 | extern void __nf_ct_ext_destroy(struct nf_conn *ct); | 76 | void __nf_ct_ext_destroy(struct nf_conn *ct); |
| 77 | static inline void nf_ct_ext_destroy(struct nf_conn *ct) | 77 | static inline void nf_ct_ext_destroy(struct nf_conn *ct) |
| 78 | { | 78 | { |
| 79 | if (ct->ext) | 79 | if (ct->ext) |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 26c4ae5bfbb8..6cf614bc0029 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
| @@ -52,21 +52,24 @@ struct nf_conntrack_helper { | |||
| 52 | unsigned int queue_num; /* For user-space helpers. */ | 52 | unsigned int queue_num; /* For user-space helpers. */ |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | extern struct nf_conntrack_helper * | 55 | struct nf_conntrack_helper *__nf_conntrack_helper_find(const char *name, |
| 56 | __nf_conntrack_helper_find(const char *name, u16 l3num, u8 protonum); | 56 | u16 l3num, u8 protonum); |
| 57 | 57 | ||
| 58 | extern struct nf_conntrack_helper * | 58 | struct nf_conntrack_helper *nf_conntrack_helper_try_module_get(const char *name, |
| 59 | nf_conntrack_helper_try_module_get(const char *name, u16 l3num, u8 protonum); | 59 | u16 l3num, |
| 60 | u8 protonum); | ||
| 60 | 61 | ||
| 61 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 62 | int nf_conntrack_helper_register(struct nf_conntrack_helper *); |
| 62 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | 63 | void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); |
| 63 | 64 | ||
| 64 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, struct nf_conntrack_helper *helper, gfp_t gfp); | 65 | struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, |
| 66 | struct nf_conntrack_helper *helper, | ||
| 67 | gfp_t gfp); | ||
| 65 | 68 | ||
| 66 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, | 69 | int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, |
| 67 | gfp_t flags); | 70 | gfp_t flags); |
| 68 | 71 | ||
| 69 | extern void nf_ct_helper_destroy(struct nf_conn *ct); | 72 | void nf_ct_helper_destroy(struct nf_conn *ct); |
| 70 | 73 | ||
| 71 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | 74 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) |
| 72 | { | 75 | { |
| @@ -82,17 +85,16 @@ static inline void *nfct_help_data(const struct nf_conn *ct) | |||
| 82 | return (void *)help->data; | 85 | return (void *)help->data; |
| 83 | } | 86 | } |
| 84 | 87 | ||
| 85 | extern int nf_conntrack_helper_pernet_init(struct net *net); | 88 | int nf_conntrack_helper_pernet_init(struct net *net); |
| 86 | extern void nf_conntrack_helper_pernet_fini(struct net *net); | 89 | void nf_conntrack_helper_pernet_fini(struct net *net); |
| 87 | 90 | ||
| 88 | extern int nf_conntrack_helper_init(void); | 91 | int nf_conntrack_helper_init(void); |
| 89 | extern void nf_conntrack_helper_fini(void); | 92 | void nf_conntrack_helper_fini(void); |
| 90 | 93 | ||
| 91 | extern int nf_conntrack_broadcast_help(struct sk_buff *skb, | 94 | int nf_conntrack_broadcast_help(struct sk_buff *skb, unsigned int protoff, |
| 92 | unsigned int protoff, | 95 | struct nf_conn *ct, |
| 93 | struct nf_conn *ct, | 96 | enum ip_conntrack_info ctinfo, |
| 94 | enum ip_conntrack_info ctinfo, | 97 | unsigned int timeout); |
| 95 | unsigned int timeout); | ||
| 96 | 98 | ||
| 97 | struct nf_ct_helper_expectfn { | 99 | struct nf_ct_helper_expectfn { |
| 98 | struct list_head head; | 100 | struct list_head head; |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 3bb89eac3fa1..3efab704b7eb 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
| @@ -77,17 +77,17 @@ struct nf_conntrack_l3proto { | |||
| 77 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; | 77 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; |
| 78 | 78 | ||
| 79 | /* Protocol pernet registration. */ | 79 | /* Protocol pernet registration. */ |
| 80 | extern int nf_ct_l3proto_pernet_register(struct net *net, | 80 | int nf_ct_l3proto_pernet_register(struct net *net, |
| 81 | struct nf_conntrack_l3proto *proto); | 81 | struct nf_conntrack_l3proto *proto); |
| 82 | extern void nf_ct_l3proto_pernet_unregister(struct net *net, | 82 | void nf_ct_l3proto_pernet_unregister(struct net *net, |
| 83 | struct nf_conntrack_l3proto *proto); | 83 | struct nf_conntrack_l3proto *proto); |
| 84 | 84 | ||
| 85 | /* Protocol global registration. */ | 85 | /* Protocol global registration. */ |
| 86 | extern int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto); | 86 | int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto); |
| 87 | extern void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); | 87 | void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); |
| 88 | 88 | ||
| 89 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); | 89 | struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); |
| 90 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | 90 | void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); |
| 91 | 91 | ||
| 92 | /* Existing built-in protocols */ | 92 | /* Existing built-in protocols */ |
| 93 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; | 93 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; |
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index b411d7b17dec..4c8d573830b7 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
| @@ -114,22 +114,22 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; | |||
| 114 | 114 | ||
| 115 | #define MAX_NF_CT_PROTO 256 | 115 | #define MAX_NF_CT_PROTO 256 |
| 116 | 116 | ||
| 117 | extern struct nf_conntrack_l4proto * | 117 | struct nf_conntrack_l4proto *__nf_ct_l4proto_find(u_int16_t l3proto, |
| 118 | __nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto); | 118 | u_int8_t l4proto); |
| 119 | 119 | ||
| 120 | extern struct nf_conntrack_l4proto * | 120 | struct nf_conntrack_l4proto *nf_ct_l4proto_find_get(u_int16_t l3proto, |
| 121 | nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); | 121 | u_int8_t l4proto); |
| 122 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); | 122 | void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); |
| 123 | 123 | ||
| 124 | /* Protocol pernet registration. */ | 124 | /* Protocol pernet registration. */ |
| 125 | extern int nf_ct_l4proto_pernet_register(struct net *net, | 125 | int nf_ct_l4proto_pernet_register(struct net *net, |
| 126 | struct nf_conntrack_l4proto *proto); | 126 | struct nf_conntrack_l4proto *proto); |
| 127 | extern void nf_ct_l4proto_pernet_unregister(struct net *net, | 127 | void nf_ct_l4proto_pernet_unregister(struct net *net, |
| 128 | struct nf_conntrack_l4proto *proto); | 128 | struct nf_conntrack_l4proto *proto); |
| 129 | 129 | ||
| 130 | /* Protocol global registration. */ | 130 | /* Protocol global registration. */ |
| 131 | extern int nf_ct_l4proto_register(struct nf_conntrack_l4proto *proto); | 131 | int nf_ct_l4proto_register(struct nf_conntrack_l4proto *proto); |
| 132 | extern void nf_ct_l4proto_unregister(struct nf_conntrack_l4proto *proto); | 132 | void nf_ct_l4proto_unregister(struct nf_conntrack_l4proto *proto); |
| 133 | 133 | ||
| 134 | static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) | 134 | static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) |
| 135 | { | 135 | { |
| @@ -140,11 +140,11 @@ static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) | |||
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | /* Generic netlink helpers */ | 142 | /* Generic netlink helpers */ |
| 143 | extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, | 143 | int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, |
| 144 | const struct nf_conntrack_tuple *tuple); | 144 | const struct nf_conntrack_tuple *tuple); |
| 145 | extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[], | 145 | int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[], |
| 146 | struct nf_conntrack_tuple *t); | 146 | struct nf_conntrack_tuple *t); |
| 147 | extern int nf_ct_port_nlattr_tuple_size(void); | 147 | int nf_ct_port_nlattr_tuple_size(void); |
| 148 | extern const struct nla_policy nf_ct_port_nla_policy[]; | 148 | extern const struct nla_policy nf_ct_port_nla_policy[]; |
| 149 | 149 | ||
| 150 | #ifdef CONFIG_SYSCTL | 150 | #ifdef CONFIG_SYSCTL |
diff --git a/include/net/netfilter/nf_conntrack_seqadj.h b/include/net/netfilter/nf_conntrack_seqadj.h index f6177a5fe0ca..4b3362991a25 100644 --- a/include/net/netfilter/nf_conntrack_seqadj.h +++ b/include/net/netfilter/nf_conntrack_seqadj.h | |||
| @@ -30,22 +30,18 @@ static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct) | |||
| 30 | return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC); | 30 | return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | extern int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo, | 33 | int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
| 34 | s32 off); | 34 | s32 off); |
| 35 | extern int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo, | 35 | int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
| 36 | __be32 seq, s32 off); | 36 | __be32 seq, s32 off); |
| 37 | extern void nf_ct_tcp_seqadj_set(struct sk_buff *skb, | 37 | void nf_ct_tcp_seqadj_set(struct sk_buff *skb, struct nf_conn *ct, |
| 38 | struct nf_conn *ct, | 38 | enum ip_conntrack_info ctinfo, s32 off); |
| 39 | enum ip_conntrack_info ctinfo, | 39 | |
| 40 | s32 off); | 40 | int nf_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, |
| 41 | 41 | enum ip_conntrack_info ctinfo, unsigned int protoff); | |
| 42 | extern int nf_ct_seq_adjust(struct sk_buff *skb, | 42 | s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir, u32 seq); |
| 43 | struct nf_conn *ct, enum ip_conntrack_info ctinfo, | 43 | |
| 44 | unsigned int protoff); | 44 | int nf_conntrack_seqadj_init(void); |
| 45 | extern s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir, | 45 | void nf_conntrack_seqadj_fini(void); |
| 46 | u32 seq); | ||
| 47 | |||
| 48 | extern int nf_conntrack_seqadj_init(void); | ||
| 49 | extern void nf_conntrack_seqadj_fini(void); | ||
| 50 | 46 | ||
| 51 | #endif /* _NF_CONNTRACK_SEQADJ_H */ | 47 | #endif /* _NF_CONNTRACK_SEQADJ_H */ |
diff --git a/include/net/netfilter/nf_conntrack_synproxy.h b/include/net/netfilter/nf_conntrack_synproxy.h index f572f313d6f1..6793614e6502 100644 --- a/include/net/netfilter/nf_conntrack_synproxy.h +++ b/include/net/netfilter/nf_conntrack_synproxy.h | |||
| @@ -56,22 +56,20 @@ struct synproxy_options { | |||
| 56 | 56 | ||
| 57 | struct tcphdr; | 57 | struct tcphdr; |
| 58 | struct xt_synproxy_info; | 58 | struct xt_synproxy_info; |
| 59 | extern bool synproxy_parse_options(const struct sk_buff *skb, unsigned int doff, | 59 | bool synproxy_parse_options(const struct sk_buff *skb, unsigned int doff, |
| 60 | const struct tcphdr *th, | 60 | const struct tcphdr *th, |
| 61 | struct synproxy_options *opts); | 61 | struct synproxy_options *opts); |
| 62 | extern unsigned int synproxy_options_size(const struct synproxy_options *opts); | 62 | unsigned int synproxy_options_size(const struct synproxy_options *opts); |
| 63 | extern void synproxy_build_options(struct tcphdr *th, | 63 | void synproxy_build_options(struct tcphdr *th, |
| 64 | const struct synproxy_options *opts); | 64 | const struct synproxy_options *opts); |
| 65 | 65 | ||
| 66 | extern void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info, | 66 | void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info, |
| 67 | struct synproxy_options *opts); | 67 | struct synproxy_options *opts); |
| 68 | extern void synproxy_check_timestamp_cookie(struct synproxy_options *opts); | 68 | void synproxy_check_timestamp_cookie(struct synproxy_options *opts); |
| 69 | 69 | ||
| 70 | extern unsigned int synproxy_tstamp_adjust(struct sk_buff *skb, | 70 | unsigned int synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int protoff, |
| 71 | unsigned int protoff, | 71 | struct tcphdr *th, struct nf_conn *ct, |
| 72 | struct tcphdr *th, | 72 | enum ip_conntrack_info ctinfo, |
| 73 | struct nf_conn *ct, | 73 | const struct nf_conn_synproxy *synproxy); |
| 74 | enum ip_conntrack_info ctinfo, | ||
| 75 | const struct nf_conn_synproxy *synproxy); | ||
| 76 | 74 | ||
| 77 | #endif /* _NF_CONNTRACK_SYNPROXY_H */ | 75 | #endif /* _NF_CONNTRACK_SYNPROXY_H */ |
diff --git a/include/net/netfilter/nf_conntrack_timeout.h b/include/net/netfilter/nf_conntrack_timeout.h index d23aceb16d94..62308713dd7f 100644 --- a/include/net/netfilter/nf_conntrack_timeout.h +++ b/include/net/netfilter/nf_conntrack_timeout.h | |||
| @@ -76,8 +76,8 @@ nf_ct_timeout_lookup(struct net *net, struct nf_conn *ct, | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT | 78 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT |
| 79 | extern int nf_conntrack_timeout_init(void); | 79 | int nf_conntrack_timeout_init(void); |
| 80 | extern void nf_conntrack_timeout_fini(void); | 80 | void nf_conntrack_timeout_fini(void); |
| 81 | #else | 81 | #else |
| 82 | static inline int nf_conntrack_timeout_init(void) | 82 | static inline int nf_conntrack_timeout_init(void) |
| 83 | { | 83 | { |
diff --git a/include/net/netfilter/nf_conntrack_timestamp.h b/include/net/netfilter/nf_conntrack_timestamp.h index b00461413efd..300ae2209f25 100644 --- a/include/net/netfilter/nf_conntrack_timestamp.h +++ b/include/net/netfilter/nf_conntrack_timestamp.h | |||
| @@ -48,11 +48,11 @@ static inline void nf_ct_set_tstamp(struct net *net, bool enable) | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | #ifdef CONFIG_NF_CONNTRACK_TIMESTAMP | 50 | #ifdef CONFIG_NF_CONNTRACK_TIMESTAMP |
| 51 | extern int nf_conntrack_tstamp_pernet_init(struct net *net); | 51 | int nf_conntrack_tstamp_pernet_init(struct net *net); |
| 52 | extern void nf_conntrack_tstamp_pernet_fini(struct net *net); | 52 | void nf_conntrack_tstamp_pernet_fini(struct net *net); |
| 53 | 53 | ||
| 54 | extern int nf_conntrack_tstamp_init(void); | 54 | int nf_conntrack_tstamp_init(void); |
| 55 | extern void nf_conntrack_tstamp_fini(void); | 55 | void nf_conntrack_tstamp_fini(void); |
| 56 | #else | 56 | #else |
| 57 | static inline int nf_conntrack_tstamp_pernet_init(struct net *net) | 57 | static inline int nf_conntrack_tstamp_pernet_init(struct net *net) |
| 58 | { | 58 | { |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index 59a192420053..07eaaf604092 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
| @@ -41,13 +41,16 @@ struct nf_conn_nat { | |||
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | /* Set up the info structure to map into this range. */ | 43 | /* Set up the info structure to map into this range. */ |
| 44 | extern unsigned int nf_nat_setup_info(struct nf_conn *ct, | 44 | unsigned int nf_nat_setup_info(struct nf_conn *ct, |
| 45 | const struct nf_nat_range *range, | 45 | const struct nf_nat_range *range, |
| 46 | enum nf_nat_manip_type maniptype); | 46 | enum nf_nat_manip_type maniptype); |
| 47 | |||
| 48 | extern unsigned int nf_nat_alloc_null_binding(struct nf_conn *ct, | ||
| 49 | unsigned int hooknum); | ||
| 47 | 50 | ||
| 48 | /* Is this tuple already taken? (not by us)*/ | 51 | /* Is this tuple already taken? (not by us)*/ |
| 49 | extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, | 52 | int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, |
| 50 | const struct nf_conn *ignored_conntrack); | 53 | const struct nf_conn *ignored_conntrack); |
| 51 | 54 | ||
| 52 | static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct) | 55 | static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct) |
| 53 | { | 56 | { |
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h index 972e1e47ec79..fbfd1ba4254e 100644 --- a/include/net/netfilter/nf_nat_core.h +++ b/include/net/netfilter/nf_nat_core.h | |||
| @@ -7,12 +7,10 @@ | |||
| 7 | /* This header used to share core functionality between the standalone | 7 | /* This header used to share core functionality between the standalone |
| 8 | NAT module, and the compatibility layer's use of NAT for masquerading. */ | 8 | NAT module, and the compatibility layer's use of NAT for masquerading. */ |
| 9 | 9 | ||
| 10 | extern unsigned int nf_nat_packet(struct nf_conn *ct, | 10 | unsigned int nf_nat_packet(struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
| 11 | enum ip_conntrack_info ctinfo, | 11 | unsigned int hooknum, struct sk_buff *skb); |
| 12 | unsigned int hooknum, | ||
| 13 | struct sk_buff *skb); | ||
| 14 | 12 | ||
| 15 | extern int nf_xfrm_me_harder(struct sk_buff *skb, unsigned int family); | 13 | int nf_xfrm_me_harder(struct sk_buff *skb, unsigned int family); |
| 16 | 14 | ||
| 17 | static inline int nf_nat_initialized(struct nf_conn *ct, | 15 | static inline int nf_nat_initialized(struct nf_conn *ct, |
| 18 | enum nf_nat_manip_type manip) | 16 | enum nf_nat_manip_type manip) |
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h index 404324d1d0c4..01bcc6bfbcc9 100644 --- a/include/net/netfilter/nf_nat_helper.h +++ b/include/net/netfilter/nf_nat_helper.h | |||
| @@ -7,14 +7,11 @@ | |||
| 7 | struct sk_buff; | 7 | struct sk_buff; |
| 8 | 8 | ||
| 9 | /* These return true or false. */ | 9 | /* These return true or false. */ |
| 10 | extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, | 10 | int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, struct nf_conn *ct, |
| 11 | struct nf_conn *ct, | 11 | enum ip_conntrack_info ctinfo, |
| 12 | enum ip_conntrack_info ctinfo, | 12 | unsigned int protoff, unsigned int match_offset, |
| 13 | unsigned int protoff, | 13 | unsigned int match_len, const char *rep_buffer, |
| 14 | unsigned int match_offset, | 14 | unsigned int rep_len, bool adjust); |
| 15 | unsigned int match_len, | ||
| 16 | const char *rep_buffer, | ||
| 17 | unsigned int rep_len, bool adjust); | ||
| 18 | 15 | ||
| 19 | static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, | 16 | static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, |
| 20 | struct nf_conn *ct, | 17 | struct nf_conn *ct, |
| @@ -30,18 +27,14 @@ static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, | |||
| 30 | rep_buffer, rep_len, true); | 27 | rep_buffer, rep_len, true); |
| 31 | } | 28 | } |
| 32 | 29 | ||
| 33 | extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, | 30 | int nf_nat_mangle_udp_packet(struct sk_buff *skb, struct nf_conn *ct, |
| 34 | struct nf_conn *ct, | 31 | enum ip_conntrack_info ctinfo, |
| 35 | enum ip_conntrack_info ctinfo, | 32 | unsigned int protoff, unsigned int match_offset, |
| 36 | unsigned int protoff, | 33 | unsigned int match_len, const char *rep_buffer, |
| 37 | unsigned int match_offset, | 34 | unsigned int rep_len); |
| 38 | unsigned int match_len, | ||
| 39 | const char *rep_buffer, | ||
| 40 | unsigned int rep_len); | ||
| 41 | 35 | ||
| 42 | /* Setup NAT on this expected conntrack so it follows master, but goes | 36 | /* Setup NAT on this expected conntrack so it follows master, but goes |
| 43 | * to port ct->master->saved_proto. */ | 37 | * to port ct->master->saved_proto. */ |
| 44 | extern void nf_nat_follow_master(struct nf_conn *ct, | 38 | void nf_nat_follow_master(struct nf_conn *ct, struct nf_conntrack_expect *this); |
| 45 | struct nf_conntrack_expect *this); | ||
| 46 | 39 | ||
| 47 | #endif | 40 | #endif |
diff --git a/include/net/netfilter/nf_nat_l3proto.h b/include/net/netfilter/nf_nat_l3proto.h index bd3b97e02c82..5a2919b2e09a 100644 --- a/include/net/netfilter/nf_nat_l3proto.h +++ b/include/net/netfilter/nf_nat_l3proto.h | |||
| @@ -35,18 +35,15 @@ struct nf_nat_l3proto { | |||
| 35 | struct nf_nat_range *range); | 35 | struct nf_nat_range *range); |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | extern int nf_nat_l3proto_register(const struct nf_nat_l3proto *); | 38 | int nf_nat_l3proto_register(const struct nf_nat_l3proto *); |
| 39 | extern void nf_nat_l3proto_unregister(const struct nf_nat_l3proto *); | 39 | void nf_nat_l3proto_unregister(const struct nf_nat_l3proto *); |
| 40 | extern const struct nf_nat_l3proto *__nf_nat_l3proto_find(u8 l3proto); | 40 | const struct nf_nat_l3proto *__nf_nat_l3proto_find(u8 l3proto); |
| 41 | 41 | ||
| 42 | extern int nf_nat_icmp_reply_translation(struct sk_buff *skb, | 42 | int nf_nat_icmp_reply_translation(struct sk_buff *skb, struct nf_conn *ct, |
| 43 | struct nf_conn *ct, | 43 | enum ip_conntrack_info ctinfo, |
| 44 | enum ip_conntrack_info ctinfo, | 44 | unsigned int hooknum); |
| 45 | unsigned int hooknum); | 45 | int nf_nat_icmpv6_reply_translation(struct sk_buff *skb, struct nf_conn *ct, |
| 46 | extern int nf_nat_icmpv6_reply_translation(struct sk_buff *skb, | 46 | enum ip_conntrack_info ctinfo, |
| 47 | struct nf_conn *ct, | 47 | unsigned int hooknum, unsigned int hdrlen); |
| 48 | enum ip_conntrack_info ctinfo, | ||
| 49 | unsigned int hooknum, | ||
| 50 | unsigned int hdrlen); | ||
| 51 | 48 | ||
| 52 | #endif /* _NF_NAT_L3PROTO_H */ | 49 | #endif /* _NF_NAT_L3PROTO_H */ |
diff --git a/include/net/netfilter/nf_nat_l4proto.h b/include/net/netfilter/nf_nat_l4proto.h index 24feb68d1bcc..12f4cc841b6e 100644 --- a/include/net/netfilter/nf_nat_l4proto.h +++ b/include/net/netfilter/nf_nat_l4proto.h | |||
| @@ -42,10 +42,11 @@ struct nf_nat_l4proto { | |||
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | /* Protocol registration. */ | 44 | /* Protocol registration. */ |
| 45 | extern int nf_nat_l4proto_register(u8 l3proto, const struct nf_nat_l4proto *l4proto); | 45 | int nf_nat_l4proto_register(u8 l3proto, const struct nf_nat_l4proto *l4proto); |
| 46 | extern void nf_nat_l4proto_unregister(u8 l3proto, const struct nf_nat_l4proto *l4proto); | 46 | void nf_nat_l4proto_unregister(u8 l3proto, |
| 47 | const struct nf_nat_l4proto *l4proto); | ||
| 47 | 48 | ||
| 48 | extern const struct nf_nat_l4proto *__nf_nat_l4proto_find(u8 l3proto, u8 l4proto); | 49 | const struct nf_nat_l4proto *__nf_nat_l4proto_find(u8 l3proto, u8 l4proto); |
| 49 | 50 | ||
| 50 | /* Built-in protocols. */ | 51 | /* Built-in protocols. */ |
| 51 | extern const struct nf_nat_l4proto nf_nat_l4proto_tcp; | 52 | extern const struct nf_nat_l4proto nf_nat_l4proto_tcp; |
| @@ -54,19 +55,18 @@ extern const struct nf_nat_l4proto nf_nat_l4proto_icmp; | |||
| 54 | extern const struct nf_nat_l4proto nf_nat_l4proto_icmpv6; | 55 | extern const struct nf_nat_l4proto nf_nat_l4proto_icmpv6; |
| 55 | extern const struct nf_nat_l4proto nf_nat_l4proto_unknown; | 56 | extern const struct nf_nat_l4proto nf_nat_l4proto_unknown; |
| 56 | 57 | ||
| 57 | extern bool nf_nat_l4proto_in_range(const struct nf_conntrack_tuple *tuple, | 58 | bool nf_nat_l4proto_in_range(const struct nf_conntrack_tuple *tuple, |
| 58 | enum nf_nat_manip_type maniptype, | 59 | enum nf_nat_manip_type maniptype, |
| 59 | const union nf_conntrack_man_proto *min, | 60 | const union nf_conntrack_man_proto *min, |
| 60 | const union nf_conntrack_man_proto *max); | 61 | const union nf_conntrack_man_proto *max); |
| 61 | 62 | ||
| 62 | extern void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto, | 63 | void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto, |
| 63 | struct nf_conntrack_tuple *tuple, | 64 | struct nf_conntrack_tuple *tuple, |
| 64 | const struct nf_nat_range *range, | 65 | const struct nf_nat_range *range, |
| 65 | enum nf_nat_manip_type maniptype, | 66 | enum nf_nat_manip_type maniptype, |
| 66 | const struct nf_conn *ct, | 67 | const struct nf_conn *ct, u16 *rover); |
| 67 | u16 *rover); | ||
| 68 | 68 | ||
| 69 | extern int nf_nat_l4proto_nlattr_to_range(struct nlattr *tb[], | 69 | int nf_nat_l4proto_nlattr_to_range(struct nlattr *tb[], |
| 70 | struct nf_nat_range *range); | 70 | struct nf_nat_range *range); |
| 71 | 71 | ||
| 72 | #endif /*_NF_NAT_L4PROTO_H*/ | 72 | #endif /*_NF_NAT_L4PROTO_H*/ |
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h index aaba4bbcdda0..c1d5b3e34a21 100644 --- a/include/net/netfilter/nf_queue.h +++ b/include/net/netfilter/nf_queue.h | |||
| @@ -28,7 +28,7 @@ struct nf_queue_handler { | |||
| 28 | 28 | ||
| 29 | void nf_register_queue_handler(const struct nf_queue_handler *qh); | 29 | void nf_register_queue_handler(const struct nf_queue_handler *qh); |
| 30 | void nf_unregister_queue_handler(void); | 30 | void nf_unregister_queue_handler(void); |
| 31 | extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); | 31 | void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); |
| 32 | 32 | ||
| 33 | bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); | 33 | bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); |
| 34 | void nf_queue_entry_release_refs(struct nf_queue_entry *entry); | 34 | void nf_queue_entry_release_refs(struct nf_queue_entry *entry); |
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h new file mode 100644 index 000000000000..5a91abfc0c30 --- /dev/null +++ b/include/net/netfilter/nf_tables.h | |||
| @@ -0,0 +1,519 @@ | |||
| 1 | #ifndef _NET_NF_TABLES_H | ||
| 2 | #define _NET_NF_TABLES_H | ||
| 3 | |||
| 4 | #include <linux/list.h> | ||
| 5 | #include <linux/netfilter.h> | ||
| 6 | #include <linux/netfilter/x_tables.h> | ||
| 7 | #include <linux/netfilter/nf_tables.h> | ||
| 8 | #include <net/netlink.h> | ||
| 9 | |||
| 10 | #define NFT_JUMP_STACK_SIZE 16 | ||
| 11 | |||
| 12 | struct nft_pktinfo { | ||
| 13 | struct sk_buff *skb; | ||
| 14 | const struct net_device *in; | ||
| 15 | const struct net_device *out; | ||
| 16 | u8 hooknum; | ||
| 17 | u8 nhoff; | ||
| 18 | u8 thoff; | ||
| 19 | /* for x_tables compatibility */ | ||
| 20 | struct xt_action_param xt; | ||
| 21 | }; | ||
| 22 | |||
| 23 | static inline void nft_set_pktinfo(struct nft_pktinfo *pkt, | ||
| 24 | const struct nf_hook_ops *ops, | ||
| 25 | struct sk_buff *skb, | ||
| 26 | const struct net_device *in, | ||
| 27 | const struct net_device *out) | ||
| 28 | { | ||
| 29 | pkt->skb = skb; | ||
| 30 | pkt->in = pkt->xt.in = in; | ||
| 31 | pkt->out = pkt->xt.out = out; | ||
| 32 | pkt->hooknum = pkt->xt.hooknum = ops->hooknum; | ||
| 33 | pkt->xt.family = ops->pf; | ||
| 34 | } | ||
| 35 | |||
| 36 | struct nft_data { | ||
| 37 | union { | ||
| 38 | u32 data[4]; | ||
| 39 | struct { | ||
| 40 | u32 verdict; | ||
| 41 | struct nft_chain *chain; | ||
| 42 | }; | ||
| 43 | }; | ||
| 44 | } __attribute__((aligned(__alignof__(u64)))); | ||
| 45 | |||
| 46 | static inline int nft_data_cmp(const struct nft_data *d1, | ||
| 47 | const struct nft_data *d2, | ||
| 48 | unsigned int len) | ||
| 49 | { | ||
| 50 | return memcmp(d1->data, d2->data, len); | ||
| 51 | } | ||
| 52 | |||
| 53 | static inline void nft_data_copy(struct nft_data *dst, | ||
| 54 | const struct nft_data *src) | ||
| 55 | { | ||
| 56 | BUILD_BUG_ON(__alignof__(*dst) != __alignof__(u64)); | ||
| 57 | *(u64 *)&dst->data[0] = *(u64 *)&src->data[0]; | ||
| 58 | *(u64 *)&dst->data[2] = *(u64 *)&src->data[2]; | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline void nft_data_debug(const struct nft_data *data) | ||
| 62 | { | ||
| 63 | pr_debug("data[0]=%x data[1]=%x data[2]=%x data[3]=%x\n", | ||
| 64 | data->data[0], data->data[1], | ||
| 65 | data->data[2], data->data[3]); | ||
| 66 | } | ||
| 67 | |||
| 68 | /** | ||
| 69 | * struct nft_ctx - nf_tables rule/set context | ||
| 70 | * | ||
| 71 | * @net: net namespace | ||
| 72 | * @skb: netlink skb | ||
| 73 | * @nlh: netlink message header | ||
| 74 | * @afi: address family info | ||
| 75 | * @table: the table the chain is contained in | ||
| 76 | * @chain: the chain the rule is contained in | ||
| 77 | * @nla: netlink attributes | ||
| 78 | */ | ||
| 79 | struct nft_ctx { | ||
| 80 | struct net *net; | ||
| 81 | const struct sk_buff *skb; | ||
| 82 | const struct nlmsghdr *nlh; | ||
| 83 | const struct nft_af_info *afi; | ||
| 84 | const struct nft_table *table; | ||
| 85 | const struct nft_chain *chain; | ||
| 86 | const struct nlattr * const *nla; | ||
| 87 | }; | ||
| 88 | |||
| 89 | struct nft_data_desc { | ||
| 90 | enum nft_data_types type; | ||
| 91 | unsigned int len; | ||
| 92 | }; | ||
| 93 | |||
| 94 | int nft_data_init(const struct nft_ctx *ctx, struct nft_data *data, | ||
| 95 | struct nft_data_desc *desc, const struct nlattr *nla); | ||
| 96 | void nft_data_uninit(const struct nft_data *data, enum nft_data_types type); | ||
| 97 | int nft_data_dump(struct sk_buff *skb, int attr, const struct nft_data *data, | ||
| 98 | enum nft_data_types type, unsigned int len); | ||
| 99 | |||
| 100 | static inline enum nft_data_types nft_dreg_to_type(enum nft_registers reg) | ||
| 101 | { | ||
| 102 | return reg == NFT_REG_VERDICT ? NFT_DATA_VERDICT : NFT_DATA_VALUE; | ||
| 103 | } | ||
| 104 | |||
| 105 | static inline enum nft_registers nft_type_to_reg(enum nft_data_types type) | ||
| 106 | { | ||
| 107 | return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1; | ||
| 108 | } | ||
| 109 | |||
| 110 | int nft_validate_input_register(enum nft_registers reg); | ||
| 111 | int nft_validate_output_register(enum nft_registers reg); | ||
| 112 | int nft_validate_data_load(const struct nft_ctx *ctx, enum nft_registers reg, | ||
| 113 | const struct nft_data *data, | ||
| 114 | enum nft_data_types type); | ||
| 115 | |||
| 116 | /** | ||
| 117 | * struct nft_set_elem - generic representation of set elements | ||
| 118 | * | ||
| 119 | * @cookie: implementation specific element cookie | ||
| 120 | * @key: element key | ||
| 121 | * @data: element data (maps only) | ||
| 122 | * @flags: element flags (end of interval) | ||
| 123 | * | ||
| 124 | * The cookie can be used to store a handle to the element for subsequent | ||
| 125 | * removal. | ||
| 126 | */ | ||
| 127 | struct nft_set_elem { | ||
| 128 | void *cookie; | ||
| 129 | struct nft_data key; | ||
| 130 | struct nft_data data; | ||
| 131 | u32 flags; | ||
| 132 | }; | ||
| 133 | |||
| 134 | struct nft_set; | ||
| 135 | struct nft_set_iter { | ||
| 136 | unsigned int count; | ||
| 137 | unsigned int skip; | ||
| 138 | int err; | ||
| 139 | int (*fn)(const struct nft_ctx *ctx, | ||
| 140 | const struct nft_set *set, | ||
| 141 | const struct nft_set_iter *iter, | ||
| 142 | const struct nft_set_elem *elem); | ||
| 143 | }; | ||
| 144 | |||
| 145 | /** | ||
| 146 | * struct nft_set_ops - nf_tables set operations | ||
| 147 | * | ||
| 148 | * @lookup: look up an element within the set | ||
| 149 | * @insert: insert new element into set | ||
| 150 | * @remove: remove element from set | ||
| 151 | * @walk: iterate over all set elemeennts | ||
| 152 | * @privsize: function to return size of set private data | ||
| 153 | * @init: initialize private data of new set instance | ||
| 154 | * @destroy: destroy private data of set instance | ||
| 155 | * @list: nf_tables_set_ops list node | ||
| 156 | * @owner: module reference | ||
| 157 | * @features: features supported by the implementation | ||
| 158 | */ | ||
| 159 | struct nft_set_ops { | ||
| 160 | bool (*lookup)(const struct nft_set *set, | ||
| 161 | const struct nft_data *key, | ||
| 162 | struct nft_data *data); | ||
| 163 | int (*get)(const struct nft_set *set, | ||
| 164 | struct nft_set_elem *elem); | ||
| 165 | int (*insert)(const struct nft_set *set, | ||
| 166 | const struct nft_set_elem *elem); | ||
| 167 | void (*remove)(const struct nft_set *set, | ||
| 168 | const struct nft_set_elem *elem); | ||
| 169 | void (*walk)(const struct nft_ctx *ctx, | ||
| 170 | const struct nft_set *set, | ||
| 171 | struct nft_set_iter *iter); | ||
| 172 | |||
| 173 | unsigned int (*privsize)(const struct nlattr * const nla[]); | ||
| 174 | int (*init)(const struct nft_set *set, | ||
| 175 | const struct nlattr * const nla[]); | ||
| 176 | void (*destroy)(const struct nft_set *set); | ||
| 177 | |||
| 178 | struct list_head list; | ||
| 179 | struct module *owner; | ||
| 180 | u32 features; | ||
| 181 | }; | ||
| 182 | |||
| 183 | int nft_register_set(struct nft_set_ops *ops); | ||
| 184 | void nft_unregister_set(struct nft_set_ops *ops); | ||
| 185 | |||
| 186 | /** | ||
| 187 | * struct nft_set - nf_tables set instance | ||
| 188 | * | ||
| 189 | * @list: table set list node | ||
| 190 | * @bindings: list of set bindings | ||
| 191 | * @name: name of the set | ||
| 192 | * @ktype: key type (numeric type defined by userspace, not used in the kernel) | ||
| 193 | * @dtype: data type (verdict or numeric type defined by userspace) | ||
| 194 | * @ops: set ops | ||
| 195 | * @flags: set flags | ||
| 196 | * @klen: key length | ||
| 197 | * @dlen: data length | ||
| 198 | * @data: private set data | ||
| 199 | */ | ||
| 200 | struct nft_set { | ||
| 201 | struct list_head list; | ||
| 202 | struct list_head bindings; | ||
| 203 | char name[IFNAMSIZ]; | ||
| 204 | u32 ktype; | ||
| 205 | u32 dtype; | ||
| 206 | /* runtime data below here */ | ||
| 207 | const struct nft_set_ops *ops ____cacheline_aligned; | ||
| 208 | u16 flags; | ||
| 209 | u8 klen; | ||
| 210 | u8 dlen; | ||
| 211 | unsigned char data[] | ||
| 212 | __attribute__((aligned(__alignof__(u64)))); | ||
| 213 | }; | ||
| 214 | |||
| 215 | static inline void *nft_set_priv(const struct nft_set *set) | ||
| 216 | { | ||
| 217 | return (void *)set->data; | ||
| 218 | } | ||
| 219 | |||
| 220 | struct nft_set *nf_tables_set_lookup(const struct nft_table *table, | ||
| 221 | const struct nlattr *nla); | ||
| 222 | |||
| 223 | /** | ||
| 224 | * struct nft_set_binding - nf_tables set binding | ||
| 225 | * | ||
| 226 | * @list: set bindings list node | ||
| 227 | * @chain: chain containing the rule bound to the set | ||
| 228 | * | ||
| 229 | * A set binding contains all information necessary for validation | ||
| 230 | * of new elements added to a bound set. | ||
| 231 | */ | ||
| 232 | struct nft_set_binding { | ||
| 233 | struct list_head list; | ||
| 234 | const struct nft_chain *chain; | ||
| 235 | }; | ||
| 236 | |||
| 237 | int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set, | ||
| 238 | struct nft_set_binding *binding); | ||
| 239 | void nf_tables_unbind_set(const struct nft_ctx *ctx, struct nft_set *set, | ||
| 240 | struct nft_set_binding *binding); | ||
| 241 | |||
| 242 | |||
| 243 | /** | ||
| 244 | * struct nft_expr_type - nf_tables expression type | ||
| 245 | * | ||
| 246 | * @select_ops: function to select nft_expr_ops | ||
| 247 | * @ops: default ops, used when no select_ops functions is present | ||
| 248 | * @list: used internally | ||
| 249 | * @name: Identifier | ||
| 250 | * @owner: module reference | ||
| 251 | * @policy: netlink attribute policy | ||
| 252 | * @maxattr: highest netlink attribute number | ||
| 253 | */ | ||
| 254 | struct nft_expr_type { | ||
| 255 | const struct nft_expr_ops *(*select_ops)(const struct nft_ctx *, | ||
| 256 | const struct nlattr * const tb[]); | ||
| 257 | const struct nft_expr_ops *ops; | ||
| 258 | struct list_head list; | ||
| 259 | const char *name; | ||
| 260 | struct module *owner; | ||
| 261 | const struct nla_policy *policy; | ||
| 262 | unsigned int maxattr; | ||
| 263 | }; | ||
| 264 | |||
| 265 | /** | ||
| 266 | * struct nft_expr_ops - nf_tables expression operations | ||
| 267 | * | ||
| 268 | * @eval: Expression evaluation function | ||
| 269 | * @size: full expression size, including private data size | ||
| 270 | * @init: initialization function | ||
| 271 | * @destroy: destruction function | ||
| 272 | * @dump: function to dump parameters | ||
| 273 | * @type: expression type | ||
| 274 | * @validate: validate expression, called during loop detection | ||
| 275 | * @data: extra data to attach to this expression operation | ||
| 276 | */ | ||
| 277 | struct nft_expr; | ||
| 278 | struct nft_expr_ops { | ||
| 279 | void (*eval)(const struct nft_expr *expr, | ||
| 280 | struct nft_data data[NFT_REG_MAX + 1], | ||
| 281 | const struct nft_pktinfo *pkt); | ||
| 282 | unsigned int size; | ||
| 283 | |||
| 284 | int (*init)(const struct nft_ctx *ctx, | ||
| 285 | const struct nft_expr *expr, | ||
| 286 | const struct nlattr * const tb[]); | ||
| 287 | void (*destroy)(const struct nft_expr *expr); | ||
| 288 | int (*dump)(struct sk_buff *skb, | ||
| 289 | const struct nft_expr *expr); | ||
| 290 | int (*validate)(const struct nft_ctx *ctx, | ||
| 291 | const struct nft_expr *expr, | ||
| 292 | const struct nft_data **data); | ||
| 293 | const struct nft_expr_type *type; | ||
| 294 | void *data; | ||
| 295 | }; | ||
| 296 | |||
| 297 | #define NFT_EXPR_MAXATTR 16 | ||
| 298 | #define NFT_EXPR_SIZE(size) (sizeof(struct nft_expr) + \ | ||
| 299 | ALIGN(size, __alignof__(struct nft_expr))) | ||
| 300 | |||
| 301 | /** | ||
| 302 | * struct nft_expr - nf_tables expression | ||
| 303 | * | ||
| 304 | * @ops: expression ops | ||
| 305 | * @data: expression private data | ||
| 306 | */ | ||
| 307 | struct nft_expr { | ||
| 308 | const struct nft_expr_ops *ops; | ||
| 309 | unsigned char data[]; | ||
| 310 | }; | ||
| 311 | |||
| 312 | static inline void *nft_expr_priv(const struct nft_expr *expr) | ||
| 313 | { | ||
| 314 | return (void *)expr->data; | ||
| 315 | } | ||
| 316 | |||
| 317 | /** | ||
| 318 | * struct nft_rule - nf_tables rule | ||
| 319 | * | ||
| 320 | * @list: used internally | ||
| 321 | * @rcu_head: used internally for rcu | ||
| 322 | * @handle: rule handle | ||
| 323 | * @genmask: generation mask | ||
| 324 | * @dlen: length of expression data | ||
| 325 | * @data: expression data | ||
| 326 | */ | ||
| 327 | struct nft_rule { | ||
| 328 | struct list_head list; | ||
| 329 | struct rcu_head rcu_head; | ||
| 330 | u64 handle:46, | ||
| 331 | genmask:2, | ||
| 332 | dlen:16; | ||
| 333 | unsigned char data[] | ||
| 334 | __attribute__((aligned(__alignof__(struct nft_expr)))); | ||
| 335 | }; | ||
| 336 | |||
| 337 | /** | ||
| 338 | * struct nft_rule_trans - nf_tables rule update in transaction | ||
| 339 | * | ||
| 340 | * @list: used internally | ||
| 341 | * @rule: rule that needs to be updated | ||
| 342 | * @chain: chain that this rule belongs to | ||
| 343 | * @table: table for which this chain applies | ||
| 344 | * @nlh: netlink header of the message that contain this update | ||
| 345 | * @family: family expressesed as AF_* | ||
| 346 | */ | ||
| 347 | struct nft_rule_trans { | ||
| 348 | struct list_head list; | ||
| 349 | struct nft_rule *rule; | ||
| 350 | const struct nft_chain *chain; | ||
| 351 | const struct nft_table *table; | ||
| 352 | const struct nlmsghdr *nlh; | ||
| 353 | u8 family; | ||
| 354 | }; | ||
| 355 | |||
| 356 | static inline struct nft_expr *nft_expr_first(const struct nft_rule *rule) | ||
| 357 | { | ||
| 358 | return (struct nft_expr *)&rule->data[0]; | ||
| 359 | } | ||
| 360 | |||
| 361 | static inline struct nft_expr *nft_expr_next(const struct nft_expr *expr) | ||
| 362 | { | ||
| 363 | return ((void *)expr) + expr->ops->size; | ||
| 364 | } | ||
| 365 | |||
| 366 | static inline struct nft_expr *nft_expr_last(const struct nft_rule *rule) | ||
| 367 | { | ||
| 368 | return (struct nft_expr *)&rule->data[rule->dlen]; | ||
| 369 | } | ||
| 370 | |||
| 371 | /* | ||
| 372 | * The last pointer isn't really necessary, but the compiler isn't able to | ||
| 373 | * determine that the result of nft_expr_last() is always the same since it | ||
| 374 | * can't assume that the dlen value wasn't changed within calls in the loop. | ||
| 375 | */ | ||
| 376 | #define nft_rule_for_each_expr(expr, last, rule) \ | ||
| 377 | for ((expr) = nft_expr_first(rule), (last) = nft_expr_last(rule); \ | ||
| 378 | (expr) != (last); \ | ||
| 379 | (expr) = nft_expr_next(expr)) | ||
| 380 | |||
| 381 | enum nft_chain_flags { | ||
| 382 | NFT_BASE_CHAIN = 0x1, | ||
| 383 | }; | ||
| 384 | |||
| 385 | /** | ||
| 386 | * struct nft_chain - nf_tables chain | ||
| 387 | * | ||
| 388 | * @rules: list of rules in the chain | ||
| 389 | * @list: used internally | ||
| 390 | * @rcu_head: used internally | ||
| 391 | * @net: net namespace that this chain belongs to | ||
| 392 | * @table: table that this chain belongs to | ||
| 393 | * @handle: chain handle | ||
| 394 | * @flags: bitmask of enum nft_chain_flags | ||
| 395 | * @use: number of jump references to this chain | ||
| 396 | * @level: length of longest path to this chain | ||
| 397 | * @name: name of the chain | ||
| 398 | */ | ||
| 399 | struct nft_chain { | ||
| 400 | struct list_head rules; | ||
| 401 | struct list_head list; | ||
| 402 | struct rcu_head rcu_head; | ||
| 403 | struct net *net; | ||
| 404 | struct nft_table *table; | ||
| 405 | u64 handle; | ||
| 406 | u8 flags; | ||
| 407 | u16 use; | ||
| 408 | u16 level; | ||
| 409 | char name[NFT_CHAIN_MAXNAMELEN]; | ||
| 410 | }; | ||
| 411 | |||
| 412 | enum nft_chain_type { | ||
| 413 | NFT_CHAIN_T_DEFAULT = 0, | ||
| 414 | NFT_CHAIN_T_ROUTE, | ||
| 415 | NFT_CHAIN_T_NAT, | ||
| 416 | NFT_CHAIN_T_MAX | ||
| 417 | }; | ||
| 418 | |||
| 419 | struct nft_stats { | ||
| 420 | u64 bytes; | ||
| 421 | u64 pkts; | ||
| 422 | }; | ||
| 423 | |||
| 424 | /** | ||
| 425 | * struct nft_base_chain - nf_tables base chain | ||
| 426 | * | ||
| 427 | * @ops: netfilter hook ops | ||
| 428 | * @type: chain type | ||
| 429 | * @policy: default policy | ||
| 430 | * @stats: per-cpu chain stats | ||
| 431 | * @chain: the chain | ||
| 432 | */ | ||
| 433 | struct nft_base_chain { | ||
| 434 | struct nf_hook_ops ops; | ||
| 435 | enum nft_chain_type type; | ||
| 436 | u8 policy; | ||
| 437 | struct nft_stats __percpu *stats; | ||
| 438 | struct nft_chain chain; | ||
| 439 | }; | ||
| 440 | |||
| 441 | static inline struct nft_base_chain *nft_base_chain(const struct nft_chain *chain) | ||
| 442 | { | ||
| 443 | return container_of(chain, struct nft_base_chain, chain); | ||
| 444 | } | ||
| 445 | |||
| 446 | unsigned int nft_do_chain_pktinfo(struct nft_pktinfo *pkt, | ||
| 447 | const struct nf_hook_ops *ops); | ||
| 448 | |||
| 449 | /** | ||
| 450 | * struct nft_table - nf_tables table | ||
| 451 | * | ||
| 452 | * @list: used internally | ||
| 453 | * @chains: chains in the table | ||
| 454 | * @sets: sets in the table | ||
| 455 | * @hgenerator: handle generator state | ||
| 456 | * @use: number of chain references to this table | ||
| 457 | * @flags: table flag (see enum nft_table_flags) | ||
| 458 | * @name: name of the table | ||
| 459 | */ | ||
| 460 | struct nft_table { | ||
| 461 | struct list_head list; | ||
| 462 | struct list_head chains; | ||
| 463 | struct list_head sets; | ||
| 464 | u64 hgenerator; | ||
| 465 | u32 use; | ||
| 466 | u16 flags; | ||
| 467 | char name[]; | ||
| 468 | }; | ||
| 469 | |||
| 470 | /** | ||
| 471 | * struct nft_af_info - nf_tables address family info | ||
| 472 | * | ||
| 473 | * @list: used internally | ||
| 474 | * @family: address family | ||
| 475 | * @nhooks: number of hooks in this family | ||
| 476 | * @owner: module owner | ||
| 477 | * @tables: used internally | ||
| 478 | * @hooks: hookfn overrides for packet validation | ||
| 479 | */ | ||
| 480 | struct nft_af_info { | ||
| 481 | struct list_head list; | ||
| 482 | int family; | ||
| 483 | unsigned int nhooks; | ||
| 484 | struct module *owner; | ||
| 485 | struct list_head tables; | ||
| 486 | nf_hookfn *hooks[NF_MAX_HOOKS]; | ||
| 487 | }; | ||
| 488 | |||
| 489 | int nft_register_afinfo(struct net *, struct nft_af_info *); | ||
| 490 | void nft_unregister_afinfo(struct nft_af_info *); | ||
| 491 | |||
| 492 | struct nf_chain_type { | ||
| 493 | unsigned int hook_mask; | ||
| 494 | const char *name; | ||
| 495 | enum nft_chain_type type; | ||
| 496 | nf_hookfn *fn[NF_MAX_HOOKS]; | ||
| 497 | struct module *me; | ||
| 498 | int family; | ||
| 499 | }; | ||
| 500 | |||
| 501 | int nft_register_chain_type(struct nf_chain_type *); | ||
| 502 | void nft_unregister_chain_type(struct nf_chain_type *); | ||
| 503 | |||
| 504 | int nft_register_expr(struct nft_expr_type *); | ||
| 505 | void nft_unregister_expr(struct nft_expr_type *); | ||
| 506 | |||
| 507 | #define MODULE_ALIAS_NFT_FAMILY(family) \ | ||
| 508 | MODULE_ALIAS("nft-afinfo-" __stringify(family)) | ||
| 509 | |||
| 510 | #define MODULE_ALIAS_NFT_CHAIN(family, name) \ | ||
| 511 | MODULE_ALIAS("nft-chain-" __stringify(family) "-" name) | ||
| 512 | |||
| 513 | #define MODULE_ALIAS_NFT_EXPR(name) \ | ||
| 514 | MODULE_ALIAS("nft-expr-" name) | ||
| 515 | |||
| 516 | #define MODULE_ALIAS_NFT_SET() \ | ||
| 517 | MODULE_ALIAS("nft-set") | ||
| 518 | |||
| 519 | #endif /* _NET_NF_TABLES_H */ | ||
diff --git a/include/net/netfilter/nf_tables_core.h b/include/net/netfilter/nf_tables_core.h new file mode 100644 index 000000000000..cf2b7ae2b9d8 --- /dev/null +++ b/include/net/netfilter/nf_tables_core.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #ifndef _NET_NF_TABLES_CORE_H | ||
| 2 | #define _NET_NF_TABLES_CORE_H | ||
| 3 | |||
| 4 | int nf_tables_core_module_init(void); | ||
| 5 | void nf_tables_core_module_exit(void); | ||
| 6 | |||
| 7 | int nft_immediate_module_init(void); | ||
| 8 | void nft_immediate_module_exit(void); | ||
| 9 | |||
| 10 | struct nft_cmp_fast_expr { | ||
| 11 | u32 data; | ||
| 12 | enum nft_registers sreg:8; | ||
| 13 | u8 len; | ||
| 14 | }; | ||
| 15 | |||
| 16 | extern const struct nft_expr_ops nft_cmp_fast_ops; | ||
| 17 | |||
| 18 | int nft_cmp_module_init(void); | ||
| 19 | void nft_cmp_module_exit(void); | ||
| 20 | |||
| 21 | int nft_lookup_module_init(void); | ||
| 22 | void nft_lookup_module_exit(void); | ||
| 23 | |||
| 24 | int nft_bitwise_module_init(void); | ||
| 25 | void nft_bitwise_module_exit(void); | ||
| 26 | |||
| 27 | int nft_byteorder_module_init(void); | ||
| 28 | void nft_byteorder_module_exit(void); | ||
| 29 | |||
| 30 | struct nft_payload { | ||
| 31 | enum nft_payload_bases base:8; | ||
| 32 | u8 offset; | ||
| 33 | u8 len; | ||
| 34 | enum nft_registers dreg:8; | ||
| 35 | }; | ||
| 36 | |||
| 37 | extern const struct nft_expr_ops nft_payload_fast_ops; | ||
| 38 | |||
| 39 | int nft_payload_module_init(void); | ||
| 40 | void nft_payload_module_exit(void); | ||
| 41 | |||
| 42 | #endif /* _NET_NF_TABLES_CORE_H */ | ||
diff --git a/include/net/netfilter/nf_tables_ipv4.h b/include/net/netfilter/nf_tables_ipv4.h new file mode 100644 index 000000000000..1be1c2c197ee --- /dev/null +++ b/include/net/netfilter/nf_tables_ipv4.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #ifndef _NF_TABLES_IPV4_H_ | ||
| 2 | #define _NF_TABLES_IPV4_H_ | ||
| 3 | |||
| 4 | #include <net/netfilter/nf_tables.h> | ||
| 5 | #include <net/ip.h> | ||
| 6 | |||
| 7 | static inline void | ||
| 8 | nft_set_pktinfo_ipv4(struct nft_pktinfo *pkt, | ||
| 9 | const struct nf_hook_ops *ops, | ||
| 10 | struct sk_buff *skb, | ||
| 11 | const struct net_device *in, | ||
| 12 | const struct net_device *out) | ||
| 13 | { | ||
| 14 | struct iphdr *ip; | ||
| 15 | |||
| 16 | nft_set_pktinfo(pkt, ops, skb, in, out); | ||
| 17 | |||
| 18 | pkt->xt.thoff = ip_hdrlen(pkt->skb); | ||
| 19 | ip = ip_hdr(pkt->skb); | ||
| 20 | pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET; | ||
| 21 | } | ||
| 22 | |||
| 23 | #endif | ||
diff --git a/include/net/netfilter/nf_tables_ipv6.h b/include/net/netfilter/nf_tables_ipv6.h new file mode 100644 index 000000000000..4a9b88a65963 --- /dev/null +++ b/include/net/netfilter/nf_tables_ipv6.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #ifndef _NF_TABLES_IPV6_H_ | ||
| 2 | #define _NF_TABLES_IPV6_H_ | ||
| 3 | |||
| 4 | #include <linux/netfilter_ipv6/ip6_tables.h> | ||
| 5 | #include <net/ipv6.h> | ||
| 6 | |||
| 7 | static inline int | ||
| 8 | nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt, | ||
| 9 | const struct nf_hook_ops *ops, | ||
| 10 | struct sk_buff *skb, | ||
| 11 | const struct net_device *in, | ||
| 12 | const struct net_device *out) | ||
| 13 | { | ||
| 14 | int protohdr, thoff = 0; | ||
| 15 | unsigned short frag_off; | ||
| 16 | |||
| 17 | nft_set_pktinfo(pkt, ops, skb, in, out); | ||
| 18 | |||
| 19 | protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, NULL); | ||
| 20 | /* If malformed, drop it */ | ||
| 21 | if (protohdr < 0) | ||
| 22 | return -1; | ||
| 23 | |||
| 24 | pkt->xt.thoff = thoff; | ||
| 25 | pkt->xt.fragoff = frag_off; | ||
| 26 | |||
| 27 | return 0; | ||
| 28 | } | ||
| 29 | |||
| 30 | #endif | ||
diff --git a/include/net/netfilter/xt_rateest.h b/include/net/netfilter/xt_rateest.h index 495c71f66e7e..79f45e19f31e 100644 --- a/include/net/netfilter/xt_rateest.h +++ b/include/net/netfilter/xt_rateest.h | |||
| @@ -16,7 +16,7 @@ struct xt_rateest { | |||
| 16 | struct rcu_head rcu; | 16 | struct rcu_head rcu; |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | extern struct xt_rateest *xt_rateest_lookup(const char *name); | 19 | struct xt_rateest *xt_rateest_lookup(const char *name); |
| 20 | extern void xt_rateest_put(struct xt_rateest *est); | 20 | void xt_rateest_put(struct xt_rateest *est); |
| 21 | 21 | ||
| 22 | #endif /* _XT_RATEEST_H */ | 22 | #endif /* _XT_RATEEST_H */ |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 9690b0f6698a..2b47eaadba8f 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
| @@ -225,44 +225,31 @@ struct nl_info { | |||
| 225 | u32 portid; | 225 | u32 portid; |
| 226 | }; | 226 | }; |
| 227 | 227 | ||
| 228 | extern int netlink_rcv_skb(struct sk_buff *skb, | 228 | int netlink_rcv_skb(struct sk_buff *skb, |
| 229 | int (*cb)(struct sk_buff *, | 229 | int (*cb)(struct sk_buff *, struct nlmsghdr *)); |
| 230 | struct nlmsghdr *)); | 230 | int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid, |
| 231 | extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, | 231 | unsigned int group, int report, gfp_t flags); |
| 232 | u32 portid, unsigned int group, int report, | 232 | |
| 233 | gfp_t flags); | 233 | int nla_validate(const struct nlattr *head, int len, int maxtype, |
| 234 | 234 | const struct nla_policy *policy); | |
| 235 | extern int nla_validate(const struct nlattr *head, | 235 | int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, |
| 236 | int len, int maxtype, | 236 | int len, const struct nla_policy *policy); |
| 237 | const struct nla_policy *policy); | 237 | int nla_policy_len(const struct nla_policy *, int); |
| 238 | extern int nla_parse(struct nlattr **tb, int maxtype, | 238 | struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype); |
| 239 | const struct nlattr *head, int len, | 239 | size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize); |
| 240 | const struct nla_policy *policy); | 240 | int nla_memcpy(void *dest, const struct nlattr *src, int count); |
| 241 | extern int nla_policy_len(const struct nla_policy *, int); | 241 | int nla_memcmp(const struct nlattr *nla, const void *data, size_t size); |
| 242 | extern struct nlattr * nla_find(const struct nlattr *head, | 242 | int nla_strcmp(const struct nlattr *nla, const char *str); |
| 243 | int len, int attrtype); | 243 | struct nlattr *__nla_reserve(struct sk_buff *skb, int attrtype, int attrlen); |
| 244 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, | 244 | void *__nla_reserve_nohdr(struct sk_buff *skb, int attrlen); |
| 245 | size_t dstsize); | 245 | struct nlattr *nla_reserve(struct sk_buff *skb, int attrtype, int attrlen); |
| 246 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); | 246 | void *nla_reserve_nohdr(struct sk_buff *skb, int attrlen); |
| 247 | extern int nla_memcmp(const struct nlattr *nla, const void *data, | 247 | void __nla_put(struct sk_buff *skb, int attrtype, int attrlen, |
| 248 | size_t size); | 248 | const void *data); |
| 249 | extern int nla_strcmp(const struct nlattr *nla, const char *str); | 249 | void __nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data); |
| 250 | extern struct nlattr * __nla_reserve(struct sk_buff *skb, int attrtype, | 250 | int nla_put(struct sk_buff *skb, int attrtype, int attrlen, const void *data); |
| 251 | int attrlen); | 251 | int nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data); |
| 252 | extern void * __nla_reserve_nohdr(struct sk_buff *skb, int attrlen); | 252 | int nla_append(struct sk_buff *skb, int attrlen, const void *data); |
| 253 | extern struct nlattr * nla_reserve(struct sk_buff *skb, int attrtype, | ||
| 254 | int attrlen); | ||
| 255 | extern void * nla_reserve_nohdr(struct sk_buff *skb, int attrlen); | ||
| 256 | extern void __nla_put(struct sk_buff *skb, int attrtype, | ||
| 257 | int attrlen, const void *data); | ||
| 258 | extern void __nla_put_nohdr(struct sk_buff *skb, int attrlen, | ||
| 259 | const void *data); | ||
| 260 | extern int nla_put(struct sk_buff *skb, int attrtype, | ||
| 261 | int attrlen, const void *data); | ||
| 262 | extern int nla_put_nohdr(struct sk_buff *skb, int attrlen, | ||
| 263 | const void *data); | ||
| 264 | extern int nla_append(struct sk_buff *skb, int attrlen, | ||
| 265 | const void *data); | ||
| 266 | 253 | ||
| 267 | /************************************************************************** | 254 | /************************************************************************** |
| 268 | * Netlink Messages | 255 | * Netlink Messages |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index bf2ec2202c56..ee520cba2ec2 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
| @@ -15,6 +15,10 @@ struct fib_rules_ops; | |||
| 15 | struct hlist_head; | 15 | struct hlist_head; |
| 16 | struct fib_table; | 16 | struct fib_table; |
| 17 | struct sock; | 17 | struct sock; |
| 18 | struct local_ports { | ||
| 19 | seqlock_t lock; | ||
| 20 | int range[2]; | ||
| 21 | }; | ||
| 18 | 22 | ||
| 19 | struct netns_ipv4 { | 23 | struct netns_ipv4 { |
| 20 | #ifdef CONFIG_SYSCTL | 24 | #ifdef CONFIG_SYSCTL |
| @@ -62,10 +66,11 @@ struct netns_ipv4 { | |||
| 62 | int sysctl_icmp_ratemask; | 66 | int sysctl_icmp_ratemask; |
| 63 | int sysctl_icmp_errors_use_inbound_ifaddr; | 67 | int sysctl_icmp_errors_use_inbound_ifaddr; |
| 64 | 68 | ||
| 69 | struct local_ports sysctl_local_ports; | ||
| 70 | |||
| 65 | int sysctl_tcp_ecn; | 71 | int sysctl_tcp_ecn; |
| 66 | 72 | ||
| 67 | kgid_t sysctl_ping_group_range[2]; | 73 | kgid_t sysctl_ping_group_range[2]; |
| 68 | long sysctl_tcp_mem[3]; | ||
| 69 | 74 | ||
| 70 | atomic_t dev_addr_genid; | 75 | atomic_t dev_addr_genid; |
| 71 | 76 | ||
diff --git a/include/net/netns/nftables.h b/include/net/netns/nftables.h new file mode 100644 index 000000000000..15d056d534e3 --- /dev/null +++ b/include/net/netns/nftables.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _NETNS_NFTABLES_H_ | ||
| 2 | #define _NETNS_NFTABLES_H_ | ||
| 3 | |||
| 4 | #include <linux/list.h> | ||
| 5 | |||
| 6 | struct nft_af_info; | ||
| 7 | |||
| 8 | struct netns_nftables { | ||
| 9 | struct list_head af_info; | ||
| 10 | struct list_head commit_list; | ||
| 11 | struct nft_af_info *ipv4; | ||
| 12 | struct nft_af_info *ipv6; | ||
| 13 | struct nft_af_info *arp; | ||
| 14 | struct nft_af_info *bridge; | ||
| 15 | u8 gencursor; | ||
| 16 | u8 genctr; | ||
| 17 | }; | ||
| 18 | |||
| 19 | #endif | ||
diff --git a/include/net/netrom.h b/include/net/netrom.h index 121dcf854db5..110350aca3df 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
| @@ -183,51 +183,50 @@ extern int sysctl_netrom_routing_control; | |||
| 183 | extern int sysctl_netrom_link_fails_count; | 183 | extern int sysctl_netrom_link_fails_count; |
| 184 | extern int sysctl_netrom_reset_circuit; | 184 | extern int sysctl_netrom_reset_circuit; |
| 185 | 185 | ||
| 186 | extern int nr_rx_frame(struct sk_buff *, struct net_device *); | 186 | int nr_rx_frame(struct sk_buff *, struct net_device *); |
| 187 | extern void nr_destroy_socket(struct sock *); | 187 | void nr_destroy_socket(struct sock *); |
| 188 | 188 | ||
| 189 | /* nr_dev.c */ | 189 | /* nr_dev.c */ |
| 190 | extern int nr_rx_ip(struct sk_buff *, struct net_device *); | 190 | int nr_rx_ip(struct sk_buff *, struct net_device *); |
| 191 | extern void nr_setup(struct net_device *); | 191 | void nr_setup(struct net_device *); |
| 192 | 192 | ||
| 193 | /* nr_in.c */ | 193 | /* nr_in.c */ |
| 194 | extern int nr_process_rx_frame(struct sock *, struct sk_buff *); | 194 | int nr_process_rx_frame(struct sock *, struct sk_buff *); |
| 195 | 195 | ||
| 196 | /* nr_loopback.c */ | 196 | /* nr_loopback.c */ |
| 197 | extern void nr_loopback_init(void); | 197 | void nr_loopback_init(void); |
| 198 | extern void nr_loopback_clear(void); | 198 | void nr_loopback_clear(void); |
| 199 | extern int nr_loopback_queue(struct sk_buff *); | 199 | int nr_loopback_queue(struct sk_buff *); |
| 200 | 200 | ||
| 201 | /* nr_out.c */ | 201 | /* nr_out.c */ |
| 202 | extern void nr_output(struct sock *, struct sk_buff *); | 202 | void nr_output(struct sock *, struct sk_buff *); |
| 203 | extern void nr_send_nak_frame(struct sock *); | 203 | void nr_send_nak_frame(struct sock *); |
| 204 | extern void nr_kick(struct sock *); | 204 | void nr_kick(struct sock *); |
| 205 | extern void nr_transmit_buffer(struct sock *, struct sk_buff *); | 205 | void nr_transmit_buffer(struct sock *, struct sk_buff *); |
| 206 | extern void nr_establish_data_link(struct sock *); | 206 | void nr_establish_data_link(struct sock *); |
| 207 | extern void nr_enquiry_response(struct sock *); | 207 | void nr_enquiry_response(struct sock *); |
| 208 | extern void nr_check_iframes_acked(struct sock *, unsigned short); | 208 | void nr_check_iframes_acked(struct sock *, unsigned short); |
| 209 | 209 | ||
| 210 | /* nr_route.c */ | 210 | /* nr_route.c */ |
| 211 | extern void nr_rt_device_down(struct net_device *); | 211 | void nr_rt_device_down(struct net_device *); |
| 212 | extern struct net_device *nr_dev_first(void); | 212 | struct net_device *nr_dev_first(void); |
| 213 | extern struct net_device *nr_dev_get(ax25_address *); | 213 | struct net_device *nr_dev_get(ax25_address *); |
| 214 | extern int nr_rt_ioctl(unsigned int, void __user *); | 214 | int nr_rt_ioctl(unsigned int, void __user *); |
| 215 | extern void nr_link_failed(ax25_cb *, int); | 215 | void nr_link_failed(ax25_cb *, int); |
| 216 | extern int nr_route_frame(struct sk_buff *, ax25_cb *); | 216 | int nr_route_frame(struct sk_buff *, ax25_cb *); |
| 217 | extern const struct file_operations nr_nodes_fops; | 217 | extern const struct file_operations nr_nodes_fops; |
| 218 | extern const struct file_operations nr_neigh_fops; | 218 | extern const struct file_operations nr_neigh_fops; |
| 219 | extern void nr_rt_free(void); | 219 | void nr_rt_free(void); |
| 220 | 220 | ||
| 221 | /* nr_subr.c */ | 221 | /* nr_subr.c */ |
| 222 | extern void nr_clear_queues(struct sock *); | 222 | void nr_clear_queues(struct sock *); |
| 223 | extern void nr_frames_acked(struct sock *, unsigned short); | 223 | void nr_frames_acked(struct sock *, unsigned short); |
| 224 | extern void nr_requeue_frames(struct sock *); | 224 | void nr_requeue_frames(struct sock *); |
| 225 | extern int nr_validate_nr(struct sock *, unsigned short); | 225 | int nr_validate_nr(struct sock *, unsigned short); |
| 226 | extern int nr_in_rx_window(struct sock *, unsigned short); | 226 | int nr_in_rx_window(struct sock *, unsigned short); |
| 227 | extern void nr_write_internal(struct sock *, int); | 227 | void nr_write_internal(struct sock *, int); |
| 228 | 228 | ||
| 229 | extern void __nr_transmit_reply(struct sk_buff *skb, int mine, | 229 | void __nr_transmit_reply(struct sk_buff *skb, int mine, unsigned char cmdflags); |
| 230 | unsigned char cmdflags); | ||
| 231 | 230 | ||
| 232 | /* | 231 | /* |
| 233 | * This routine is called when a Connect Acknowledge with the Choke Flag | 232 | * This routine is called when a Connect Acknowledge with the Choke Flag |
| @@ -247,24 +246,24 @@ do { \ | |||
| 247 | __nr_transmit_reply((skb), (mine), NR_RESET); \ | 246 | __nr_transmit_reply((skb), (mine), NR_RESET); \ |
| 248 | } while (0) | 247 | } while (0) |
| 249 | 248 | ||
| 250 | extern void nr_disconnect(struct sock *, int); | 249 | void nr_disconnect(struct sock *, int); |
| 251 | 250 | ||
| 252 | /* nr_timer.c */ | 251 | /* nr_timer.c */ |
| 253 | extern void nr_init_timers(struct sock *sk); | 252 | void nr_init_timers(struct sock *sk); |
| 254 | extern void nr_start_heartbeat(struct sock *); | 253 | void nr_start_heartbeat(struct sock *); |
| 255 | extern void nr_start_t1timer(struct sock *); | 254 | void nr_start_t1timer(struct sock *); |
| 256 | extern void nr_start_t2timer(struct sock *); | 255 | void nr_start_t2timer(struct sock *); |
| 257 | extern void nr_start_t4timer(struct sock *); | 256 | void nr_start_t4timer(struct sock *); |
| 258 | extern void nr_start_idletimer(struct sock *); | 257 | void nr_start_idletimer(struct sock *); |
| 259 | extern void nr_stop_heartbeat(struct sock *); | 258 | void nr_stop_heartbeat(struct sock *); |
| 260 | extern void nr_stop_t1timer(struct sock *); | 259 | void nr_stop_t1timer(struct sock *); |
| 261 | extern void nr_stop_t2timer(struct sock *); | 260 | void nr_stop_t2timer(struct sock *); |
| 262 | extern void nr_stop_t4timer(struct sock *); | 261 | void nr_stop_t4timer(struct sock *); |
| 263 | extern void nr_stop_idletimer(struct sock *); | 262 | void nr_stop_idletimer(struct sock *); |
| 264 | extern int nr_t1timer_running(struct sock *); | 263 | int nr_t1timer_running(struct sock *); |
| 265 | 264 | ||
| 266 | /* sysctl_net_netrom.c */ | 265 | /* sysctl_net_netrom.c */ |
| 267 | extern void nr_register_sysctl(void); | 266 | void nr_register_sysctl(void); |
| 268 | extern void nr_unregister_sysctl(void); | 267 | void nr_unregister_sysctl(void); |
| 269 | 268 | ||
| 270 | #endif | 269 | #endif |
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h new file mode 100644 index 000000000000..36acecd5f06c --- /dev/null +++ b/include/net/nfc/digital.h | |||
| @@ -0,0 +1,227 @@ | |||
| 1 | /* | ||
| 2 | * NFC Digital Protocol stack | ||
| 3 | * Copyright (c) 2013, Intel Corporation. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __NFC_DIGITAL_H | ||
| 17 | #define __NFC_DIGITAL_H | ||
| 18 | |||
| 19 | #include <linux/skbuff.h> | ||
| 20 | #include <net/nfc/nfc.h> | ||
| 21 | |||
| 22 | /** | ||
| 23 | * Configuration types for in_configure_hw and tg_configure_hw. | ||
| 24 | */ | ||
| 25 | enum { | ||
| 26 | NFC_DIGITAL_CONFIG_RF_TECH = 0, | ||
| 27 | NFC_DIGITAL_CONFIG_FRAMING, | ||
| 28 | }; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * RF technology values passed as param argument to in_configure_hw and | ||
| 32 | * tg_configure_hw for NFC_DIGITAL_CONFIG_RF_TECH configuration type. | ||
| 33 | */ | ||
| 34 | enum { | ||
| 35 | NFC_DIGITAL_RF_TECH_106A = 0, | ||
| 36 | NFC_DIGITAL_RF_TECH_212F, | ||
| 37 | NFC_DIGITAL_RF_TECH_424F, | ||
| 38 | |||
| 39 | NFC_DIGITAL_RF_TECH_LAST, | ||
| 40 | }; | ||
| 41 | |||
| 42 | /** | ||
| 43 | * Framing configuration passed as param argument to in_configure_hw and | ||
| 44 | * tg_configure_hw for NFC_DIGITAL_CONFIG_FRAMING configuration type. | ||
| 45 | */ | ||
| 46 | enum { | ||
| 47 | NFC_DIGITAL_FRAMING_NFCA_SHORT = 0, | ||
| 48 | NFC_DIGITAL_FRAMING_NFCA_STANDARD, | ||
| 49 | NFC_DIGITAL_FRAMING_NFCA_STANDARD_WITH_CRC_A, | ||
| 50 | |||
| 51 | NFC_DIGITAL_FRAMING_NFCA_T1T, | ||
| 52 | NFC_DIGITAL_FRAMING_NFCA_T2T, | ||
| 53 | NFC_DIGITAL_FRAMING_NFCA_NFC_DEP, | ||
| 54 | |||
| 55 | NFC_DIGITAL_FRAMING_NFCF, | ||
| 56 | NFC_DIGITAL_FRAMING_NFCF_T3T, | ||
| 57 | NFC_DIGITAL_FRAMING_NFCF_NFC_DEP, | ||
| 58 | NFC_DIGITAL_FRAMING_NFC_DEP_ACTIVATED, | ||
| 59 | |||
| 60 | NFC_DIGITAL_FRAMING_LAST, | ||
| 61 | }; | ||
| 62 | |||
| 63 | #define DIGITAL_MDAA_NFCID1_SIZE 3 | ||
| 64 | |||
| 65 | struct digital_tg_mdaa_params { | ||
| 66 | u16 sens_res; | ||
| 67 | u8 nfcid1[DIGITAL_MDAA_NFCID1_SIZE]; | ||
| 68 | u8 sel_res; | ||
| 69 | |||
| 70 | u8 nfcid2[NFC_NFCID2_MAXSIZE]; | ||
| 71 | u16 sc; | ||
| 72 | }; | ||
| 73 | |||
| 74 | struct nfc_digital_dev; | ||
| 75 | |||
| 76 | /** | ||
| 77 | * nfc_digital_cmd_complete_t - Definition of command result callback | ||
| 78 | * | ||
| 79 | * @ddev: nfc_digital_device ref | ||
| 80 | * @arg: user data | ||
| 81 | * @resp: response data | ||
| 82 | * | ||
| 83 | * resp pointer can be an error code and will be checked with IS_ERR() macro. | ||
| 84 | * The callback is responsible for freeing resp sk_buff. | ||
| 85 | */ | ||
| 86 | typedef void (*nfc_digital_cmd_complete_t)(struct nfc_digital_dev *ddev, | ||
| 87 | void *arg, struct sk_buff *resp); | ||
| 88 | |||
| 89 | /** | ||
| 90 | * Device side NFC Digital operations | ||
| 91 | * | ||
| 92 | * Initiator mode: | ||
| 93 | * @in_configure_hw: Hardware configuration for RF technology and communication | ||
| 94 | * framing in initiator mode. This is a synchronous function. | ||
| 95 | * @in_send_cmd: Initiator mode data exchange using RF technology and framing | ||
| 96 | * previously set with in_configure_hw. The peer response is returned | ||
| 97 | * through callback cb. If an io error occurs or the peer didn't reply | ||
| 98 | * within the specified timeout (ms), the error code is passed back through | ||
| 99 | * the resp pointer. This is an asynchronous function. | ||
| 100 | * | ||
| 101 | * Target mode: Only NFC-DEP protocol is supported in target mode. | ||
| 102 | * @tg_configure_hw: Hardware configuration for RF technology and communication | ||
| 103 | * framing in target mode. This is a synchronous function. | ||
| 104 | * @tg_send_cmd: Target mode data exchange using RF technology and framing | ||
| 105 | * previously set with tg_configure_hw. The peer next command is returned | ||
| 106 | * through callback cb. If an io error occurs or the peer didn't reply | ||
| 107 | * within the specified timeout (ms), the error code is passed back through | ||
| 108 | * the resp pointer. This is an asynchronous function. | ||
| 109 | * @tg_listen: Put the device in listen mode waiting for data from the peer | ||
| 110 | * device. This is an asynchronous function. | ||
| 111 | * @tg_listen_mdaa: If supported, put the device in automatic listen mode with | ||
| 112 | * mode detection and automatic anti-collision. In this mode, the device | ||
| 113 | * automatically detects the RF technology and executes the anti-collision | ||
| 114 | * detection using the command responses specified in mdaa_params. The | ||
| 115 | * mdaa_params structure contains SENS_RES, NFCID1, and SEL_RES for 106A RF | ||
| 116 | * tech. NFCID2 and system code (sc) for 212F and 424F. The driver returns | ||
| 117 | * the NFC-DEP ATR_REQ command through cb. The digital stack deducts the RF | ||
| 118 | * tech by analyzing the SoD of the frame containing the ATR_REQ command. | ||
| 119 | * This is an asynchronous function. | ||
| 120 | * | ||
| 121 | * @switch_rf: Turns device radio on or off. The stack does not call explicitly | ||
| 122 | * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn | ||
| 123 | * the device radio on. | ||
| 124 | * @abort_cmd: Discard the last sent command. | ||
| 125 | */ | ||
| 126 | struct nfc_digital_ops { | ||
| 127 | int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type, | ||
| 128 | int param); | ||
| 129 | int (*in_send_cmd)(struct nfc_digital_dev *ddev, struct sk_buff *skb, | ||
| 130 | u16 timeout, nfc_digital_cmd_complete_t cb, | ||
| 131 | void *arg); | ||
| 132 | |||
| 133 | int (*tg_configure_hw)(struct nfc_digital_dev *ddev, int type, | ||
| 134 | int param); | ||
| 135 | int (*tg_send_cmd)(struct nfc_digital_dev *ddev, struct sk_buff *skb, | ||
| 136 | u16 timeout, nfc_digital_cmd_complete_t cb, | ||
| 137 | void *arg); | ||
| 138 | int (*tg_listen)(struct nfc_digital_dev *ddev, u16 timeout, | ||
| 139 | nfc_digital_cmd_complete_t cb, void *arg); | ||
| 140 | int (*tg_listen_mdaa)(struct nfc_digital_dev *ddev, | ||
| 141 | struct digital_tg_mdaa_params *mdaa_params, | ||
| 142 | u16 timeout, nfc_digital_cmd_complete_t cb, | ||
| 143 | void *arg); | ||
| 144 | |||
| 145 | int (*switch_rf)(struct nfc_digital_dev *ddev, bool on); | ||
| 146 | void (*abort_cmd)(struct nfc_digital_dev *ddev); | ||
| 147 | }; | ||
| 148 | |||
| 149 | #define NFC_DIGITAL_POLL_MODE_COUNT_MAX 6 /* 106A, 212F, and 424F in & tg */ | ||
| 150 | |||
| 151 | typedef int (*digital_poll_t)(struct nfc_digital_dev *ddev, u8 rf_tech); | ||
| 152 | |||
| 153 | struct digital_poll_tech { | ||
| 154 | u8 rf_tech; | ||
| 155 | digital_poll_t poll_func; | ||
| 156 | }; | ||
| 157 | |||
| 158 | /** | ||
| 159 | * Driver capabilities - bit mask made of the following values | ||
| 160 | * | ||
| 161 | * @NFC_DIGITAL_DRV_CAPS_IN_CRC: The driver handles CRC calculation in initiator | ||
| 162 | * mode. | ||
| 163 | * @NFC_DIGITAL_DRV_CAPS_TG_CRC: The driver handles CRC calculation in target | ||
| 164 | * mode. | ||
| 165 | */ | ||
| 166 | #define NFC_DIGITAL_DRV_CAPS_IN_CRC 0x0001 | ||
| 167 | #define NFC_DIGITAL_DRV_CAPS_TG_CRC 0x0002 | ||
| 168 | |||
| 169 | struct nfc_digital_dev { | ||
| 170 | struct nfc_dev *nfc_dev; | ||
| 171 | struct nfc_digital_ops *ops; | ||
| 172 | |||
| 173 | u32 protocols; | ||
| 174 | |||
| 175 | int tx_headroom; | ||
| 176 | int tx_tailroom; | ||
| 177 | |||
| 178 | u32 driver_capabilities; | ||
| 179 | void *driver_data; | ||
| 180 | |||
| 181 | struct digital_poll_tech poll_techs[NFC_DIGITAL_POLL_MODE_COUNT_MAX]; | ||
| 182 | u8 poll_tech_count; | ||
| 183 | u8 poll_tech_index; | ||
| 184 | struct mutex poll_lock; | ||
| 185 | |||
| 186 | struct work_struct cmd_work; | ||
| 187 | struct work_struct cmd_complete_work; | ||
| 188 | struct list_head cmd_queue; | ||
| 189 | struct mutex cmd_lock; | ||
| 190 | |||
| 191 | struct work_struct poll_work; | ||
| 192 | |||
| 193 | u8 curr_protocol; | ||
| 194 | u8 curr_rf_tech; | ||
| 195 | u8 curr_nfc_dep_pni; | ||
| 196 | |||
| 197 | int (*skb_check_crc)(struct sk_buff *skb); | ||
| 198 | void (*skb_add_crc)(struct sk_buff *skb); | ||
| 199 | }; | ||
| 200 | |||
| 201 | struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops, | ||
| 202 | __u32 supported_protocols, | ||
| 203 | __u32 driver_capabilities, | ||
| 204 | int tx_headroom, | ||
| 205 | int tx_tailroom); | ||
| 206 | void nfc_digital_free_device(struct nfc_digital_dev *ndev); | ||
| 207 | int nfc_digital_register_device(struct nfc_digital_dev *ndev); | ||
| 208 | void nfc_digital_unregister_device(struct nfc_digital_dev *ndev); | ||
| 209 | |||
| 210 | static inline void nfc_digital_set_parent_dev(struct nfc_digital_dev *ndev, | ||
| 211 | struct device *dev) | ||
| 212 | { | ||
| 213 | nfc_set_parent_dev(ndev->nfc_dev, dev); | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline void nfc_digital_set_drvdata(struct nfc_digital_dev *dev, | ||
| 217 | void *data) | ||
| 218 | { | ||
| 219 | dev->driver_data = data; | ||
| 220 | } | ||
| 221 | |||
| 222 | static inline void *nfc_digital_get_drvdata(struct nfc_digital_dev *dev) | ||
| 223 | { | ||
| 224 | return dev->driver_data; | ||
| 225 | } | ||
| 226 | |||
| 227 | #endif /* __NFC_DIGITAL_H */ | ||
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index b64b7bce4b94..2eca2960ca9c 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
| @@ -24,12 +24,6 @@ | |||
| 24 | 24 | ||
| 25 | #include <net/nfc/nfc.h> | 25 | #include <net/nfc/nfc.h> |
| 26 | 26 | ||
| 27 | struct nfc_phy_ops { | ||
| 28 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
| 29 | int (*enable)(void *dev_id); | ||
| 30 | void (*disable)(void *dev_id); | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct nfc_hci_dev; | 27 | struct nfc_hci_dev; |
| 34 | 28 | ||
| 35 | struct nfc_hci_ops { | 29 | struct nfc_hci_ops { |
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index 88785e5c6b2c..e5aa5acafea0 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h | |||
| @@ -166,6 +166,10 @@ | |||
| 166 | #define NCI_GID_NFCEE_MGMT 0x2 | 166 | #define NCI_GID_NFCEE_MGMT 0x2 |
| 167 | #define NCI_GID_PROPRIETARY 0xf | 167 | #define NCI_GID_PROPRIETARY 0xf |
| 168 | 168 | ||
| 169 | /* ----- NCI over SPI head/crc(tail) room needed for outgoing frames ----- */ | ||
| 170 | #define NCI_SPI_HDR_LEN 4 | ||
| 171 | #define NCI_SPI_CRC_LEN 2 | ||
| 172 | |||
| 169 | /* ---- NCI Packet structures ---- */ | 173 | /* ---- NCI Packet structures ---- */ |
| 170 | #define NCI_CTRL_HDR_SIZE 3 | 174 | #define NCI_CTRL_HDR_SIZE 3 |
| 171 | #define NCI_DATA_HDR_SIZE 3 | 175 | #define NCI_DATA_HDR_SIZE 3 |
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 99fc1f3a392a..6126f1f992b4 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
| @@ -207,19 +207,9 @@ int nci_to_errno(__u8 code); | |||
| 207 | #define NCI_SPI_CRC_ENABLED 0x01 | 207 | #define NCI_SPI_CRC_ENABLED 0x01 |
| 208 | 208 | ||
| 209 | /* ----- NCI SPI structures ----- */ | 209 | /* ----- NCI SPI structures ----- */ |
| 210 | struct nci_spi_dev; | 210 | struct nci_spi { |
| 211 | 211 | struct nci_dev *ndev; | |
| 212 | struct nci_spi_ops { | ||
| 213 | int (*open)(struct nci_spi_dev *ndev); | ||
| 214 | int (*close)(struct nci_spi_dev *ndev); | ||
| 215 | void (*assert_int)(struct nci_spi_dev *ndev); | ||
| 216 | void (*deassert_int)(struct nci_spi_dev *ndev); | ||
| 217 | }; | ||
| 218 | |||
| 219 | struct nci_spi_dev { | ||
| 220 | struct nci_dev *nci_dev; | ||
| 221 | struct spi_device *spi; | 212 | struct spi_device *spi; |
| 222 | struct nci_spi_ops *ops; | ||
| 223 | 213 | ||
| 224 | unsigned int xfer_udelay; /* microseconds delay between | 214 | unsigned int xfer_udelay; /* microseconds delay between |
| 225 | transactions */ | 215 | transactions */ |
| @@ -227,31 +217,15 @@ struct nci_spi_dev { | |||
| 227 | 217 | ||
| 228 | struct completion req_completion; | 218 | struct completion req_completion; |
| 229 | u8 req_result; | 219 | u8 req_result; |
| 230 | |||
| 231 | void *driver_data; | ||
| 232 | }; | 220 | }; |
| 233 | 221 | ||
| 234 | /* ----- NCI SPI Devices ----- */ | 222 | /* ----- NCI SPI ----- */ |
| 235 | struct nci_spi_dev *nci_spi_allocate_device(struct spi_device *spi, | 223 | struct nci_spi *nci_spi_allocate_spi(struct spi_device *spi, |
| 236 | struct nci_spi_ops *ops, | 224 | u8 acknowledge_mode, unsigned int delay, |
| 237 | u32 supported_protocols, | 225 | struct nci_dev *ndev); |
| 238 | u32 supported_se, | 226 | int nci_spi_send(struct nci_spi *nspi, |
| 239 | u8 acknowledge_mode, | 227 | struct completion *write_handshake_completion, |
| 240 | unsigned int delay); | 228 | struct sk_buff *skb); |
| 241 | void nci_spi_free_device(struct nci_spi_dev *ndev); | 229 | struct sk_buff *nci_spi_read(struct nci_spi *nspi); |
| 242 | int nci_spi_register_device(struct nci_spi_dev *ndev); | ||
| 243 | void nci_spi_unregister_device(struct nci_spi_dev *ndev); | ||
| 244 | int nci_spi_recv_frame(struct nci_spi_dev *ndev); | ||
| 245 | |||
| 246 | static inline void nci_spi_set_drvdata(struct nci_spi_dev *ndev, | ||
| 247 | void *data) | ||
| 248 | { | ||
| 249 | ndev->driver_data = data; | ||
| 250 | } | ||
| 251 | |||
| 252 | static inline void *nci_spi_get_drvdata(struct nci_spi_dev *ndev) | ||
| 253 | { | ||
| 254 | return ndev->driver_data; | ||
| 255 | } | ||
| 256 | 230 | ||
| 257 | #endif /* __NCI_CORE_H */ | 231 | #endif /* __NCI_CORE_H */ |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index f68ee68e4e3e..82fc4e43fc6e 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -28,9 +28,14 @@ | |||
| 28 | #include <linux/device.h> | 28 | #include <linux/device.h> |
| 29 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
| 30 | 30 | ||
| 31 | #define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt "\n", ## arg) | 31 | #define nfc_info(dev, fmt, ...) dev_info((dev), "NFC: " fmt, ##__VA_ARGS__) |
| 32 | #define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "NFC: " fmt "\n", ## arg) | 32 | #define nfc_err(dev, fmt, ...) dev_err((dev), "NFC: " fmt, ##__VA_ARGS__) |
| 33 | #define nfc_dev_dbg(dev, fmt, arg...) dev_dbg((dev), fmt "\n", ## arg) | 33 | |
| 34 | struct nfc_phy_ops { | ||
| 35 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
| 36 | int (*enable)(void *dev_id); | ||
| 37 | void (*disable)(void *dev_id); | ||
| 38 | }; | ||
| 34 | 39 | ||
| 35 | struct nfc_dev; | 40 | struct nfc_dev; |
| 36 | 41 | ||
| @@ -48,6 +53,8 @@ struct nfc_dev; | |||
| 48 | typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb, | 53 | typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb, |
| 49 | int err); | 54 | int err); |
| 50 | 55 | ||
| 56 | typedef void (*se_io_cb_t)(void *context, u8 *apdu, size_t apdu_len, int err); | ||
| 57 | |||
| 51 | struct nfc_target; | 58 | struct nfc_target; |
| 52 | 59 | ||
| 53 | struct nfc_ops { | 60 | struct nfc_ops { |
| @@ -74,12 +81,23 @@ struct nfc_ops { | |||
| 74 | int (*discover_se)(struct nfc_dev *dev); | 81 | int (*discover_se)(struct nfc_dev *dev); |
| 75 | int (*enable_se)(struct nfc_dev *dev, u32 se_idx); | 82 | int (*enable_se)(struct nfc_dev *dev, u32 se_idx); |
| 76 | int (*disable_se)(struct nfc_dev *dev, u32 se_idx); | 83 | int (*disable_se)(struct nfc_dev *dev, u32 se_idx); |
| 84 | int (*se_io) (struct nfc_dev *dev, u32 se_idx, | ||
| 85 | u8 *apdu, size_t apdu_length, | ||
| 86 | se_io_cb_t cb, void *cb_context); | ||
| 77 | }; | 87 | }; |
| 78 | 88 | ||
| 79 | #define NFC_TARGET_IDX_ANY -1 | 89 | #define NFC_TARGET_IDX_ANY -1 |
| 80 | #define NFC_MAX_GT_LEN 48 | 90 | #define NFC_MAX_GT_LEN 48 |
| 81 | #define NFC_ATR_RES_GT_OFFSET 15 | 91 | #define NFC_ATR_RES_GT_OFFSET 15 |
| 82 | 92 | ||
| 93 | /** | ||
| 94 | * struct nfc_target - NFC target descriptiom | ||
| 95 | * | ||
| 96 | * @sens_res: 2 bytes describing the target SENS_RES response, if the target | ||
| 97 | * is a type A one. The %sens_res most significant byte must be byte 2 | ||
| 98 | * as described by the NFC Forum digital specification (i.e. the platform | ||
| 99 | * configuration one) while %sens_res least significant byte is byte 1. | ||
| 100 | */ | ||
| 83 | struct nfc_target { | 101 | struct nfc_target { |
| 84 | u32 idx; | 102 | u32 idx; |
| 85 | u32 supported_protocols; | 103 | u32 supported_protocols; |
| @@ -243,5 +261,6 @@ void nfc_driver_failure(struct nfc_dev *dev, int err); | |||
| 243 | 261 | ||
| 244 | int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); | 262 | int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); |
| 245 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); | 263 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); |
| 264 | struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); | ||
| 246 | 265 | ||
| 247 | #endif /* __NET_NFC_H */ | 266 | #endif /* __NET_NFC_H */ |
diff --git a/include/net/p8022.h b/include/net/p8022.h index 42e9fac51b31..05e41383856b 100644 --- a/include/net/p8022.h +++ b/include/net/p8022.h | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | #ifndef _NET_P8022_H | 1 | #ifndef _NET_P8022_H |
| 2 | #define _NET_P8022_H | 2 | #define _NET_P8022_H |
| 3 | extern struct datalink_proto * | 3 | struct datalink_proto * |
| 4 | register_8022_client(unsigned char type, | 4 | register_8022_client(unsigned char type, |
| 5 | int (*func)(struct sk_buff *skb, | 5 | int (*func)(struct sk_buff *skb, |
| 6 | struct net_device *dev, | 6 | struct net_device *dev, |
| 7 | struct packet_type *pt, | 7 | struct packet_type *pt, |
| 8 | struct net_device *orig_dev)); | 8 | struct net_device *orig_dev)); |
| 9 | extern void unregister_8022_client(struct datalink_proto *proto); | 9 | void unregister_8022_client(struct datalink_proto *proto); |
| 10 | 10 | ||
| 11 | extern struct datalink_proto *make_8023_client(void); | 11 | struct datalink_proto *make_8023_client(void); |
| 12 | extern void destroy_8023_client(struct datalink_proto *dl); | 12 | void destroy_8023_client(struct datalink_proto *dl); |
| 13 | #endif | 13 | #endif |
diff --git a/include/net/ping.h b/include/net/ping.h index 5db0224b73ac..3f67704f3747 100644 --- a/include/net/ping.h +++ b/include/net/ping.h | |||
| @@ -103,8 +103,8 @@ void ping_seq_stop(struct seq_file *seq, void *v); | |||
| 103 | int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo); | 103 | int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo); |
| 104 | void ping_proc_unregister(struct net *net, struct ping_seq_afinfo *afinfo); | 104 | void ping_proc_unregister(struct net *net, struct ping_seq_afinfo *afinfo); |
| 105 | 105 | ||
| 106 | extern int __init ping_proc_init(void); | 106 | int __init ping_proc_init(void); |
| 107 | extern void ping_proc_exit(void); | 107 | void ping_proc_exit(void); |
| 108 | #endif | 108 | #endif |
| 109 | 109 | ||
| 110 | void __init ping_init(void); | 110 | void __init ping_init(void); |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 047c0476c0a0..fbf7676c9a02 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
| @@ -96,20 +96,20 @@ extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS]; | |||
| 96 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | 96 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; |
| 97 | #endif | 97 | #endif |
| 98 | 98 | ||
| 99 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); | 99 | int inet_add_protocol(const struct net_protocol *prot, unsigned char num); |
| 100 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); | 100 | int inet_del_protocol(const struct net_protocol *prot, unsigned char num); |
| 101 | extern int inet_add_offload(const struct net_offload *prot, unsigned char num); | 101 | int inet_add_offload(const struct net_offload *prot, unsigned char num); |
| 102 | extern int inet_del_offload(const struct net_offload *prot, unsigned char num); | 102 | int inet_del_offload(const struct net_offload *prot, unsigned char num); |
| 103 | extern void inet_register_protosw(struct inet_protosw *p); | 103 | void inet_register_protosw(struct inet_protosw *p); |
| 104 | extern void inet_unregister_protosw(struct inet_protosw *p); | 104 | void inet_unregister_protosw(struct inet_protosw *p); |
| 105 | 105 | ||
| 106 | #if IS_ENABLED(CONFIG_IPV6) | 106 | #if IS_ENABLED(CONFIG_IPV6) |
| 107 | extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); | 107 | int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); |
| 108 | extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); | 108 | int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); |
| 109 | extern int inet6_register_protosw(struct inet_protosw *p); | 109 | int inet6_register_protosw(struct inet_protosw *p); |
| 110 | extern void inet6_unregister_protosw(struct inet_protosw *p); | 110 | void inet6_unregister_protosw(struct inet_protosw *p); |
| 111 | #endif | 111 | #endif |
| 112 | extern int inet6_add_offload(const struct net_offload *prot, unsigned char num); | 112 | int inet6_add_offload(const struct net_offload *prot, unsigned char num); |
| 113 | extern int inet6_del_offload(const struct net_offload *prot, unsigned char num); | 113 | int inet6_del_offload(const struct net_offload *prot, unsigned char num); |
| 114 | 114 | ||
| 115 | #endif /* _PROTOCOL_H */ | 115 | #endif /* _PROTOCOL_H */ |
diff --git a/include/net/psnap.h b/include/net/psnap.h index fe456c295b04..78db4cc1306a 100644 --- a/include/net/psnap.h +++ b/include/net/psnap.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | #ifndef _NET_PSNAP_H | 1 | #ifndef _NET_PSNAP_H |
| 2 | #define _NET_PSNAP_H | 2 | #define _NET_PSNAP_H |
| 3 | 3 | ||
| 4 | extern struct datalink_proto * | 4 | struct datalink_proto * |
| 5 | register_snap_client(const unsigned char *desc, | 5 | register_snap_client(const unsigned char *desc, |
| 6 | int (*rcvfunc)(struct sk_buff *, struct net_device *, | 6 | int (*rcvfunc)(struct sk_buff *, struct net_device *, |
| 7 | struct packet_type *, | 7 | struct packet_type *, |
| 8 | struct net_device *orig_dev)); | 8 | struct net_device *orig_dev)); |
| 9 | extern void unregister_snap_client(struct datalink_proto *proto); | 9 | void unregister_snap_client(struct datalink_proto *proto); |
| 10 | 10 | ||
| 11 | #endif | 11 | #endif |
diff --git a/include/net/raw.h b/include/net/raw.h index 42ce6fe7a2d5..6a40c6562dd2 100644 --- a/include/net/raw.h +++ b/include/net/raw.h | |||
| @@ -26,7 +26,7 @@ extern struct proto raw_prot; | |||
| 26 | void raw_icmp_error(struct sk_buff *, int, u32); | 26 | void raw_icmp_error(struct sk_buff *, int, u32); |
| 27 | int raw_local_deliver(struct sk_buff *, int); | 27 | int raw_local_deliver(struct sk_buff *, int); |
| 28 | 28 | ||
| 29 | extern int raw_rcv(struct sock *, struct sk_buff *); | 29 | int raw_rcv(struct sock *, struct sk_buff *); |
| 30 | 30 | ||
| 31 | #define RAW_HTABLE_SIZE MAX_INET_PROTOS | 31 | #define RAW_HTABLE_SIZE MAX_INET_PROTOS |
| 32 | 32 | ||
| @@ -36,8 +36,8 @@ struct raw_hashinfo { | |||
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | #ifdef CONFIG_PROC_FS | 38 | #ifdef CONFIG_PROC_FS |
| 39 | extern int raw_proc_init(void); | 39 | int raw_proc_init(void); |
| 40 | extern void raw_proc_exit(void); | 40 | void raw_proc_exit(void); |
| 41 | 41 | ||
| 42 | struct raw_iter_state { | 42 | struct raw_iter_state { |
| 43 | struct seq_net_private p; | 43 | struct seq_net_private p; |
diff --git a/include/net/rawv6.h b/include/net/rawv6.h index e7ea660e4db6..87783dea0791 100644 --- a/include/net/rawv6.h +++ b/include/net/rawv6.h | |||
| @@ -7,8 +7,7 @@ void raw6_icmp_error(struct sk_buff *, int nexthdr, | |||
| 7 | u8 type, u8 code, int inner_offset, __be32); | 7 | u8 type, u8 code, int inner_offset, __be32); |
| 8 | bool raw6_local_deliver(struct sk_buff *, int); | 8 | bool raw6_local_deliver(struct sk_buff *, int); |
| 9 | 9 | ||
| 10 | extern int rawv6_rcv(struct sock *sk, | 10 | int rawv6_rcv(struct sock *sk, struct sk_buff *skb); |
| 11 | struct sk_buff *skb); | ||
| 12 | 11 | ||
| 13 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 12 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
| 14 | int rawv6_mh_filter_register(int (*filter)(struct sock *sock, | 13 | int rawv6_mh_filter_register(int (*filter)(struct sock *sock, |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 59795e42c8b6..7f830ff67f08 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
| @@ -43,11 +43,12 @@ struct request_sock_ops { | |||
| 43 | struct request_sock *req); | 43 | struct request_sock *req); |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | extern int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req); | 46 | int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req); |
| 47 | 47 | ||
| 48 | /* struct request_sock - mini sock to represent a connection request | 48 | /* struct request_sock - mini sock to represent a connection request |
| 49 | */ | 49 | */ |
| 50 | struct request_sock { | 50 | struct request_sock { |
| 51 | struct sock_common __req_common; | ||
| 51 | struct request_sock *dl_next; | 52 | struct request_sock *dl_next; |
| 52 | u16 mss; | 53 | u16 mss; |
| 53 | u8 num_retrans; /* number of retransmits */ | 54 | u8 num_retrans; /* number of retransmits */ |
| @@ -162,13 +163,13 @@ struct request_sock_queue { | |||
| 162 | */ | 163 | */ |
| 163 | }; | 164 | }; |
| 164 | 165 | ||
| 165 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, | 166 | int reqsk_queue_alloc(struct request_sock_queue *queue, |
| 166 | unsigned int nr_table_entries); | 167 | unsigned int nr_table_entries); |
| 167 | 168 | ||
| 168 | extern void __reqsk_queue_destroy(struct request_sock_queue *queue); | 169 | void __reqsk_queue_destroy(struct request_sock_queue *queue); |
| 169 | extern void reqsk_queue_destroy(struct request_sock_queue *queue); | 170 | void reqsk_queue_destroy(struct request_sock_queue *queue); |
| 170 | extern void reqsk_fastopen_remove(struct sock *sk, | 171 | void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, |
| 171 | struct request_sock *req, bool reset); | 172 | bool reset); |
| 172 | 173 | ||
| 173 | static inline struct request_sock * | 174 | static inline struct request_sock * |
| 174 | reqsk_queue_yank_acceptq(struct request_sock_queue *queue) | 175 | reqsk_queue_yank_acceptq(struct request_sock_queue *queue) |
diff --git a/include/net/rose.h b/include/net/rose.h index 555dd198aab7..50811fe2c585 100644 --- a/include/net/rose.h +++ b/include/net/rose.h | |||
| @@ -160,38 +160,42 @@ extern int sysctl_rose_routing_control; | |||
| 160 | extern int sysctl_rose_link_fail_timeout; | 160 | extern int sysctl_rose_link_fail_timeout; |
| 161 | extern int sysctl_rose_maximum_vcs; | 161 | extern int sysctl_rose_maximum_vcs; |
| 162 | extern int sysctl_rose_window_size; | 162 | extern int sysctl_rose_window_size; |
| 163 | extern int rosecmp(rose_address *, rose_address *); | 163 | |
| 164 | extern int rosecmpm(rose_address *, rose_address *, unsigned short); | 164 | int rosecmp(rose_address *, rose_address *); |
| 165 | extern char *rose2asc(char *buf, const rose_address *); | 165 | int rosecmpm(rose_address *, rose_address *, unsigned short); |
| 166 | extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); | 166 | char *rose2asc(char *buf, const rose_address *); |
| 167 | extern void rose_kill_by_neigh(struct rose_neigh *); | 167 | struct sock *rose_find_socket(unsigned int, struct rose_neigh *); |
| 168 | extern unsigned int rose_new_lci(struct rose_neigh *); | 168 | void rose_kill_by_neigh(struct rose_neigh *); |
| 169 | extern int rose_rx_call_request(struct sk_buff *, struct net_device *, struct rose_neigh *, unsigned int); | 169 | unsigned int rose_new_lci(struct rose_neigh *); |
| 170 | extern void rose_destroy_socket(struct sock *); | 170 | int rose_rx_call_request(struct sk_buff *, struct net_device *, |
| 171 | struct rose_neigh *, unsigned int); | ||
| 172 | void rose_destroy_socket(struct sock *); | ||
| 171 | 173 | ||
| 172 | /* rose_dev.c */ | 174 | /* rose_dev.c */ |
| 173 | extern void rose_setup(struct net_device *); | 175 | void rose_setup(struct net_device *); |
| 174 | 176 | ||
| 175 | /* rose_in.c */ | 177 | /* rose_in.c */ |
| 176 | extern int rose_process_rx_frame(struct sock *, struct sk_buff *); | 178 | int rose_process_rx_frame(struct sock *, struct sk_buff *); |
| 177 | 179 | ||
| 178 | /* rose_link.c */ | 180 | /* rose_link.c */ |
| 179 | extern void rose_start_ftimer(struct rose_neigh *); | 181 | void rose_start_ftimer(struct rose_neigh *); |
| 180 | extern void rose_stop_ftimer(struct rose_neigh *); | 182 | void rose_stop_ftimer(struct rose_neigh *); |
| 181 | extern void rose_stop_t0timer(struct rose_neigh *); | 183 | void rose_stop_t0timer(struct rose_neigh *); |
| 182 | extern int rose_ftimer_running(struct rose_neigh *); | 184 | int rose_ftimer_running(struct rose_neigh *); |
| 183 | extern void rose_link_rx_restart(struct sk_buff *, struct rose_neigh *, unsigned short); | 185 | void rose_link_rx_restart(struct sk_buff *, struct rose_neigh *, |
| 184 | extern void rose_transmit_clear_request(struct rose_neigh *, unsigned int, unsigned char, unsigned char); | 186 | unsigned short); |
| 185 | extern void rose_transmit_link(struct sk_buff *, struct rose_neigh *); | 187 | void rose_transmit_clear_request(struct rose_neigh *, unsigned int, |
| 188 | unsigned char, unsigned char); | ||
| 189 | void rose_transmit_link(struct sk_buff *, struct rose_neigh *); | ||
| 186 | 190 | ||
| 187 | /* rose_loopback.c */ | 191 | /* rose_loopback.c */ |
| 188 | extern void rose_loopback_init(void); | 192 | void rose_loopback_init(void); |
| 189 | extern void rose_loopback_clear(void); | 193 | void rose_loopback_clear(void); |
| 190 | extern int rose_loopback_queue(struct sk_buff *, struct rose_neigh *); | 194 | int rose_loopback_queue(struct sk_buff *, struct rose_neigh *); |
| 191 | 195 | ||
| 192 | /* rose_out.c */ | 196 | /* rose_out.c */ |
| 193 | extern void rose_kick(struct sock *); | 197 | void rose_kick(struct sock *); |
| 194 | extern void rose_enquiry_response(struct sock *); | 198 | void rose_enquiry_response(struct sock *); |
| 195 | 199 | ||
| 196 | /* rose_route.c */ | 200 | /* rose_route.c */ |
| 197 | extern struct rose_neigh *rose_loopback_neigh; | 201 | extern struct rose_neigh *rose_loopback_neigh; |
| @@ -199,43 +203,45 @@ extern const struct file_operations rose_neigh_fops; | |||
| 199 | extern const struct file_operations rose_nodes_fops; | 203 | extern const struct file_operations rose_nodes_fops; |
| 200 | extern const struct file_operations rose_routes_fops; | 204 | extern const struct file_operations rose_routes_fops; |
| 201 | 205 | ||
| 202 | extern void rose_add_loopback_neigh(void); | 206 | void rose_add_loopback_neigh(void); |
| 203 | extern int __must_check rose_add_loopback_node(rose_address *); | 207 | int __must_check rose_add_loopback_node(rose_address *); |
| 204 | extern void rose_del_loopback_node(rose_address *); | 208 | void rose_del_loopback_node(rose_address *); |
| 205 | extern void rose_rt_device_down(struct net_device *); | 209 | void rose_rt_device_down(struct net_device *); |
| 206 | extern void rose_link_device_down(struct net_device *); | 210 | void rose_link_device_down(struct net_device *); |
| 207 | extern struct net_device *rose_dev_first(void); | 211 | struct net_device *rose_dev_first(void); |
| 208 | extern struct net_device *rose_dev_get(rose_address *); | 212 | struct net_device *rose_dev_get(rose_address *); |
| 209 | extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); | 213 | struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); |
| 210 | extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *, int); | 214 | struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, |
| 211 | extern int rose_rt_ioctl(unsigned int, void __user *); | 215 | unsigned char *, int); |
| 212 | extern void rose_link_failed(ax25_cb *, int); | 216 | int rose_rt_ioctl(unsigned int, void __user *); |
| 213 | extern int rose_route_frame(struct sk_buff *, ax25_cb *); | 217 | void rose_link_failed(ax25_cb *, int); |
| 214 | extern void rose_rt_free(void); | 218 | int rose_route_frame(struct sk_buff *, ax25_cb *); |
| 219 | void rose_rt_free(void); | ||
| 215 | 220 | ||
| 216 | /* rose_subr.c */ | 221 | /* rose_subr.c */ |
| 217 | extern void rose_clear_queues(struct sock *); | 222 | void rose_clear_queues(struct sock *); |
| 218 | extern void rose_frames_acked(struct sock *, unsigned short); | 223 | void rose_frames_acked(struct sock *, unsigned short); |
| 219 | extern void rose_requeue_frames(struct sock *); | 224 | void rose_requeue_frames(struct sock *); |
| 220 | extern int rose_validate_nr(struct sock *, unsigned short); | 225 | int rose_validate_nr(struct sock *, unsigned short); |
| 221 | extern void rose_write_internal(struct sock *, int); | 226 | void rose_write_internal(struct sock *, int); |
| 222 | extern int rose_decode(struct sk_buff *, int *, int *, int *, int *, int *); | 227 | int rose_decode(struct sk_buff *, int *, int *, int *, int *, int *); |
| 223 | extern int rose_parse_facilities(unsigned char *, unsigned int, struct rose_facilities_struct *); | 228 | int rose_parse_facilities(unsigned char *, unsigned int, |
| 224 | extern void rose_disconnect(struct sock *, int, int, int); | 229 | struct rose_facilities_struct *); |
| 230 | void rose_disconnect(struct sock *, int, int, int); | ||
| 225 | 231 | ||
| 226 | /* rose_timer.c */ | 232 | /* rose_timer.c */ |
| 227 | extern void rose_start_heartbeat(struct sock *); | 233 | void rose_start_heartbeat(struct sock *); |
| 228 | extern void rose_start_t1timer(struct sock *); | 234 | void rose_start_t1timer(struct sock *); |
| 229 | extern void rose_start_t2timer(struct sock *); | 235 | void rose_start_t2timer(struct sock *); |
| 230 | extern void rose_start_t3timer(struct sock *); | 236 | void rose_start_t3timer(struct sock *); |
| 231 | extern void rose_start_hbtimer(struct sock *); | 237 | void rose_start_hbtimer(struct sock *); |
| 232 | extern void rose_start_idletimer(struct sock *); | 238 | void rose_start_idletimer(struct sock *); |
| 233 | extern void rose_stop_heartbeat(struct sock *); | 239 | void rose_stop_heartbeat(struct sock *); |
| 234 | extern void rose_stop_timer(struct sock *); | 240 | void rose_stop_timer(struct sock *); |
| 235 | extern void rose_stop_idletimer(struct sock *); | 241 | void rose_stop_idletimer(struct sock *); |
| 236 | 242 | ||
| 237 | /* sysctl_net_rose.c */ | 243 | /* sysctl_net_rose.c */ |
| 238 | extern void rose_register_sysctl(void); | 244 | void rose_register_sysctl(void); |
| 239 | extern void rose_unregister_sysctl(void); | 245 | void rose_unregister_sysctl(void); |
| 240 | 246 | ||
| 241 | #endif | 247 | #endif |
diff --git a/include/net/route.h b/include/net/route.h index afdeeb5bec25..f68c167280a7 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #define RTO_ONLINK 0x01 | 39 | #define RTO_ONLINK 0x01 |
| 40 | 40 | ||
| 41 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) | 41 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) |
| 42 | #define RT_CONN_FLAGS_TOS(sk,tos) (RT_TOS(tos) | sock_flag(sk, SOCK_LOCALROUTE)) | ||
| 42 | 43 | ||
| 43 | struct fib_nh; | 44 | struct fib_nh; |
| 44 | struct fib_info; | 45 | struct fib_info; |
| @@ -87,34 +88,28 @@ struct ip_rt_acct { | |||
| 87 | }; | 88 | }; |
| 88 | 89 | ||
| 89 | struct rt_cache_stat { | 90 | struct rt_cache_stat { |
| 90 | unsigned int in_hit; | ||
| 91 | unsigned int in_slow_tot; | 91 | unsigned int in_slow_tot; |
| 92 | unsigned int in_slow_mc; | 92 | unsigned int in_slow_mc; |
| 93 | unsigned int in_no_route; | 93 | unsigned int in_no_route; |
| 94 | unsigned int in_brd; | 94 | unsigned int in_brd; |
| 95 | unsigned int in_martian_dst; | 95 | unsigned int in_martian_dst; |
| 96 | unsigned int in_martian_src; | 96 | unsigned int in_martian_src; |
| 97 | unsigned int out_hit; | ||
| 98 | unsigned int out_slow_tot; | 97 | unsigned int out_slow_tot; |
| 99 | unsigned int out_slow_mc; | 98 | unsigned int out_slow_mc; |
| 100 | unsigned int gc_total; | ||
| 101 | unsigned int gc_ignored; | ||
| 102 | unsigned int gc_goal_miss; | ||
| 103 | unsigned int gc_dst_overflow; | ||
| 104 | unsigned int in_hlist_search; | ||
| 105 | unsigned int out_hlist_search; | ||
| 106 | }; | 99 | }; |
| 107 | 100 | ||
| 108 | extern struct ip_rt_acct __percpu *ip_rt_acct; | 101 | extern struct ip_rt_acct __percpu *ip_rt_acct; |
| 109 | 102 | ||
| 110 | struct in_device; | 103 | struct in_device; |
| 111 | extern int ip_rt_init(void); | 104 | |
| 112 | extern void rt_cache_flush(struct net *net); | 105 | int ip_rt_init(void); |
| 113 | extern void rt_flush_dev(struct net_device *dev); | 106 | void rt_cache_flush(struct net *net); |
| 114 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); | 107 | void rt_flush_dev(struct net_device *dev); |
| 115 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, | 108 | struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); |
| 116 | struct sock *sk); | 109 | struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, |
| 117 | extern struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig); | 110 | struct sock *sk); |
| 111 | struct dst_entry *ipv4_blackhole_route(struct net *net, | ||
| 112 | struct dst_entry *dst_orig); | ||
| 118 | 113 | ||
| 119 | static inline struct rtable *ip_route_output_key(struct net *net, struct flowi4 *flp) | 114 | static inline struct rtable *ip_route_output_key(struct net *net, struct flowi4 *flp) |
| 120 | { | 115 | { |
| @@ -162,8 +157,8 @@ static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 | |||
| 162 | return ip_route_output_key(net, fl4); | 157 | return ip_route_output_key(net, fl4); |
| 163 | } | 158 | } |
| 164 | 159 | ||
| 165 | extern int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, | 160 | int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, |
| 166 | u8 tos, struct net_device *devin); | 161 | u8 tos, struct net_device *devin); |
| 167 | 162 | ||
| 168 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | 163 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, |
| 169 | u8 tos, struct net_device *devin) | 164 | u8 tos, struct net_device *devin) |
| @@ -179,24 +174,25 @@ static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | |||
| 179 | return err; | 174 | return err; |
| 180 | } | 175 | } |
| 181 | 176 | ||
| 182 | extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, | 177 | void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, int oif, |
| 183 | int oif, u32 mark, u8 protocol, int flow_flags); | 178 | u32 mark, u8 protocol, int flow_flags); |
| 184 | extern void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu); | 179 | void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu); |
| 185 | extern void ipv4_redirect(struct sk_buff *skb, struct net *net, | 180 | void ipv4_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark, |
| 186 | int oif, u32 mark, u8 protocol, int flow_flags); | 181 | u8 protocol, int flow_flags); |
| 187 | extern void ipv4_sk_redirect(struct sk_buff *skb, struct sock *sk); | 182 | void ipv4_sk_redirect(struct sk_buff *skb, struct sock *sk); |
| 188 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 183 | void ip_rt_send_redirect(struct sk_buff *skb); |
| 189 | 184 | ||
| 190 | extern unsigned int inet_addr_type(struct net *net, __be32 addr); | 185 | unsigned int inet_addr_type(struct net *net, __be32 addr); |
| 191 | extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); | 186 | unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, |
| 192 | extern void ip_rt_multicast_event(struct in_device *); | 187 | __be32 addr); |
| 193 | extern int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); | 188 | void ip_rt_multicast_event(struct in_device *); |
| 194 | extern void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); | 189 | int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); |
| 195 | extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); | 190 | void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); |
| 191 | int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); | ||
| 196 | 192 | ||
| 197 | struct in_ifaddr; | 193 | struct in_ifaddr; |
| 198 | extern void fib_add_ifaddr(struct in_ifaddr *); | 194 | void fib_add_ifaddr(struct in_ifaddr *); |
| 199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); | 195 | void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); |
| 200 | 196 | ||
| 201 | static inline void ip_rt_put(struct rtable *rt) | 197 | static inline void ip_rt_put(struct rtable *rt) |
| 202 | { | 198 | { |
| @@ -317,12 +313,20 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | |||
| 317 | return hoplimit; | 313 | return hoplimit; |
| 318 | } | 314 | } |
| 319 | 315 | ||
| 320 | static inline int ip_skb_dst_mtu(struct sk_buff *skb) | 316 | static inline bool ip_sk_accept_pmtu(const struct sock *sk) |
| 317 | { | ||
| 318 | return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE; | ||
| 319 | } | ||
| 320 | |||
| 321 | static inline bool ip_sk_use_pmtu(const struct sock *sk) | ||
| 321 | { | 322 | { |
| 322 | struct inet_sock *inet = skb->sk ? inet_sk(skb->sk) : NULL; | 323 | return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; |
| 324 | } | ||
| 323 | 325 | ||
| 324 | return (inet && inet->pmtudisc == IP_PMTUDISC_PROBE) ? | 326 | static inline int ip_skb_dst_mtu(const struct sk_buff *skb) |
| 325 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 327 | { |
| 328 | return (!skb->sk || ip_sk_use_pmtu(skb->sk)) ? | ||
| 329 | dst_mtu(skb_dst(skb)) : skb_dst(skb)->dev->mtu; | ||
| 326 | } | 330 | } |
| 327 | 331 | ||
| 328 | #endif /* _ROUTE_H */ | 332 | #endif /* _ROUTE_H */ |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 702664833a53..bb13a182fba6 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -8,14 +8,12 @@ typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *); | |||
| 8 | typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); | 8 | typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); |
| 9 | typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *); | 9 | typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *); |
| 10 | 10 | ||
| 11 | extern int __rtnl_register(int protocol, int msgtype, | 11 | int __rtnl_register(int protocol, int msgtype, |
| 12 | rtnl_doit_func, rtnl_dumpit_func, | 12 | rtnl_doit_func, rtnl_dumpit_func, rtnl_calcit_func); |
| 13 | rtnl_calcit_func); | 13 | void rtnl_register(int protocol, int msgtype, |
| 14 | extern void rtnl_register(int protocol, int msgtype, | 14 | rtnl_doit_func, rtnl_dumpit_func, rtnl_calcit_func); |
| 15 | rtnl_doit_func, rtnl_dumpit_func, | 15 | int rtnl_unregister(int protocol, int msgtype); |
| 16 | rtnl_calcit_func); | 16 | void rtnl_unregister_all(int protocol); |
| 17 | extern int rtnl_unregister(int protocol, int msgtype); | ||
| 18 | extern void rtnl_unregister_all(int protocol); | ||
| 19 | 17 | ||
| 20 | static inline int rtnl_msg_family(const struct nlmsghdr *nlh) | 18 | static inline int rtnl_msg_family(const struct nlmsghdr *nlh) |
| 21 | { | 19 | { |
| @@ -83,11 +81,11 @@ struct rtnl_link_ops { | |||
| 83 | unsigned int (*get_num_rx_queues)(void); | 81 | unsigned int (*get_num_rx_queues)(void); |
| 84 | }; | 82 | }; |
| 85 | 83 | ||
| 86 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); | 84 | int __rtnl_link_register(struct rtnl_link_ops *ops); |
| 87 | extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); | 85 | void __rtnl_link_unregister(struct rtnl_link_ops *ops); |
| 88 | 86 | ||
| 89 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | 87 | int rtnl_link_register(struct rtnl_link_ops *ops); |
| 90 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | 88 | void rtnl_link_unregister(struct rtnl_link_ops *ops); |
| 91 | 89 | ||
| 92 | /** | 90 | /** |
| 93 | * struct rtnl_af_ops - rtnetlink address family operations | 91 | * struct rtnl_af_ops - rtnetlink address family operations |
| @@ -117,18 +115,18 @@ struct rtnl_af_ops { | |||
| 117 | const struct nlattr *attr); | 115 | const struct nlattr *attr); |
| 118 | }; | 116 | }; |
| 119 | 117 | ||
| 120 | extern int __rtnl_af_register(struct rtnl_af_ops *ops); | 118 | int __rtnl_af_register(struct rtnl_af_ops *ops); |
| 121 | extern void __rtnl_af_unregister(struct rtnl_af_ops *ops); | 119 | void __rtnl_af_unregister(struct rtnl_af_ops *ops); |
| 122 | 120 | ||
| 123 | extern int rtnl_af_register(struct rtnl_af_ops *ops); | 121 | int rtnl_af_register(struct rtnl_af_ops *ops); |
| 124 | extern void rtnl_af_unregister(struct rtnl_af_ops *ops); | 122 | void rtnl_af_unregister(struct rtnl_af_ops *ops); |
| 125 | 123 | ||
| 124 | struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); | ||
| 125 | struct net_device *rtnl_create_link(struct net *net, char *ifname, | ||
| 126 | const struct rtnl_link_ops *ops, | ||
| 127 | struct nlattr *tb[]); | ||
| 128 | int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm); | ||
| 126 | 129 | ||
| 127 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); | ||
| 128 | extern struct net_device *rtnl_create_link(struct net *net, | ||
| 129 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); | ||
| 130 | extern int rtnl_configure_link(struct net_device *dev, | ||
| 131 | const struct ifinfomsg *ifm); | ||
| 132 | extern const struct nla_policy ifla_policy[IFLA_MAX+1]; | 130 | extern const struct nla_policy ifla_policy[IFLA_MAX+1]; |
| 133 | 131 | ||
| 134 | #define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) | 132 | #define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f4eb365f7dcd..d0a6321c302e 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -702,13 +702,20 @@ static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, | |||
| 702 | } | 702 | } |
| 703 | 703 | ||
| 704 | void psched_ratecfg_precompute(struct psched_ratecfg *r, | 704 | void psched_ratecfg_precompute(struct psched_ratecfg *r, |
| 705 | const struct tc_ratespec *conf); | 705 | const struct tc_ratespec *conf, |
| 706 | u64 rate64); | ||
| 706 | 707 | ||
| 707 | static inline void psched_ratecfg_getrate(struct tc_ratespec *res, | 708 | static inline void psched_ratecfg_getrate(struct tc_ratespec *res, |
| 708 | const struct psched_ratecfg *r) | 709 | const struct psched_ratecfg *r) |
| 709 | { | 710 | { |
| 710 | memset(res, 0, sizeof(*res)); | 711 | memset(res, 0, sizeof(*res)); |
| 711 | res->rate = r->rate_bytes_ps; | 712 | |
| 713 | /* legacy struct tc_ratespec has a 32bit @rate field | ||
| 714 | * Qdisc using 64bit rate should add new attributes | ||
| 715 | * in order to maintain compatibility. | ||
| 716 | */ | ||
| 717 | res->rate = min_t(u64, r->rate_bytes_ps, ~0U); | ||
| 718 | |||
| 712 | res->overhead = r->overhead; | 719 | res->overhead = r->overhead; |
| 713 | res->linklayer = (r->linklayer & TC_LINKLAYER_MASK); | 720 | res->linklayer = (r->linklayer & TC_LINKLAYER_MASK); |
| 714 | } | 721 | } |
diff --git a/include/net/scm.h b/include/net/scm.h index 8de2d37d2077..262532d111f5 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
| @@ -33,11 +33,11 @@ struct scm_cookie { | |||
| 33 | #endif | 33 | #endif |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | extern void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm); | 36 | void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm); |
| 37 | extern void scm_detach_fds_compat(struct msghdr *msg, struct scm_cookie *scm); | 37 | void scm_detach_fds_compat(struct msghdr *msg, struct scm_cookie *scm); |
| 38 | extern int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm); | 38 | int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm); |
| 39 | extern void __scm_destroy(struct scm_cookie *scm); | 39 | void __scm_destroy(struct scm_cookie *scm); |
| 40 | extern struct scm_fp_list * scm_fp_dup(struct scm_fp_list *fpl); | 40 | struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl); |
| 41 | 41 | ||
| 42 | #ifdef CONFIG_SECURITY_NETWORK | 42 | #ifdef CONFIG_SECURITY_NETWORK |
| 43 | static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm) | 43 | static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm) |
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h index 259924d63ba6..6bd44fe94c26 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
| @@ -42,56 +42,38 @@ | |||
| 42 | #include <linux/types.h> | 42 | #include <linux/types.h> |
| 43 | #include <net/sctp/sctp.h> | 43 | #include <net/sctp/sctp.h> |
| 44 | #include <linux/crc32c.h> | 44 | #include <linux/crc32c.h> |
| 45 | #include <linux/crc32.h> | ||
| 45 | 46 | ||
| 46 | static inline __u32 sctp_crc32c(__u32 crc, u8 *buffer, u16 length) | 47 | static inline __wsum sctp_csum_update(const void *buff, int len, __wsum sum) |
| 47 | { | 48 | { |
| 48 | return crc32c(crc, buffer, length); | 49 | /* This uses the crypto implementation of crc32c, which is either |
| 49 | } | 50 | * implemented w/ hardware support or resolves to __crc32c_le(). |
| 50 | |||
| 51 | static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length) | ||
| 52 | { | ||
| 53 | __u32 crc = ~(__u32)0; | ||
| 54 | __u8 zero[sizeof(__u32)] = {0}; | ||
| 55 | |||
| 56 | /* Optimize this routine to be SCTP specific, knowing how | ||
| 57 | * to skip the checksum field of the SCTP header. | ||
| 58 | */ | 51 | */ |
| 59 | 52 | return crc32c(sum, buff, len); | |
| 60 | /* Calculate CRC up to the checksum. */ | ||
| 61 | crc = sctp_crc32c(crc, buffer, sizeof(struct sctphdr) - sizeof(__u32)); | ||
| 62 | |||
| 63 | /* Skip checksum field of the header. */ | ||
| 64 | crc = sctp_crc32c(crc, zero, sizeof(__u32)); | ||
| 65 | |||
| 66 | /* Calculate the rest of the CRC. */ | ||
| 67 | crc = sctp_crc32c(crc, &buffer[sizeof(struct sctphdr)], | ||
| 68 | length - sizeof(struct sctphdr)); | ||
| 69 | return crc; | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32) | ||
| 73 | { | ||
| 74 | return sctp_crc32c(crc32, buffer, length); | ||
| 75 | } | 53 | } |
| 76 | 54 | ||
| 77 | static inline __le32 sctp_end_cksum(__u32 crc32) | 55 | static inline __wsum sctp_csum_combine(__wsum csum, __wsum csum2, |
| 56 | int offset, int len) | ||
| 78 | { | 57 | { |
| 79 | return cpu_to_le32(~crc32); | 58 | return __crc32c_le_combine(csum, csum2, len); |
| 80 | } | 59 | } |
| 81 | 60 | ||
| 82 | /* Calculate the CRC32C checksum of an SCTP packet. */ | ||
| 83 | static inline __le32 sctp_compute_cksum(const struct sk_buff *skb, | 61 | static inline __le32 sctp_compute_cksum(const struct sk_buff *skb, |
| 84 | unsigned int offset) | 62 | unsigned int offset) |
| 85 | { | 63 | { |
| 86 | const struct sk_buff *iter; | 64 | struct sctphdr *sh = sctp_hdr(skb); |
| 65 | __le32 ret, old = sh->checksum; | ||
| 66 | const struct skb_checksum_ops ops = { | ||
| 67 | .update = sctp_csum_update, | ||
| 68 | .combine = sctp_csum_combine, | ||
| 69 | }; | ||
| 87 | 70 | ||
| 88 | __u32 crc32 = sctp_start_cksum(skb->data + offset, | 71 | sh->checksum = 0; |
| 89 | skb_headlen(skb) - offset); | 72 | ret = cpu_to_le32(~__skb_checksum(skb, offset, skb->len - offset, |
| 90 | skb_walk_frags(skb, iter) | 73 | ~(__u32)0, &ops)); |
| 91 | crc32 = sctp_update_cksum((__u8 *) iter->data, | 74 | sh->checksum = old; |
| 92 | skb_headlen(iter), crc32); | ||
| 93 | 75 | ||
| 94 | return sctp_end_cksum(crc32); | 76 | return ret; |
| 95 | } | 77 | } |
| 96 | 78 | ||
| 97 | #endif /* __sctp_checksum_h__ */ | 79 | #endif /* __sctp_checksum_h__ */ |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 3794c5ad20fe..c5fe80697f8d 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -90,12 +90,11 @@ | |||
| 90 | /* | 90 | /* |
| 91 | * sctp/protocol.c | 91 | * sctp/protocol.c |
| 92 | */ | 92 | */ |
| 93 | extern int sctp_copy_local_addr_list(struct net *, struct sctp_bind_addr *, | 93 | int sctp_copy_local_addr_list(struct net *, struct sctp_bind_addr *, |
| 94 | sctp_scope_t, gfp_t gfp, | 94 | sctp_scope_t, gfp_t gfp, int flags); |
| 95 | int flags); | 95 | struct sctp_pf *sctp_get_pf_specific(sa_family_t family); |
| 96 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); | 96 | int sctp_register_pf(struct sctp_pf *, sa_family_t); |
| 97 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | 97 | void sctp_addr_wq_mgmt(struct net *, struct sctp_sockaddr_entry *, int); |
| 98 | extern void sctp_addr_wq_mgmt(struct net *, struct sctp_sockaddr_entry *, int); | ||
| 99 | 98 | ||
| 100 | /* | 99 | /* |
| 101 | * sctp/socket.c | 100 | * sctp/socket.c |
| @@ -110,7 +109,7 @@ void sctp_sock_rfree(struct sk_buff *skb); | |||
| 110 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, | 109 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, |
| 111 | struct sctp_association *asoc); | 110 | struct sctp_association *asoc); |
| 112 | extern struct percpu_counter sctp_sockets_allocated; | 111 | extern struct percpu_counter sctp_sockets_allocated; |
| 113 | extern int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); | 112 | int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); |
| 114 | 113 | ||
| 115 | /* | 114 | /* |
| 116 | * sctp/primitive.c | 115 | * sctp/primitive.c |
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h index c2e542b27a5a..f257486f17be 100644 --- a/include/net/secure_seq.h +++ b/include/net/secure_seq.h | |||
| @@ -3,18 +3,18 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | extern __u32 secure_ip_id(__be32 daddr); | 6 | __u32 secure_ip_id(__be32 daddr); |
| 7 | extern __u32 secure_ipv6_id(const __be32 daddr[4]); | 7 | __u32 secure_ipv6_id(const __be32 daddr[4]); |
| 8 | extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); | 8 | u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); |
| 9 | extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, | 9 | u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
| 10 | __be16 dport); | 10 | __be16 dport); |
| 11 | extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, | 11 | __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, |
| 12 | __be16 sport, __be16 dport); | 12 | __be16 sport, __be16 dport); |
| 13 | extern __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, | 13 | __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, |
| 14 | __be16 sport, __be16 dport); | 14 | __be16 sport, __be16 dport); |
| 15 | extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, | 15 | u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, |
| 16 | __be16 sport, __be16 dport); | 16 | __be16 sport, __be16 dport); |
| 17 | extern u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, | 17 | u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, |
| 18 | __be16 sport, __be16 dport); | 18 | __be16 sport, __be16 dport); |
| 19 | 19 | ||
| 20 | #endif /* _NET_SECURE_SEQ */ | 20 | #endif /* _NET_SECURE_SEQ */ |
diff --git a/include/net/sock.h b/include/net/sock.h index 808cbc2ec6c1..e3a18ff0c38b 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -156,7 +156,7 @@ typedef __u64 __bitwise __addrpair; | |||
| 156 | */ | 156 | */ |
| 157 | struct sock_common { | 157 | struct sock_common { |
| 158 | /* skc_daddr and skc_rcv_saddr must be grouped on a 8 bytes aligned | 158 | /* skc_daddr and skc_rcv_saddr must be grouped on a 8 bytes aligned |
| 159 | * address on 64bit arches : cf INET_MATCH() and INET_TW_MATCH() | 159 | * address on 64bit arches : cf INET_MATCH() |
| 160 | */ | 160 | */ |
| 161 | union { | 161 | union { |
| 162 | __addrpair skc_addrpair; | 162 | __addrpair skc_addrpair; |
| @@ -191,6 +191,12 @@ struct sock_common { | |||
| 191 | #ifdef CONFIG_NET_NS | 191 | #ifdef CONFIG_NET_NS |
| 192 | struct net *skc_net; | 192 | struct net *skc_net; |
| 193 | #endif | 193 | #endif |
| 194 | |||
| 195 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 196 | struct in6_addr skc_v6_daddr; | ||
| 197 | struct in6_addr skc_v6_rcv_saddr; | ||
| 198 | #endif | ||
| 199 | |||
| 194 | /* | 200 | /* |
| 195 | * fields between dontcopy_begin/dontcopy_end | 201 | * fields between dontcopy_begin/dontcopy_end |
| 196 | * are not copied in sock_copy() | 202 | * are not copied in sock_copy() |
| @@ -218,7 +224,7 @@ struct cg_proto; | |||
| 218 | * @sk_lock: synchronizer | 224 | * @sk_lock: synchronizer |
| 219 | * @sk_rcvbuf: size of receive buffer in bytes | 225 | * @sk_rcvbuf: size of receive buffer in bytes |
| 220 | * @sk_wq: sock wait queue and async head | 226 | * @sk_wq: sock wait queue and async head |
| 221 | * @sk_rx_dst: receive input route used by early tcp demux | 227 | * @sk_rx_dst: receive input route used by early demux |
| 222 | * @sk_dst_cache: destination cache | 228 | * @sk_dst_cache: destination cache |
| 223 | * @sk_dst_lock: destination cache lock | 229 | * @sk_dst_lock: destination cache lock |
| 224 | * @sk_policy: flow policy | 230 | * @sk_policy: flow policy |
| @@ -233,6 +239,7 @@ struct cg_proto; | |||
| 233 | * @sk_ll_usec: usecs to busypoll when there is no data | 239 | * @sk_ll_usec: usecs to busypoll when there is no data |
| 234 | * @sk_allocation: allocation mode | 240 | * @sk_allocation: allocation mode |
| 235 | * @sk_pacing_rate: Pacing rate (if supported by transport/packet scheduler) | 241 | * @sk_pacing_rate: Pacing rate (if supported by transport/packet scheduler) |
| 242 | * @sk_max_pacing_rate: Maximum pacing rate (%SO_MAX_PACING_RATE) | ||
| 236 | * @sk_sndbuf: size of send buffer in bytes | 243 | * @sk_sndbuf: size of send buffer in bytes |
| 237 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, | 244 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, |
| 238 | * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings | 245 | * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings |
| @@ -299,6 +306,12 @@ struct sock { | |||
| 299 | #define sk_dontcopy_begin __sk_common.skc_dontcopy_begin | 306 | #define sk_dontcopy_begin __sk_common.skc_dontcopy_begin |
| 300 | #define sk_dontcopy_end __sk_common.skc_dontcopy_end | 307 | #define sk_dontcopy_end __sk_common.skc_dontcopy_end |
| 301 | #define sk_hash __sk_common.skc_hash | 308 | #define sk_hash __sk_common.skc_hash |
| 309 | #define sk_portpair __sk_common.skc_portpair | ||
| 310 | #define sk_num __sk_common.skc_num | ||
| 311 | #define sk_dport __sk_common.skc_dport | ||
| 312 | #define sk_addrpair __sk_common.skc_addrpair | ||
| 313 | #define sk_daddr __sk_common.skc_daddr | ||
| 314 | #define sk_rcv_saddr __sk_common.skc_rcv_saddr | ||
| 302 | #define sk_family __sk_common.skc_family | 315 | #define sk_family __sk_common.skc_family |
| 303 | #define sk_state __sk_common.skc_state | 316 | #define sk_state __sk_common.skc_state |
| 304 | #define sk_reuse __sk_common.skc_reuse | 317 | #define sk_reuse __sk_common.skc_reuse |
| @@ -307,6 +320,9 @@ struct sock { | |||
| 307 | #define sk_bind_node __sk_common.skc_bind_node | 320 | #define sk_bind_node __sk_common.skc_bind_node |
| 308 | #define sk_prot __sk_common.skc_prot | 321 | #define sk_prot __sk_common.skc_prot |
| 309 | #define sk_net __sk_common.skc_net | 322 | #define sk_net __sk_common.skc_net |
| 323 | #define sk_v6_daddr __sk_common.skc_v6_daddr | ||
| 324 | #define sk_v6_rcv_saddr __sk_common.skc_v6_rcv_saddr | ||
| 325 | |||
| 310 | socket_lock_t sk_lock; | 326 | socket_lock_t sk_lock; |
| 311 | struct sk_buff_head sk_receive_queue; | 327 | struct sk_buff_head sk_receive_queue; |
| 312 | /* | 328 | /* |
| @@ -363,6 +379,7 @@ struct sock { | |||
| 363 | int sk_wmem_queued; | 379 | int sk_wmem_queued; |
| 364 | gfp_t sk_allocation; | 380 | gfp_t sk_allocation; |
| 365 | u32 sk_pacing_rate; /* bytes per second */ | 381 | u32 sk_pacing_rate; /* bytes per second */ |
| 382 | u32 sk_max_pacing_rate; | ||
| 366 | netdev_features_t sk_route_caps; | 383 | netdev_features_t sk_route_caps; |
| 367 | netdev_features_t sk_route_nocaps; | 384 | netdev_features_t sk_route_nocaps; |
| 368 | int sk_gso_type; | 385 | int sk_gso_type; |
| @@ -751,7 +768,7 @@ static inline int sk_stream_wspace(const struct sock *sk) | |||
| 751 | return sk->sk_sndbuf - sk->sk_wmem_queued; | 768 | return sk->sk_sndbuf - sk->sk_wmem_queued; |
| 752 | } | 769 | } |
| 753 | 770 | ||
| 754 | extern void sk_stream_write_space(struct sock *sk); | 771 | void sk_stream_write_space(struct sock *sk); |
| 755 | 772 | ||
| 756 | /* OOB backlog add */ | 773 | /* OOB backlog add */ |
| 757 | static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) | 774 | static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) |
| @@ -793,7 +810,7 @@ static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *s | |||
| 793 | return 0; | 810 | return 0; |
| 794 | } | 811 | } |
| 795 | 812 | ||
| 796 | extern int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb); | 813 | int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb); |
| 797 | 814 | ||
| 798 | static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) | 815 | static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) |
| 799 | { | 816 | { |
| @@ -858,15 +875,15 @@ static inline void sock_rps_reset_rxhash(struct sock *sk) | |||
| 858 | __rc; \ | 875 | __rc; \ |
| 859 | }) | 876 | }) |
| 860 | 877 | ||
| 861 | extern int sk_stream_wait_connect(struct sock *sk, long *timeo_p); | 878 | int sk_stream_wait_connect(struct sock *sk, long *timeo_p); |
| 862 | extern int sk_stream_wait_memory(struct sock *sk, long *timeo_p); | 879 | int sk_stream_wait_memory(struct sock *sk, long *timeo_p); |
| 863 | extern void sk_stream_wait_close(struct sock *sk, long timeo_p); | 880 | void sk_stream_wait_close(struct sock *sk, long timeo_p); |
| 864 | extern int sk_stream_error(struct sock *sk, int flags, int err); | 881 | int sk_stream_error(struct sock *sk, int flags, int err); |
| 865 | extern void sk_stream_kill_queues(struct sock *sk); | 882 | void sk_stream_kill_queues(struct sock *sk); |
| 866 | extern void sk_set_memalloc(struct sock *sk); | 883 | void sk_set_memalloc(struct sock *sk); |
| 867 | extern void sk_clear_memalloc(struct sock *sk); | 884 | void sk_clear_memalloc(struct sock *sk); |
| 868 | 885 | ||
| 869 | extern int sk_wait_data(struct sock *sk, long *timeo); | 886 | int sk_wait_data(struct sock *sk, long *timeo); |
| 870 | 887 | ||
| 871 | struct request_sock_ops; | 888 | struct request_sock_ops; |
| 872 | struct timewait_sock_ops; | 889 | struct timewait_sock_ops; |
| @@ -1019,10 +1036,10 @@ enum cg_proto_flags { | |||
| 1019 | 1036 | ||
| 1020 | struct cg_proto { | 1037 | struct cg_proto { |
| 1021 | void (*enter_memory_pressure)(struct sock *sk); | 1038 | void (*enter_memory_pressure)(struct sock *sk); |
| 1022 | struct res_counter *memory_allocated; /* Current allocated memory. */ | 1039 | struct res_counter memory_allocated; /* Current allocated memory. */ |
| 1023 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ | 1040 | struct percpu_counter sockets_allocated; /* Current number of sockets. */ |
| 1024 | int *memory_pressure; | 1041 | int memory_pressure; |
| 1025 | long *sysctl_mem; | 1042 | long sysctl_mem[3]; |
| 1026 | unsigned long flags; | 1043 | unsigned long flags; |
| 1027 | /* | 1044 | /* |
| 1028 | * memcg field is used to find which memcg we belong directly | 1045 | * memcg field is used to find which memcg we belong directly |
| @@ -1036,8 +1053,8 @@ struct cg_proto { | |||
| 1036 | struct mem_cgroup *memcg; | 1053 | struct mem_cgroup *memcg; |
| 1037 | }; | 1054 | }; |
| 1038 | 1055 | ||
| 1039 | extern int proto_register(struct proto *prot, int alloc_slab); | 1056 | int proto_register(struct proto *prot, int alloc_slab); |
| 1040 | extern void proto_unregister(struct proto *prot); | 1057 | void proto_unregister(struct proto *prot); |
| 1041 | 1058 | ||
| 1042 | static inline bool memcg_proto_active(struct cg_proto *cg_proto) | 1059 | static inline bool memcg_proto_active(struct cg_proto *cg_proto) |
| 1043 | { | 1060 | { |
| @@ -1118,7 +1135,7 @@ static inline bool sk_under_memory_pressure(const struct sock *sk) | |||
| 1118 | return false; | 1135 | return false; |
| 1119 | 1136 | ||
| 1120 | if (mem_cgroup_sockets_enabled && sk->sk_cgrp) | 1137 | if (mem_cgroup_sockets_enabled && sk->sk_cgrp) |
| 1121 | return !!*sk->sk_cgrp->memory_pressure; | 1138 | return !!sk->sk_cgrp->memory_pressure; |
| 1122 | 1139 | ||
| 1123 | return !!*sk->sk_prot->memory_pressure; | 1140 | return !!*sk->sk_prot->memory_pressure; |
| 1124 | } | 1141 | } |
| @@ -1138,8 +1155,8 @@ static inline void sk_leave_memory_pressure(struct sock *sk) | |||
| 1138 | struct proto *prot = sk->sk_prot; | 1155 | struct proto *prot = sk->sk_prot; |
| 1139 | 1156 | ||
| 1140 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1157 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
| 1141 | if (*cg_proto->memory_pressure) | 1158 | if (cg_proto->memory_pressure) |
| 1142 | *cg_proto->memory_pressure = 0; | 1159 | cg_proto->memory_pressure = 0; |
| 1143 | } | 1160 | } |
| 1144 | 1161 | ||
| 1145 | } | 1162 | } |
| @@ -1175,7 +1192,7 @@ static inline void memcg_memory_allocated_add(struct cg_proto *prot, | |||
| 1175 | struct res_counter *fail; | 1192 | struct res_counter *fail; |
| 1176 | int ret; | 1193 | int ret; |
| 1177 | 1194 | ||
| 1178 | ret = res_counter_charge_nofail(prot->memory_allocated, | 1195 | ret = res_counter_charge_nofail(&prot->memory_allocated, |
| 1179 | amt << PAGE_SHIFT, &fail); | 1196 | amt << PAGE_SHIFT, &fail); |
| 1180 | if (ret < 0) | 1197 | if (ret < 0) |
| 1181 | *parent_status = OVER_LIMIT; | 1198 | *parent_status = OVER_LIMIT; |
| @@ -1184,13 +1201,13 @@ static inline void memcg_memory_allocated_add(struct cg_proto *prot, | |||
| 1184 | static inline void memcg_memory_allocated_sub(struct cg_proto *prot, | 1201 | static inline void memcg_memory_allocated_sub(struct cg_proto *prot, |
| 1185 | unsigned long amt) | 1202 | unsigned long amt) |
| 1186 | { | 1203 | { |
| 1187 | res_counter_uncharge(prot->memory_allocated, amt << PAGE_SHIFT); | 1204 | res_counter_uncharge(&prot->memory_allocated, amt << PAGE_SHIFT); |
| 1188 | } | 1205 | } |
| 1189 | 1206 | ||
| 1190 | static inline u64 memcg_memory_allocated_read(struct cg_proto *prot) | 1207 | static inline u64 memcg_memory_allocated_read(struct cg_proto *prot) |
| 1191 | { | 1208 | { |
| 1192 | u64 ret; | 1209 | u64 ret; |
| 1193 | ret = res_counter_read_u64(prot->memory_allocated, RES_USAGE); | 1210 | ret = res_counter_read_u64(&prot->memory_allocated, RES_USAGE); |
| 1194 | return ret >> PAGE_SHIFT; | 1211 | return ret >> PAGE_SHIFT; |
| 1195 | } | 1212 | } |
| 1196 | 1213 | ||
| @@ -1238,7 +1255,7 @@ static inline void sk_sockets_allocated_dec(struct sock *sk) | |||
| 1238 | struct cg_proto *cg_proto = sk->sk_cgrp; | 1255 | struct cg_proto *cg_proto = sk->sk_cgrp; |
| 1239 | 1256 | ||
| 1240 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1257 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
| 1241 | percpu_counter_dec(cg_proto->sockets_allocated); | 1258 | percpu_counter_dec(&cg_proto->sockets_allocated); |
| 1242 | } | 1259 | } |
| 1243 | 1260 | ||
| 1244 | percpu_counter_dec(prot->sockets_allocated); | 1261 | percpu_counter_dec(prot->sockets_allocated); |
| @@ -1252,7 +1269,7 @@ static inline void sk_sockets_allocated_inc(struct sock *sk) | |||
| 1252 | struct cg_proto *cg_proto = sk->sk_cgrp; | 1269 | struct cg_proto *cg_proto = sk->sk_cgrp; |
| 1253 | 1270 | ||
| 1254 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1271 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
| 1255 | percpu_counter_inc(cg_proto->sockets_allocated); | 1272 | percpu_counter_inc(&cg_proto->sockets_allocated); |
| 1256 | } | 1273 | } |
| 1257 | 1274 | ||
| 1258 | percpu_counter_inc(prot->sockets_allocated); | 1275 | percpu_counter_inc(prot->sockets_allocated); |
| @@ -1264,7 +1281,7 @@ sk_sockets_allocated_read_positive(struct sock *sk) | |||
| 1264 | struct proto *prot = sk->sk_prot; | 1281 | struct proto *prot = sk->sk_prot; |
| 1265 | 1282 | ||
| 1266 | if (mem_cgroup_sockets_enabled && sk->sk_cgrp) | 1283 | if (mem_cgroup_sockets_enabled && sk->sk_cgrp) |
| 1267 | return percpu_counter_read_positive(sk->sk_cgrp->sockets_allocated); | 1284 | return percpu_counter_read_positive(&sk->sk_cgrp->sockets_allocated); |
| 1268 | 1285 | ||
| 1269 | return percpu_counter_read_positive(prot->sockets_allocated); | 1286 | return percpu_counter_read_positive(prot->sockets_allocated); |
| 1270 | } | 1287 | } |
| @@ -1292,8 +1309,8 @@ proto_memory_pressure(struct proto *prot) | |||
| 1292 | 1309 | ||
| 1293 | #ifdef CONFIG_PROC_FS | 1310 | #ifdef CONFIG_PROC_FS |
| 1294 | /* Called with local bh disabled */ | 1311 | /* Called with local bh disabled */ |
| 1295 | extern void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc); | 1312 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc); |
| 1296 | extern int sock_prot_inuse_get(struct net *net, struct proto *proto); | 1313 | int sock_prot_inuse_get(struct net *net, struct proto *proto); |
| 1297 | #else | 1314 | #else |
| 1298 | static inline void sock_prot_inuse_add(struct net *net, struct proto *prot, | 1315 | static inline void sock_prot_inuse_add(struct net *net, struct proto *prot, |
| 1299 | int inc) | 1316 | int inc) |
| @@ -1369,8 +1386,8 @@ static inline struct inode *SOCK_INODE(struct socket *socket) | |||
| 1369 | /* | 1386 | /* |
| 1370 | * Functions for memory accounting | 1387 | * Functions for memory accounting |
| 1371 | */ | 1388 | */ |
| 1372 | extern int __sk_mem_schedule(struct sock *sk, int size, int kind); | 1389 | int __sk_mem_schedule(struct sock *sk, int size, int kind); |
| 1373 | extern void __sk_mem_reclaim(struct sock *sk); | 1390 | void __sk_mem_reclaim(struct sock *sk); |
| 1374 | 1391 | ||
| 1375 | #define SK_MEM_QUANTUM ((int)PAGE_SIZE) | 1392 | #define SK_MEM_QUANTUM ((int)PAGE_SIZE) |
| 1376 | #define SK_MEM_QUANTUM_SHIFT ilog2(SK_MEM_QUANTUM) | 1393 | #define SK_MEM_QUANTUM_SHIFT ilog2(SK_MEM_QUANTUM) |
| @@ -1478,14 +1495,14 @@ do { \ | |||
| 1478 | lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \ | 1495 | lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \ |
| 1479 | } while (0) | 1496 | } while (0) |
| 1480 | 1497 | ||
| 1481 | extern void lock_sock_nested(struct sock *sk, int subclass); | 1498 | void lock_sock_nested(struct sock *sk, int subclass); |
| 1482 | 1499 | ||
| 1483 | static inline void lock_sock(struct sock *sk) | 1500 | static inline void lock_sock(struct sock *sk) |
| 1484 | { | 1501 | { |
| 1485 | lock_sock_nested(sk, 0); | 1502 | lock_sock_nested(sk, 0); |
| 1486 | } | 1503 | } |
| 1487 | 1504 | ||
| 1488 | extern void release_sock(struct sock *sk); | 1505 | void release_sock(struct sock *sk); |
| 1489 | 1506 | ||
| 1490 | /* BH context may only use the following locking interface. */ | 1507 | /* BH context may only use the following locking interface. */ |
| 1491 | #define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) | 1508 | #define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) |
| @@ -1494,7 +1511,7 @@ extern void release_sock(struct sock *sk); | |||
| 1494 | SINGLE_DEPTH_NESTING) | 1511 | SINGLE_DEPTH_NESTING) |
| 1495 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 1512 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
| 1496 | 1513 | ||
| 1497 | extern bool lock_sock_fast(struct sock *sk); | 1514 | bool lock_sock_fast(struct sock *sk); |
| 1498 | /** | 1515 | /** |
| 1499 | * unlock_sock_fast - complement of lock_sock_fast | 1516 | * unlock_sock_fast - complement of lock_sock_fast |
| 1500 | * @sk: socket | 1517 | * @sk: socket |
| @@ -1512,108 +1529,84 @@ static inline void unlock_sock_fast(struct sock *sk, bool slow) | |||
| 1512 | } | 1529 | } |
| 1513 | 1530 | ||
| 1514 | 1531 | ||
| 1515 | extern struct sock *sk_alloc(struct net *net, int family, | 1532 | struct sock *sk_alloc(struct net *net, int family, gfp_t priority, |
| 1516 | gfp_t priority, | 1533 | struct proto *prot); |
| 1517 | struct proto *prot); | 1534 | void sk_free(struct sock *sk); |
| 1518 | extern void sk_free(struct sock *sk); | 1535 | void sk_release_kernel(struct sock *sk); |
| 1519 | extern void sk_release_kernel(struct sock *sk); | 1536 | struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority); |
| 1520 | extern struct sock *sk_clone_lock(const struct sock *sk, | 1537 | |
| 1521 | const gfp_t priority); | 1538 | struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, |
| 1522 | 1539 | gfp_t priority); | |
| 1523 | extern struct sk_buff *sock_wmalloc(struct sock *sk, | 1540 | struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force, |
| 1524 | unsigned long size, int force, | 1541 | gfp_t priority); |
| 1525 | gfp_t priority); | 1542 | void sock_wfree(struct sk_buff *skb); |
| 1526 | extern struct sk_buff *sock_rmalloc(struct sock *sk, | 1543 | void skb_orphan_partial(struct sk_buff *skb); |
| 1527 | unsigned long size, int force, | 1544 | void sock_rfree(struct sk_buff *skb); |
| 1528 | gfp_t priority); | 1545 | void sock_edemux(struct sk_buff *skb); |
| 1529 | extern void sock_wfree(struct sk_buff *skb); | 1546 | |
| 1530 | extern void skb_orphan_partial(struct sk_buff *skb); | 1547 | int sock_setsockopt(struct socket *sock, int level, int op, |
| 1531 | extern void sock_rfree(struct sk_buff *skb); | 1548 | char __user *optval, unsigned int optlen); |
| 1532 | extern void sock_edemux(struct sk_buff *skb); | 1549 | |
| 1533 | 1550 | int sock_getsockopt(struct socket *sock, int level, int op, | |
| 1534 | extern int sock_setsockopt(struct socket *sock, int level, | 1551 | char __user *optval, int __user *optlen); |
| 1535 | int op, char __user *optval, | 1552 | struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, |
| 1536 | unsigned int optlen); | 1553 | int noblock, int *errcode); |
| 1537 | 1554 | struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, | |
| 1538 | extern int sock_getsockopt(struct socket *sock, int level, | 1555 | unsigned long data_len, int noblock, |
| 1539 | int op, char __user *optval, | 1556 | int *errcode, int max_page_order); |
| 1540 | int __user *optlen); | 1557 | void *sock_kmalloc(struct sock *sk, int size, gfp_t priority); |
| 1541 | extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | 1558 | void sock_kfree_s(struct sock *sk, void *mem, int size); |
| 1542 | unsigned long size, | 1559 | void sk_send_sigurg(struct sock *sk); |
| 1543 | int noblock, | ||
| 1544 | int *errcode); | ||
| 1545 | extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk, | ||
| 1546 | unsigned long header_len, | ||
| 1547 | unsigned long data_len, | ||
| 1548 | int noblock, | ||
| 1549 | int *errcode, | ||
| 1550 | int max_page_order); | ||
| 1551 | extern void *sock_kmalloc(struct sock *sk, int size, | ||
| 1552 | gfp_t priority); | ||
| 1553 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | ||
| 1554 | extern void sk_send_sigurg(struct sock *sk); | ||
| 1555 | 1560 | ||
| 1556 | /* | 1561 | /* |
| 1557 | * Functions to fill in entries in struct proto_ops when a protocol | 1562 | * Functions to fill in entries in struct proto_ops when a protocol |
| 1558 | * does not implement a particular function. | 1563 | * does not implement a particular function. |
| 1559 | */ | 1564 | */ |
| 1560 | extern int sock_no_bind(struct socket *, | 1565 | int sock_no_bind(struct socket *, struct sockaddr *, int); |
| 1561 | struct sockaddr *, int); | 1566 | int sock_no_connect(struct socket *, struct sockaddr *, int, int); |
| 1562 | extern int sock_no_connect(struct socket *, | 1567 | int sock_no_socketpair(struct socket *, struct socket *); |
| 1563 | struct sockaddr *, int, int); | 1568 | int sock_no_accept(struct socket *, struct socket *, int); |
| 1564 | extern int sock_no_socketpair(struct socket *, | 1569 | int sock_no_getname(struct socket *, struct sockaddr *, int *, int); |
| 1565 | struct socket *); | 1570 | unsigned int sock_no_poll(struct file *, struct socket *, |
| 1566 | extern int sock_no_accept(struct socket *, | 1571 | struct poll_table_struct *); |
| 1567 | struct socket *, int); | 1572 | int sock_no_ioctl(struct socket *, unsigned int, unsigned long); |
| 1568 | extern int sock_no_getname(struct socket *, | 1573 | int sock_no_listen(struct socket *, int); |
| 1569 | struct sockaddr *, int *, int); | 1574 | int sock_no_shutdown(struct socket *, int); |
| 1570 | extern unsigned int sock_no_poll(struct file *, struct socket *, | 1575 | int sock_no_getsockopt(struct socket *, int , int, char __user *, int __user *); |
| 1571 | struct poll_table_struct *); | 1576 | int sock_no_setsockopt(struct socket *, int, int, char __user *, unsigned int); |
| 1572 | extern int sock_no_ioctl(struct socket *, unsigned int, | 1577 | int sock_no_sendmsg(struct kiocb *, struct socket *, struct msghdr *, size_t); |
| 1573 | unsigned long); | 1578 | int sock_no_recvmsg(struct kiocb *, struct socket *, struct msghdr *, size_t, |
| 1574 | extern int sock_no_listen(struct socket *, int); | 1579 | int); |
| 1575 | extern int sock_no_shutdown(struct socket *, int); | 1580 | int sock_no_mmap(struct file *file, struct socket *sock, |
| 1576 | extern int sock_no_getsockopt(struct socket *, int , int, | 1581 | struct vm_area_struct *vma); |
| 1577 | char __user *, int __user *); | 1582 | ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, |
| 1578 | extern int sock_no_setsockopt(struct socket *, int, int, | 1583 | size_t size, int flags); |
| 1579 | char __user *, unsigned int); | ||
| 1580 | extern int sock_no_sendmsg(struct kiocb *, struct socket *, | ||
| 1581 | struct msghdr *, size_t); | ||
| 1582 | extern int sock_no_recvmsg(struct kiocb *, struct socket *, | ||
| 1583 | struct msghdr *, size_t, int); | ||
| 1584 | extern int sock_no_mmap(struct file *file, | ||
| 1585 | struct socket *sock, | ||
| 1586 | struct vm_area_struct *vma); | ||
| 1587 | extern ssize_t sock_no_sendpage(struct socket *sock, | ||
| 1588 | struct page *page, | ||
| 1589 | int offset, size_t size, | ||
| 1590 | int flags); | ||
| 1591 | 1584 | ||
| 1592 | /* | 1585 | /* |
| 1593 | * Functions to fill in entries in struct proto_ops when a protocol | 1586 | * Functions to fill in entries in struct proto_ops when a protocol |
| 1594 | * uses the inet style. | 1587 | * uses the inet style. |
| 1595 | */ | 1588 | */ |
| 1596 | extern int sock_common_getsockopt(struct socket *sock, int level, int optname, | 1589 | int sock_common_getsockopt(struct socket *sock, int level, int optname, |
| 1597 | char __user *optval, int __user *optlen); | 1590 | char __user *optval, int __user *optlen); |
| 1598 | extern int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, | 1591 | int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, |
| 1599 | struct msghdr *msg, size_t size, int flags); | 1592 | struct msghdr *msg, size_t size, int flags); |
| 1600 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, | 1593 | int sock_common_setsockopt(struct socket *sock, int level, int optname, |
| 1601 | char __user *optval, unsigned int optlen); | 1594 | char __user *optval, unsigned int optlen); |
| 1602 | extern int compat_sock_common_getsockopt(struct socket *sock, int level, | 1595 | int compat_sock_common_getsockopt(struct socket *sock, int level, |
| 1603 | int optname, char __user *optval, int __user *optlen); | 1596 | int optname, char __user *optval, int __user *optlen); |
| 1604 | extern int compat_sock_common_setsockopt(struct socket *sock, int level, | 1597 | int compat_sock_common_setsockopt(struct socket *sock, int level, |
| 1605 | int optname, char __user *optval, unsigned int optlen); | 1598 | int optname, char __user *optval, unsigned int optlen); |
| 1606 | 1599 | ||
| 1607 | extern void sk_common_release(struct sock *sk); | 1600 | void sk_common_release(struct sock *sk); |
| 1608 | 1601 | ||
| 1609 | /* | 1602 | /* |
| 1610 | * Default socket callbacks and setup code | 1603 | * Default socket callbacks and setup code |
| 1611 | */ | 1604 | */ |
| 1612 | 1605 | ||
| 1613 | /* Initialise core socket variables */ | 1606 | /* Initialise core socket variables */ |
| 1614 | extern void sock_init_data(struct socket *sock, struct sock *sk); | 1607 | void sock_init_data(struct socket *sock, struct sock *sk); |
| 1615 | 1608 | ||
| 1616 | extern void sk_filter_release_rcu(struct rcu_head *rcu); | 1609 | void sk_filter_release_rcu(struct rcu_head *rcu); |
| 1617 | 1610 | ||
| 1618 | /** | 1611 | /** |
| 1619 | * sk_filter_release - release a socket filter | 1612 | * sk_filter_release - release a socket filter |
| @@ -1671,9 +1664,12 @@ static inline void sock_put(struct sock *sk) | |||
| 1671 | if (atomic_dec_and_test(&sk->sk_refcnt)) | 1664 | if (atomic_dec_and_test(&sk->sk_refcnt)) |
| 1672 | sk_free(sk); | 1665 | sk_free(sk); |
| 1673 | } | 1666 | } |
| 1667 | /* Generic version of sock_put(), dealing with all sockets | ||
| 1668 | * (TCP_TIMEWAIT, ESTABLISHED...) | ||
| 1669 | */ | ||
| 1670 | void sock_gen_put(struct sock *sk); | ||
| 1674 | 1671 | ||
| 1675 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, | 1672 | int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested); |
| 1676 | const int nested); | ||
| 1677 | 1673 | ||
| 1678 | static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) | 1674 | static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) |
| 1679 | { | 1675 | { |
| @@ -1727,8 +1723,8 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) | |||
| 1727 | write_unlock_bh(&sk->sk_callback_lock); | 1723 | write_unlock_bh(&sk->sk_callback_lock); |
| 1728 | } | 1724 | } |
| 1729 | 1725 | ||
| 1730 | extern kuid_t sock_i_uid(struct sock *sk); | 1726 | kuid_t sock_i_uid(struct sock *sk); |
| 1731 | extern unsigned long sock_i_ino(struct sock *sk); | 1727 | unsigned long sock_i_ino(struct sock *sk); |
| 1732 | 1728 | ||
| 1733 | static inline struct dst_entry * | 1729 | static inline struct dst_entry * |
| 1734 | __sk_dst_get(struct sock *sk) | 1730 | __sk_dst_get(struct sock *sk) |
| @@ -1750,8 +1746,6 @@ sk_dst_get(struct sock *sk) | |||
| 1750 | return dst; | 1746 | return dst; |
| 1751 | } | 1747 | } |
| 1752 | 1748 | ||
| 1753 | extern void sk_reset_txq(struct sock *sk); | ||
| 1754 | |||
| 1755 | static inline void dst_negative_advice(struct sock *sk) | 1749 | static inline void dst_negative_advice(struct sock *sk) |
| 1756 | { | 1750 | { |
| 1757 | struct dst_entry *ndst, *dst = __sk_dst_get(sk); | 1751 | struct dst_entry *ndst, *dst = __sk_dst_get(sk); |
| @@ -1761,7 +1755,7 @@ static inline void dst_negative_advice(struct sock *sk) | |||
| 1761 | 1755 | ||
| 1762 | if (ndst != dst) { | 1756 | if (ndst != dst) { |
| 1763 | rcu_assign_pointer(sk->sk_dst_cache, ndst); | 1757 | rcu_assign_pointer(sk->sk_dst_cache, ndst); |
| 1764 | sk_reset_txq(sk); | 1758 | sk_tx_queue_clear(sk); |
| 1765 | } | 1759 | } |
| 1766 | } | 1760 | } |
| 1767 | } | 1761 | } |
| @@ -1803,16 +1797,16 @@ sk_dst_reset(struct sock *sk) | |||
| 1803 | spin_unlock(&sk->sk_dst_lock); | 1797 | spin_unlock(&sk->sk_dst_lock); |
| 1804 | } | 1798 | } |
| 1805 | 1799 | ||
| 1806 | extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); | 1800 | struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); |
| 1807 | 1801 | ||
| 1808 | extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); | 1802 | struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); |
| 1809 | 1803 | ||
| 1810 | static inline bool sk_can_gso(const struct sock *sk) | 1804 | static inline bool sk_can_gso(const struct sock *sk) |
| 1811 | { | 1805 | { |
| 1812 | return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); | 1806 | return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); |
| 1813 | } | 1807 | } |
| 1814 | 1808 | ||
| 1815 | extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst); | 1809 | void sk_setup_caps(struct sock *sk, struct dst_entry *dst); |
| 1816 | 1810 | ||
| 1817 | static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) | 1811 | static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) |
| 1818 | { | 1812 | { |
| @@ -2025,14 +2019,14 @@ static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
| 2025 | sk_mem_charge(sk, skb->truesize); | 2019 | sk_mem_charge(sk, skb->truesize); |
| 2026 | } | 2020 | } |
| 2027 | 2021 | ||
| 2028 | extern void sk_reset_timer(struct sock *sk, struct timer_list *timer, | 2022 | void sk_reset_timer(struct sock *sk, struct timer_list *timer, |
| 2029 | unsigned long expires); | 2023 | unsigned long expires); |
| 2030 | 2024 | ||
| 2031 | extern void sk_stop_timer(struct sock *sk, struct timer_list *timer); | 2025 | void sk_stop_timer(struct sock *sk, struct timer_list *timer); |
| 2032 | 2026 | ||
| 2033 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 2027 | int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
| 2034 | 2028 | ||
| 2035 | extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb); | 2029 | int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb); |
| 2036 | 2030 | ||
| 2037 | /* | 2031 | /* |
| 2038 | * Recover an error report and clear atomically | 2032 | * Recover an error report and clear atomically |
| @@ -2100,7 +2094,7 @@ static inline struct page_frag *sk_page_frag(struct sock *sk) | |||
| 2100 | return &sk->sk_frag; | 2094 | return &sk->sk_frag; |
| 2101 | } | 2095 | } |
| 2102 | 2096 | ||
| 2103 | extern bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag); | 2097 | bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag); |
| 2104 | 2098 | ||
| 2105 | /* | 2099 | /* |
| 2106 | * Default write policy as shown to user space via poll/select/SIGIO | 2100 | * Default write policy as shown to user space via poll/select/SIGIO |
| @@ -2138,10 +2132,10 @@ static inline int sock_intr_errno(long timeo) | |||
| 2138 | return timeo == MAX_SCHEDULE_TIMEOUT ? -ERESTARTSYS : -EINTR; | 2132 | return timeo == MAX_SCHEDULE_TIMEOUT ? -ERESTARTSYS : -EINTR; |
| 2139 | } | 2133 | } |
| 2140 | 2134 | ||
| 2141 | extern void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk, | 2135 | void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk, |
| 2142 | struct sk_buff *skb); | 2136 | struct sk_buff *skb); |
| 2143 | extern void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk, | 2137 | void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk, |
| 2144 | struct sk_buff *skb); | 2138 | struct sk_buff *skb); |
| 2145 | 2139 | ||
| 2146 | static inline void | 2140 | static inline void |
| 2147 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | 2141 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) |
| @@ -2174,8 +2168,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
| 2174 | __sock_recv_wifi_status(msg, sk, skb); | 2168 | __sock_recv_wifi_status(msg, sk, skb); |
| 2175 | } | 2169 | } |
| 2176 | 2170 | ||
| 2177 | extern void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | 2171 | void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, |
| 2178 | struct sk_buff *skb); | 2172 | struct sk_buff *skb); |
| 2179 | 2173 | ||
| 2180 | static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | 2174 | static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, |
| 2181 | struct sk_buff *skb) | 2175 | struct sk_buff *skb) |
| @@ -2200,7 +2194,7 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | |||
| 2200 | * | 2194 | * |
| 2201 | * Currently only depends on SOCK_TIMESTAMPING* flags. | 2195 | * Currently only depends on SOCK_TIMESTAMPING* flags. |
| 2202 | */ | 2196 | */ |
| 2203 | extern void sock_tx_timestamp(struct sock *sk, __u8 *tx_flags); | 2197 | void sock_tx_timestamp(struct sock *sk, __u8 *tx_flags); |
| 2204 | 2198 | ||
| 2205 | /** | 2199 | /** |
| 2206 | * sk_eat_skb - Release a skb if it is no longer needed | 2200 | * sk_eat_skb - Release a skb if it is no longer needed |
| @@ -2264,11 +2258,11 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb) | |||
| 2264 | return NULL; | 2258 | return NULL; |
| 2265 | } | 2259 | } |
| 2266 | 2260 | ||
| 2267 | extern void sock_enable_timestamp(struct sock *sk, int flag); | 2261 | void sock_enable_timestamp(struct sock *sk, int flag); |
| 2268 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); | 2262 | int sock_get_timestamp(struct sock *, struct timeval __user *); |
| 2269 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); | 2263 | int sock_get_timestampns(struct sock *, struct timespec __user *); |
| 2270 | extern int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, | 2264 | int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, int level, |
| 2271 | int level, int type); | 2265 | int type); |
| 2272 | 2266 | ||
| 2273 | /* | 2267 | /* |
| 2274 | * Enable debug/info messages | 2268 | * Enable debug/info messages |
diff --git a/include/net/stp.h b/include/net/stp.h index ad447f105417..3af174d70d9e 100644 --- a/include/net/stp.h +++ b/include/net/stp.h | |||
| @@ -8,7 +8,7 @@ struct stp_proto { | |||
| 8 | void *data; | 8 | void *data; |
| 9 | }; | 9 | }; |
| 10 | 10 | ||
| 11 | extern int stp_proto_register(const struct stp_proto *proto); | 11 | int stp_proto_register(const struct stp_proto *proto); |
| 12 | extern void stp_proto_unregister(const struct stp_proto *proto); | 12 | void stp_proto_unregister(const struct stp_proto *proto); |
| 13 | 13 | ||
| 14 | #endif /* _NET_STP_H */ | 14 | #endif /* _NET_STP_H */ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index b1aa324c5e65..70e55d200610 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -50,7 +50,7 @@ | |||
| 50 | extern struct inet_hashinfo tcp_hashinfo; | 50 | extern struct inet_hashinfo tcp_hashinfo; |
| 51 | 51 | ||
| 52 | extern struct percpu_counter tcp_orphan_count; | 52 | extern struct percpu_counter tcp_orphan_count; |
| 53 | extern void tcp_time_wait(struct sock *sk, int state, int timeo); | 53 | void tcp_time_wait(struct sock *sk, int state, int timeo); |
| 54 | 54 | ||
| 55 | #define MAX_TCP_HEADER (128 + MAX_HEADER) | 55 | #define MAX_TCP_HEADER (128 + MAX_HEADER) |
| 56 | #define MAX_TCP_OPTION_SPACE 40 | 56 | #define MAX_TCP_OPTION_SPACE 40 |
| @@ -259,6 +259,7 @@ extern int sysctl_tcp_max_orphans; | |||
| 259 | extern int sysctl_tcp_fack; | 259 | extern int sysctl_tcp_fack; |
| 260 | extern int sysctl_tcp_reordering; | 260 | extern int sysctl_tcp_reordering; |
| 261 | extern int sysctl_tcp_dsack; | 261 | extern int sysctl_tcp_dsack; |
| 262 | extern long sysctl_tcp_mem[3]; | ||
| 262 | extern int sysctl_tcp_wmem[3]; | 263 | extern int sysctl_tcp_wmem[3]; |
| 263 | extern int sysctl_tcp_rmem[3]; | 264 | extern int sysctl_tcp_rmem[3]; |
| 264 | extern int sysctl_tcp_app_win; | 265 | extern int sysctl_tcp_app_win; |
| @@ -274,7 +275,6 @@ extern int sysctl_tcp_mtu_probing; | |||
| 274 | extern int sysctl_tcp_base_mss; | 275 | extern int sysctl_tcp_base_mss; |
| 275 | extern int sysctl_tcp_workaround_signed_windows; | 276 | extern int sysctl_tcp_workaround_signed_windows; |
| 276 | extern int sysctl_tcp_slow_start_after_idle; | 277 | extern int sysctl_tcp_slow_start_after_idle; |
| 277 | extern int sysctl_tcp_max_ssthresh; | ||
| 278 | extern int sysctl_tcp_thin_linear_timeouts; | 278 | extern int sysctl_tcp_thin_linear_timeouts; |
| 279 | extern int sysctl_tcp_thin_dupack; | 279 | extern int sysctl_tcp_thin_dupack; |
| 280 | extern int sysctl_tcp_early_retrans; | 280 | extern int sysctl_tcp_early_retrans; |
| @@ -325,7 +325,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift) | |||
| 325 | return false; | 325 | return false; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | extern bool tcp_check_oom(struct sock *sk, int shift); | 328 | bool tcp_check_oom(struct sock *sk, int shift); |
| 329 | 329 | ||
| 330 | /* syncookies: remember time of last synqueue overflow */ | 330 | /* syncookies: remember time of last synqueue overflow */ |
| 331 | static inline void tcp_synq_overflow(struct sock *sk) | 331 | static inline void tcp_synq_overflow(struct sock *sk) |
| @@ -348,38 +348,36 @@ extern struct proto tcp_prot; | |||
| 348 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) | 348 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) |
| 349 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) | 349 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) |
| 350 | 350 | ||
| 351 | extern void tcp_init_mem(struct net *net); | 351 | void tcp_tasklet_init(void); |
| 352 | 352 | ||
| 353 | extern void tcp_tasklet_init(void); | 353 | void tcp_v4_err(struct sk_buff *skb, u32); |
| 354 | 354 | ||
| 355 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 355 | void tcp_shutdown(struct sock *sk, int how); |
| 356 | 356 | ||
| 357 | extern void tcp_shutdown (struct sock *sk, int how); | 357 | void tcp_v4_early_demux(struct sk_buff *skb); |
| 358 | 358 | int tcp_v4_rcv(struct sk_buff *skb); | |
| 359 | extern void tcp_v4_early_demux(struct sk_buff *skb); | 359 | |
| 360 | extern int tcp_v4_rcv(struct sk_buff *skb); | 360 | int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
| 361 | 361 | int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |
| 362 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 362 | size_t size); |
| 363 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 363 | int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, |
| 364 | size_t size); | 364 | int flags); |
| 365 | extern int tcp_sendpage(struct sock *sk, struct page *page, int offset, | 365 | void tcp_release_cb(struct sock *sk); |
| 366 | size_t size, int flags); | 366 | void tcp_wfree(struct sk_buff *skb); |
| 367 | extern void tcp_release_cb(struct sock *sk); | 367 | void tcp_write_timer_handler(struct sock *sk); |
| 368 | extern void tcp_wfree(struct sk_buff *skb); | 368 | void tcp_delack_timer_handler(struct sock *sk); |
| 369 | extern void tcp_write_timer_handler(struct sock *sk); | 369 | int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
| 370 | extern void tcp_delack_timer_handler(struct sock *sk); | 370 | int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
| 371 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 371 | const struct tcphdr *th, unsigned int len); |
| 372 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | 372 | void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
| 373 | const struct tcphdr *th, unsigned int len); | 373 | const struct tcphdr *th, unsigned int len); |
| 374 | extern void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | 374 | void tcp_rcv_space_adjust(struct sock *sk); |
| 375 | const struct tcphdr *th, unsigned int len); | 375 | void tcp_cleanup_rbuf(struct sock *sk, int copied); |
| 376 | extern void tcp_rcv_space_adjust(struct sock *sk); | 376 | int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); |
| 377 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); | 377 | void tcp_twsk_destructor(struct sock *sk); |
| 378 | extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); | 378 | ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, |
| 379 | extern void tcp_twsk_destructor(struct sock *sk); | 379 | struct pipe_inode_info *pipe, size_t len, |
| 380 | extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, | 380 | unsigned int flags); |
| 381 | struct pipe_inode_info *pipe, size_t len, | ||
| 382 | unsigned int flags); | ||
| 383 | 381 | ||
| 384 | static inline void tcp_dec_quickack_mode(struct sock *sk, | 382 | static inline void tcp_dec_quickack_mode(struct sock *sk, |
| 385 | const unsigned int pkts) | 383 | const unsigned int pkts) |
| @@ -409,66 +407,65 @@ enum tcp_tw_status { | |||
| 409 | }; | 407 | }; |
| 410 | 408 | ||
| 411 | 409 | ||
| 412 | extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw, | 410 | enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw, |
| 413 | struct sk_buff *skb, | 411 | struct sk_buff *skb, |
| 414 | const struct tcphdr *th); | 412 | const struct tcphdr *th); |
| 415 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | 413 | struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, |
| 416 | struct request_sock *req, | 414 | struct request_sock *req, struct request_sock **prev, |
| 417 | struct request_sock **prev, | 415 | bool fastopen); |
| 418 | bool fastopen); | 416 | int tcp_child_process(struct sock *parent, struct sock *child, |
| 419 | extern int tcp_child_process(struct sock *parent, struct sock *child, | 417 | struct sk_buff *skb); |
| 420 | struct sk_buff *skb); | 418 | void tcp_enter_loss(struct sock *sk, int how); |
| 421 | extern void tcp_enter_loss(struct sock *sk, int how); | 419 | void tcp_clear_retrans(struct tcp_sock *tp); |
| 422 | extern void tcp_clear_retrans(struct tcp_sock *tp); | 420 | void tcp_update_metrics(struct sock *sk); |
| 423 | extern void tcp_update_metrics(struct sock *sk); | 421 | void tcp_init_metrics(struct sock *sk); |
| 424 | extern void tcp_init_metrics(struct sock *sk); | 422 | void tcp_metrics_init(void); |
| 425 | extern void tcp_metrics_init(void); | 423 | bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, |
| 426 | extern bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, bool paws_check); | 424 | bool paws_check); |
| 427 | extern bool tcp_remember_stamp(struct sock *sk); | 425 | bool tcp_remember_stamp(struct sock *sk); |
| 428 | extern bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); | 426 | bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); |
| 429 | extern void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); | 427 | void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); |
| 430 | extern void tcp_disable_fack(struct tcp_sock *tp); | 428 | void tcp_disable_fack(struct tcp_sock *tp); |
| 431 | extern void tcp_close(struct sock *sk, long timeout); | 429 | void tcp_close(struct sock *sk, long timeout); |
| 432 | extern void tcp_init_sock(struct sock *sk); | 430 | void tcp_init_sock(struct sock *sk); |
| 433 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, | 431 | unsigned int tcp_poll(struct file *file, struct socket *sock, |
| 434 | struct poll_table_struct *wait); | 432 | struct poll_table_struct *wait); |
| 435 | extern int tcp_getsockopt(struct sock *sk, int level, int optname, | 433 | int tcp_getsockopt(struct sock *sk, int level, int optname, |
| 434 | char __user *optval, int __user *optlen); | ||
| 435 | int tcp_setsockopt(struct sock *sk, int level, int optname, | ||
| 436 | char __user *optval, unsigned int optlen); | ||
| 437 | int compat_tcp_getsockopt(struct sock *sk, int level, int optname, | ||
| 436 | char __user *optval, int __user *optlen); | 438 | char __user *optval, int __user *optlen); |
| 437 | extern int tcp_setsockopt(struct sock *sk, int level, int optname, | 439 | int compat_tcp_setsockopt(struct sock *sk, int level, int optname, |
| 438 | char __user *optval, unsigned int optlen); | 440 | char __user *optval, unsigned int optlen); |
| 439 | extern int compat_tcp_getsockopt(struct sock *sk, int level, int optname, | 441 | void tcp_set_keepalive(struct sock *sk, int val); |
| 440 | char __user *optval, int __user *optlen); | 442 | void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); |
| 441 | extern int compat_tcp_setsockopt(struct sock *sk, int level, int optname, | 443 | int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
| 442 | char __user *optval, unsigned int optlen); | 444 | size_t len, int nonblock, int flags, int *addr_len); |
| 443 | extern void tcp_set_keepalive(struct sock *sk, int val); | 445 | void tcp_parse_options(const struct sk_buff *skb, |
| 444 | extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); | 446 | struct tcp_options_received *opt_rx, |
| 445 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 447 | int estab, struct tcp_fastopen_cookie *foc); |
| 446 | size_t len, int nonblock, int flags, int *addr_len); | 448 | const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); |
| 447 | extern void tcp_parse_options(const struct sk_buff *skb, | ||
| 448 | struct tcp_options_received *opt_rx, | ||
| 449 | int estab, struct tcp_fastopen_cookie *foc); | ||
| 450 | extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); | ||
| 451 | 449 | ||
| 452 | /* | 450 | /* |
| 453 | * TCP v4 functions exported for the inet6 API | 451 | * TCP v4 functions exported for the inet6 API |
| 454 | */ | 452 | */ |
| 455 | 453 | ||
| 456 | extern void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb); | 454 | void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb); |
| 457 | extern int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); | 455 | int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); |
| 458 | extern struct sock * tcp_create_openreq_child(struct sock *sk, | 456 | struct sock *tcp_create_openreq_child(struct sock *sk, |
| 459 | struct request_sock *req, | 457 | struct request_sock *req, |
| 460 | struct sk_buff *skb); | 458 | struct sk_buff *skb); |
| 461 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | 459 | struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, |
| 462 | struct request_sock *req, | 460 | struct request_sock *req, |
| 463 | struct dst_entry *dst); | 461 | struct dst_entry *dst); |
| 464 | extern int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); | 462 | int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); |
| 465 | extern int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, | 463 | int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 466 | int addr_len); | 464 | int tcp_connect(struct sock *sk); |
| 467 | extern int tcp_connect(struct sock *sk); | 465 | struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, |
| 468 | extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, | 466 | struct request_sock *req, |
| 469 | struct request_sock *req, | 467 | struct tcp_fastopen_cookie *foc); |
| 470 | struct tcp_fastopen_cookie *foc); | 468 | int tcp_disconnect(struct sock *sk, int flags); |
| 471 | extern int tcp_disconnect(struct sock *sk, int flags); | ||
| 472 | 469 | ||
| 473 | void tcp_connect_init(struct sock *sk); | 470 | void tcp_connect_init(struct sock *sk); |
| 474 | void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); | 471 | void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); |
| @@ -476,16 +473,32 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); | |||
| 476 | void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); | 473 | void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); |
| 477 | 474 | ||
| 478 | /* From syncookies.c */ | 475 | /* From syncookies.c */ |
| 479 | extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; | 476 | int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th, |
| 480 | extern int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th, | 477 | u32 cookie); |
| 481 | u32 cookie); | 478 | struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, |
| 482 | extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | 479 | struct ip_options *opt); |
| 483 | struct ip_options *opt); | ||
| 484 | #ifdef CONFIG_SYN_COOKIES | 480 | #ifdef CONFIG_SYN_COOKIES |
| 485 | extern u32 __cookie_v4_init_sequence(const struct iphdr *iph, | 481 | #include <linux/ktime.h> |
| 486 | const struct tcphdr *th, u16 *mssp); | 482 | |
| 487 | extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, | 483 | /* Syncookies use a monotonic timer which increments every 64 seconds. |
| 488 | __u16 *mss); | 484 | * This counter is used both as a hash input and partially encoded into |
| 485 | * the cookie value. A cookie is only validated further if the delta | ||
| 486 | * between the current counter value and the encoded one is less than this, | ||
| 487 | * i.e. a sent cookie is valid only at most for 128 seconds (or less if | ||
| 488 | * the counter advances immediately after a cookie is generated). | ||
| 489 | */ | ||
| 490 | #define MAX_SYNCOOKIE_AGE 2 | ||
| 491 | |||
| 492 | static inline u32 tcp_cookie_time(void) | ||
| 493 | { | ||
| 494 | struct timespec now; | ||
| 495 | getnstimeofday(&now); | ||
| 496 | return now.tv_sec >> 6; /* 64 seconds granularity */ | ||
| 497 | } | ||
| 498 | |||
| 499 | u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, | ||
| 500 | u16 *mssp); | ||
| 501 | __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mss); | ||
| 489 | #else | 502 | #else |
| 490 | static inline __u32 cookie_v4_init_sequence(struct sock *sk, | 503 | static inline __u32 cookie_v4_init_sequence(struct sock *sk, |
| 491 | struct sk_buff *skb, | 504 | struct sk_buff *skb, |
| @@ -495,19 +508,19 @@ static inline __u32 cookie_v4_init_sequence(struct sock *sk, | |||
| 495 | } | 508 | } |
| 496 | #endif | 509 | #endif |
| 497 | 510 | ||
| 498 | extern __u32 cookie_init_timestamp(struct request_sock *req); | 511 | __u32 cookie_init_timestamp(struct request_sock *req); |
| 499 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, | 512 | bool cookie_check_timestamp(struct tcp_options_received *opt, struct net *net, |
| 500 | struct net *net, bool *ecn_ok); | 513 | bool *ecn_ok); |
| 501 | 514 | ||
| 502 | /* From net/ipv6/syncookies.c */ | 515 | /* From net/ipv6/syncookies.c */ |
| 503 | extern int __cookie_v6_check(const struct ipv6hdr *iph, const struct tcphdr *th, | 516 | int __cookie_v6_check(const struct ipv6hdr *iph, const struct tcphdr *th, |
| 504 | u32 cookie); | 517 | u32 cookie); |
| 505 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); | 518 | struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); |
| 506 | #ifdef CONFIG_SYN_COOKIES | 519 | #ifdef CONFIG_SYN_COOKIES |
| 507 | extern u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, | 520 | u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, |
| 508 | const struct tcphdr *th, u16 *mssp); | 521 | const struct tcphdr *th, u16 *mssp); |
| 509 | extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, | 522 | __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, |
| 510 | __u16 *mss); | 523 | __u16 *mss); |
| 511 | #else | 524 | #else |
| 512 | static inline __u32 cookie_v6_init_sequence(struct sock *sk, | 525 | static inline __u32 cookie_v6_init_sequence(struct sock *sk, |
| 513 | struct sk_buff *skb, | 526 | struct sk_buff *skb, |
| @@ -518,47 +531,46 @@ static inline __u32 cookie_v6_init_sequence(struct sock *sk, | |||
| 518 | #endif | 531 | #endif |
| 519 | /* tcp_output.c */ | 532 | /* tcp_output.c */ |
| 520 | 533 | ||
| 521 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, | 534 | void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, |
| 522 | int nonagle); | 535 | int nonagle); |
| 523 | extern bool tcp_may_send_now(struct sock *sk); | 536 | bool tcp_may_send_now(struct sock *sk); |
| 524 | extern int __tcp_retransmit_skb(struct sock *, struct sk_buff *); | 537 | int __tcp_retransmit_skb(struct sock *, struct sk_buff *); |
| 525 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); | 538 | int tcp_retransmit_skb(struct sock *, struct sk_buff *); |
| 526 | extern void tcp_retransmit_timer(struct sock *sk); | 539 | void tcp_retransmit_timer(struct sock *sk); |
| 527 | extern void tcp_xmit_retransmit_queue(struct sock *); | 540 | void tcp_xmit_retransmit_queue(struct sock *); |
| 528 | extern void tcp_simple_retransmit(struct sock *); | 541 | void tcp_simple_retransmit(struct sock *); |
| 529 | extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); | 542 | int tcp_trim_head(struct sock *, struct sk_buff *, u32); |
| 530 | extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int); | 543 | int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int); |
| 531 | 544 | ||
| 532 | extern void tcp_send_probe0(struct sock *); | 545 | void tcp_send_probe0(struct sock *); |
| 533 | extern void tcp_send_partial(struct sock *); | 546 | void tcp_send_partial(struct sock *); |
| 534 | extern int tcp_write_wakeup(struct sock *); | 547 | int tcp_write_wakeup(struct sock *); |
| 535 | extern void tcp_send_fin(struct sock *sk); | 548 | void tcp_send_fin(struct sock *sk); |
| 536 | extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); | 549 | void tcp_send_active_reset(struct sock *sk, gfp_t priority); |
| 537 | extern int tcp_send_synack(struct sock *); | 550 | int tcp_send_synack(struct sock *); |
| 538 | extern bool tcp_syn_flood_action(struct sock *sk, | 551 | bool tcp_syn_flood_action(struct sock *sk, const struct sk_buff *skb, |
| 539 | const struct sk_buff *skb, | 552 | const char *proto); |
| 540 | const char *proto); | 553 | void tcp_push_one(struct sock *, unsigned int mss_now); |
| 541 | extern void tcp_push_one(struct sock *, unsigned int mss_now); | 554 | void tcp_send_ack(struct sock *sk); |
| 542 | extern void tcp_send_ack(struct sock *sk); | 555 | void tcp_send_delayed_ack(struct sock *sk); |
| 543 | extern void tcp_send_delayed_ack(struct sock *sk); | 556 | void tcp_send_loss_probe(struct sock *sk); |
| 544 | extern void tcp_send_loss_probe(struct sock *sk); | 557 | bool tcp_schedule_loss_probe(struct sock *sk); |
| 545 | extern bool tcp_schedule_loss_probe(struct sock *sk); | ||
| 546 | 558 | ||
| 547 | /* tcp_input.c */ | 559 | /* tcp_input.c */ |
| 548 | extern void tcp_cwnd_application_limited(struct sock *sk); | 560 | void tcp_cwnd_application_limited(struct sock *sk); |
| 549 | extern void tcp_resume_early_retransmit(struct sock *sk); | 561 | void tcp_resume_early_retransmit(struct sock *sk); |
| 550 | extern void tcp_rearm_rto(struct sock *sk); | 562 | void tcp_rearm_rto(struct sock *sk); |
| 551 | extern void tcp_reset(struct sock *sk); | 563 | void tcp_reset(struct sock *sk); |
| 552 | 564 | ||
| 553 | /* tcp_timer.c */ | 565 | /* tcp_timer.c */ |
| 554 | extern void tcp_init_xmit_timers(struct sock *); | 566 | void tcp_init_xmit_timers(struct sock *); |
| 555 | static inline void tcp_clear_xmit_timers(struct sock *sk) | 567 | static inline void tcp_clear_xmit_timers(struct sock *sk) |
| 556 | { | 568 | { |
| 557 | inet_csk_clear_xmit_timers(sk); | 569 | inet_csk_clear_xmit_timers(sk); |
| 558 | } | 570 | } |
| 559 | 571 | ||
| 560 | extern unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu); | 572 | unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu); |
| 561 | extern unsigned int tcp_current_mss(struct sock *sk); | 573 | unsigned int tcp_current_mss(struct sock *sk); |
| 562 | 574 | ||
| 563 | /* Bound MSS / TSO packet size with the half of the window */ | 575 | /* Bound MSS / TSO packet size with the half of the window */ |
| 564 | static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) | 576 | static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) |
| @@ -584,20 +596,20 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) | |||
| 584 | } | 596 | } |
| 585 | 597 | ||
| 586 | /* tcp.c */ | 598 | /* tcp.c */ |
| 587 | extern void tcp_get_info(const struct sock *, struct tcp_info *); | 599 | void tcp_get_info(const struct sock *, struct tcp_info *); |
| 588 | 600 | ||
| 589 | /* Read 'sendfile()'-style from a TCP socket */ | 601 | /* Read 'sendfile()'-style from a TCP socket */ |
| 590 | typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, | 602 | typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, |
| 591 | unsigned int, size_t); | 603 | unsigned int, size_t); |
| 592 | extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | 604 | int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, |
| 593 | sk_read_actor_t recv_actor); | 605 | sk_read_actor_t recv_actor); |
| 594 | 606 | ||
| 595 | extern void tcp_initialize_rcv_mss(struct sock *sk); | 607 | void tcp_initialize_rcv_mss(struct sock *sk); |
| 596 | 608 | ||
| 597 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | 609 | int tcp_mtu_to_mss(struct sock *sk, int pmtu); |
| 598 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | 610 | int tcp_mss_to_mtu(struct sock *sk, int mss); |
| 599 | extern void tcp_mtup_init(struct sock *sk); | 611 | void tcp_mtup_init(struct sock *sk); |
| 600 | extern void tcp_init_buffer_space(struct sock *sk); | 612 | void tcp_init_buffer_space(struct sock *sk); |
| 601 | 613 | ||
| 602 | static inline void tcp_bound_rto(const struct sock *sk) | 614 | static inline void tcp_bound_rto(const struct sock *sk) |
| 603 | { | 615 | { |
| @@ -610,7 +622,7 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp) | |||
| 610 | return (tp->srtt >> 3) + tp->rttvar; | 622 | return (tp->srtt >> 3) + tp->rttvar; |
| 611 | } | 623 | } |
| 612 | 624 | ||
| 613 | extern void tcp_set_rto(struct sock *sk); | 625 | void tcp_set_rto(struct sock *sk); |
| 614 | 626 | ||
| 615 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 627 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
| 616 | { | 628 | { |
| @@ -663,7 +675,7 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp) | |||
| 663 | * scaling applied to the result. The caller does these things | 675 | * scaling applied to the result. The caller does these things |
| 664 | * if necessary. This is a "raw" window selection. | 676 | * if necessary. This is a "raw" window selection. |
| 665 | */ | 677 | */ |
| 666 | extern u32 __tcp_select_window(struct sock *sk); | 678 | u32 __tcp_select_window(struct sock *sk); |
| 667 | 679 | ||
| 668 | void tcp_send_window_probe(struct sock *sk); | 680 | void tcp_send_window_probe(struct sock *sk); |
| 669 | 681 | ||
| @@ -784,7 +796,7 @@ struct tcp_congestion_ops { | |||
| 784 | /* lower bound for congestion window (optional) */ | 796 | /* lower bound for congestion window (optional) */ |
| 785 | u32 (*min_cwnd)(const struct sock *sk); | 797 | u32 (*min_cwnd)(const struct sock *sk); |
| 786 | /* do new cwnd calculation (required) */ | 798 | /* do new cwnd calculation (required) */ |
| 787 | void (*cong_avoid)(struct sock *sk, u32 ack, u32 in_flight); | 799 | void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked, u32 in_flight); |
| 788 | /* call before changing ca_state (optional) */ | 800 | /* call before changing ca_state (optional) */ |
| 789 | void (*set_state)(struct sock *sk, u8 new_state); | 801 | void (*set_state)(struct sock *sk, u8 new_state); |
| 790 | /* call when cwnd event occurs (optional) */ | 802 | /* call when cwnd event occurs (optional) */ |
| @@ -800,24 +812,24 @@ struct tcp_congestion_ops { | |||
| 800 | struct module *owner; | 812 | struct module *owner; |
| 801 | }; | 813 | }; |
| 802 | 814 | ||
| 803 | extern int tcp_register_congestion_control(struct tcp_congestion_ops *type); | 815 | int tcp_register_congestion_control(struct tcp_congestion_ops *type); |
| 804 | extern void tcp_unregister_congestion_control(struct tcp_congestion_ops *type); | 816 | void tcp_unregister_congestion_control(struct tcp_congestion_ops *type); |
| 805 | 817 | ||
| 806 | extern void tcp_init_congestion_control(struct sock *sk); | 818 | void tcp_init_congestion_control(struct sock *sk); |
| 807 | extern void tcp_cleanup_congestion_control(struct sock *sk); | 819 | void tcp_cleanup_congestion_control(struct sock *sk); |
| 808 | extern int tcp_set_default_congestion_control(const char *name); | 820 | int tcp_set_default_congestion_control(const char *name); |
| 809 | extern void tcp_get_default_congestion_control(char *name); | 821 | void tcp_get_default_congestion_control(char *name); |
| 810 | extern void tcp_get_available_congestion_control(char *buf, size_t len); | 822 | void tcp_get_available_congestion_control(char *buf, size_t len); |
| 811 | extern void tcp_get_allowed_congestion_control(char *buf, size_t len); | 823 | void tcp_get_allowed_congestion_control(char *buf, size_t len); |
| 812 | extern int tcp_set_allowed_congestion_control(char *allowed); | 824 | int tcp_set_allowed_congestion_control(char *allowed); |
| 813 | extern int tcp_set_congestion_control(struct sock *sk, const char *name); | 825 | int tcp_set_congestion_control(struct sock *sk, const char *name); |
| 814 | extern void tcp_slow_start(struct tcp_sock *tp); | 826 | int tcp_slow_start(struct tcp_sock *tp, u32 acked); |
| 815 | extern void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w); | 827 | void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w); |
| 816 | 828 | ||
| 817 | extern struct tcp_congestion_ops tcp_init_congestion_ops; | 829 | extern struct tcp_congestion_ops tcp_init_congestion_ops; |
| 818 | extern u32 tcp_reno_ssthresh(struct sock *sk); | 830 | u32 tcp_reno_ssthresh(struct sock *sk); |
| 819 | extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight); | 831 | void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked, u32 in_flight); |
| 820 | extern u32 tcp_reno_min_cwnd(const struct sock *sk); | 832 | u32 tcp_reno_min_cwnd(const struct sock *sk); |
| 821 | extern struct tcp_congestion_ops tcp_reno; | 833 | extern struct tcp_congestion_ops tcp_reno; |
| 822 | 834 | ||
| 823 | static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) | 835 | static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) |
| @@ -936,8 +948,8 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) | |||
| 936 | /* Use define here intentionally to get WARN_ON location shown at the caller */ | 948 | /* Use define here intentionally to get WARN_ON location shown at the caller */ |
| 937 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) | 949 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) |
| 938 | 950 | ||
| 939 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); | 951 | void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); |
| 940 | extern __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst); | 952 | __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst); |
| 941 | 953 | ||
| 942 | /* The maximum number of MSS of available cwnd for which TSO defers | 954 | /* The maximum number of MSS of available cwnd for which TSO defers |
| 943 | * sending if not using sysctl_tcp_tso_win_divisor. | 955 | * sending if not using sysctl_tcp_tso_win_divisor. |
| @@ -963,7 +975,7 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp) | |||
| 963 | { | 975 | { |
| 964 | return tp->snd_una + tp->snd_wnd; | 976 | return tp->snd_una + tp->snd_wnd; |
| 965 | } | 977 | } |
| 966 | extern bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); | 978 | bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); |
| 967 | 979 | ||
| 968 | static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, | 980 | static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, |
| 969 | const struct sk_buff *skb) | 981 | const struct sk_buff *skb) |
| @@ -1028,7 +1040,7 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp) | |||
| 1028 | #endif | 1040 | #endif |
| 1029 | } | 1041 | } |
| 1030 | 1042 | ||
| 1031 | extern bool tcp_prequeue(struct sock *sk, struct sk_buff *skb); | 1043 | bool tcp_prequeue(struct sock *sk, struct sk_buff *skb); |
| 1032 | 1044 | ||
| 1033 | #undef STATE_TRACE | 1045 | #undef STATE_TRACE |
| 1034 | 1046 | ||
| @@ -1039,9 +1051,9 @@ static const char *statename[]={ | |||
| 1039 | "Close Wait","Last ACK","Listen","Closing" | 1051 | "Close Wait","Last ACK","Listen","Closing" |
| 1040 | }; | 1052 | }; |
| 1041 | #endif | 1053 | #endif |
| 1042 | extern void tcp_set_state(struct sock *sk, int state); | 1054 | void tcp_set_state(struct sock *sk, int state); |
| 1043 | 1055 | ||
| 1044 | extern void tcp_done(struct sock *sk); | 1056 | void tcp_done(struct sock *sk); |
| 1045 | 1057 | ||
| 1046 | static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) | 1058 | static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) |
| 1047 | { | 1059 | { |
| @@ -1049,13 +1061,12 @@ static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) | |||
| 1049 | rx_opt->num_sacks = 0; | 1061 | rx_opt->num_sacks = 0; |
| 1050 | } | 1062 | } |
| 1051 | 1063 | ||
| 1052 | extern u32 tcp_default_init_rwnd(u32 mss); | 1064 | u32 tcp_default_init_rwnd(u32 mss); |
| 1053 | 1065 | ||
| 1054 | /* Determine a window scaling and initial window to offer. */ | 1066 | /* Determine a window scaling and initial window to offer. */ |
| 1055 | extern void tcp_select_initial_window(int __space, __u32 mss, | 1067 | void tcp_select_initial_window(int __space, __u32 mss, __u32 *rcv_wnd, |
| 1056 | __u32 *rcv_wnd, __u32 *window_clamp, | 1068 | __u32 *window_clamp, int wscale_ok, |
| 1057 | int wscale_ok, __u8 *rcv_wscale, | 1069 | __u8 *rcv_wscale, __u32 init_rcv_wnd); |
| 1058 | __u32 init_rcv_wnd); | ||
| 1059 | 1070 | ||
| 1060 | static inline int tcp_win_from_space(int space) | 1071 | static inline int tcp_win_from_space(int space) |
| 1061 | { | 1072 | { |
| @@ -1095,11 +1106,11 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
| 1095 | ireq->wscale_ok = rx_opt->wscale_ok; | 1106 | ireq->wscale_ok = rx_opt->wscale_ok; |
| 1096 | ireq->acked = 0; | 1107 | ireq->acked = 0; |
| 1097 | ireq->ecn_ok = 0; | 1108 | ireq->ecn_ok = 0; |
| 1098 | ireq->rmt_port = tcp_hdr(skb)->source; | 1109 | ireq->ir_rmt_port = tcp_hdr(skb)->source; |
| 1099 | ireq->loc_port = tcp_hdr(skb)->dest; | 1110 | ireq->ir_num = ntohs(tcp_hdr(skb)->dest); |
| 1100 | } | 1111 | } |
| 1101 | 1112 | ||
| 1102 | extern void tcp_enter_memory_pressure(struct sock *sk); | 1113 | void tcp_enter_memory_pressure(struct sock *sk); |
| 1103 | 1114 | ||
| 1104 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) | 1115 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) |
| 1105 | { | 1116 | { |
| @@ -1252,21 +1263,20 @@ struct tcp_md5sig_pool { | |||
| 1252 | }; | 1263 | }; |
| 1253 | 1264 | ||
| 1254 | /* - functions */ | 1265 | /* - functions */ |
| 1255 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, | 1266 | int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, |
| 1256 | const struct sock *sk, | 1267 | const struct sock *sk, const struct request_sock *req, |
| 1257 | const struct request_sock *req, | 1268 | const struct sk_buff *skb); |
| 1258 | const struct sk_buff *skb); | 1269 | int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, |
| 1259 | extern int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, | 1270 | int family, const u8 *newkey, u8 newkeylen, gfp_t gfp); |
| 1260 | int family, const u8 *newkey, | 1271 | int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr, |
| 1261 | u8 newkeylen, gfp_t gfp); | 1272 | int family); |
| 1262 | extern int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr, | 1273 | struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, |
| 1263 | int family); | ||
| 1264 | extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, | ||
| 1265 | struct sock *addr_sk); | 1274 | struct sock *addr_sk); |
| 1266 | 1275 | ||
| 1267 | #ifdef CONFIG_TCP_MD5SIG | 1276 | #ifdef CONFIG_TCP_MD5SIG |
| 1268 | extern struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, | 1277 | struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, |
| 1269 | const union tcp_md5_addr *addr, int family); | 1278 | const union tcp_md5_addr *addr, |
| 1279 | int family); | ||
| 1270 | #define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key) | 1280 | #define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key) |
| 1271 | #else | 1281 | #else |
| 1272 | static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, | 1282 | static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, |
| @@ -1278,27 +1288,26 @@ static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, | |||
| 1278 | #define tcp_twsk_md5_key(twsk) NULL | 1288 | #define tcp_twsk_md5_key(twsk) NULL |
| 1279 | #endif | 1289 | #endif |
| 1280 | 1290 | ||
| 1281 | extern bool tcp_alloc_md5sig_pool(void); | 1291 | bool tcp_alloc_md5sig_pool(void); |
| 1282 | 1292 | ||
| 1283 | extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); | 1293 | struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); |
| 1284 | static inline void tcp_put_md5sig_pool(void) | 1294 | static inline void tcp_put_md5sig_pool(void) |
| 1285 | { | 1295 | { |
| 1286 | local_bh_enable(); | 1296 | local_bh_enable(); |
| 1287 | } | 1297 | } |
| 1288 | 1298 | ||
| 1289 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *); | 1299 | int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *); |
| 1290 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *, | 1300 | int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *, |
| 1291 | unsigned int header_len); | 1301 | unsigned int header_len); |
| 1292 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1302 | int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
| 1293 | const struct tcp_md5sig_key *key); | 1303 | const struct tcp_md5sig_key *key); |
| 1294 | 1304 | ||
| 1295 | /* From tcp_fastopen.c */ | 1305 | /* From tcp_fastopen.c */ |
| 1296 | extern void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | 1306 | void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, |
| 1297 | struct tcp_fastopen_cookie *cookie, | 1307 | struct tcp_fastopen_cookie *cookie, int *syn_loss, |
| 1298 | int *syn_loss, unsigned long *last_syn_loss); | 1308 | unsigned long *last_syn_loss); |
| 1299 | extern void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | 1309 | void tcp_fastopen_cache_set(struct sock *sk, u16 mss, |
| 1300 | struct tcp_fastopen_cookie *cookie, | 1310 | struct tcp_fastopen_cookie *cookie, bool syn_lost); |
| 1301 | bool syn_lost); | ||
| 1302 | struct tcp_fastopen_request { | 1311 | struct tcp_fastopen_request { |
| 1303 | /* Fast Open cookie. Size 0 means a cookie request */ | 1312 | /* Fast Open cookie. Size 0 means a cookie request */ |
| 1304 | struct tcp_fastopen_cookie cookie; | 1313 | struct tcp_fastopen_cookie cookie; |
| @@ -1309,9 +1318,9 @@ void tcp_free_fastopen_req(struct tcp_sock *tp); | |||
| 1309 | 1318 | ||
| 1310 | extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; | 1319 | extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; |
| 1311 | int tcp_fastopen_reset_cipher(void *key, unsigned int len); | 1320 | int tcp_fastopen_reset_cipher(void *key, unsigned int len); |
| 1312 | extern void tcp_fastopen_cookie_gen(__be32 src, __be32 dst, | 1321 | void tcp_fastopen_cookie_gen(__be32 src, __be32 dst, |
| 1313 | struct tcp_fastopen_cookie *foc); | 1322 | struct tcp_fastopen_cookie *foc); |
| 1314 | 1323 | void tcp_fastopen_init_key_once(bool publish); | |
| 1315 | #define TCP_FASTOPEN_KEY_LENGTH 16 | 1324 | #define TCP_FASTOPEN_KEY_LENGTH 16 |
| 1316 | 1325 | ||
| 1317 | /* Fastopen key context */ | 1326 | /* Fastopen key context */ |
| @@ -1507,7 +1516,6 @@ enum tcp_seq_states { | |||
| 1507 | TCP_SEQ_STATE_LISTENING, | 1516 | TCP_SEQ_STATE_LISTENING, |
| 1508 | TCP_SEQ_STATE_OPENREQ, | 1517 | TCP_SEQ_STATE_OPENREQ, |
| 1509 | TCP_SEQ_STATE_ESTABLISHED, | 1518 | TCP_SEQ_STATE_ESTABLISHED, |
| 1510 | TCP_SEQ_STATE_TIME_WAIT, | ||
| 1511 | }; | 1519 | }; |
| 1512 | 1520 | ||
| 1513 | int tcp_seq_open(struct inode *inode, struct file *file); | 1521 | int tcp_seq_open(struct inode *inode, struct file *file); |
| @@ -1529,22 +1537,20 @@ struct tcp_iter_state { | |||
| 1529 | loff_t last_pos; | 1537 | loff_t last_pos; |
| 1530 | }; | 1538 | }; |
| 1531 | 1539 | ||
| 1532 | extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo); | 1540 | int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo); |
| 1533 | extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo); | 1541 | void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo); |
| 1534 | 1542 | ||
| 1535 | extern struct request_sock_ops tcp_request_sock_ops; | 1543 | extern struct request_sock_ops tcp_request_sock_ops; |
| 1536 | extern struct request_sock_ops tcp6_request_sock_ops; | 1544 | extern struct request_sock_ops tcp6_request_sock_ops; |
| 1537 | 1545 | ||
| 1538 | extern void tcp_v4_destroy_sock(struct sock *sk); | 1546 | void tcp_v4_destroy_sock(struct sock *sk); |
| 1539 | 1547 | ||
| 1540 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, | 1548 | struct sk_buff *tcp_gso_segment(struct sk_buff *skb, |
| 1541 | netdev_features_t features); | 1549 | netdev_features_t features); |
| 1542 | extern struct sk_buff **tcp_gro_receive(struct sk_buff **head, | 1550 | struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb); |
| 1543 | struct sk_buff *skb); | 1551 | int tcp_gro_complete(struct sk_buff *skb); |
| 1544 | extern int tcp_gro_complete(struct sk_buff *skb); | ||
| 1545 | 1552 | ||
| 1546 | extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, | 1553 | void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, __be32 daddr); |
| 1547 | __be32 daddr); | ||
| 1548 | 1554 | ||
| 1549 | static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) | 1555 | static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) |
| 1550 | { | 1556 | { |
| @@ -1560,8 +1566,8 @@ static inline bool tcp_stream_memory_free(const struct sock *sk) | |||
| 1560 | } | 1566 | } |
| 1561 | 1567 | ||
| 1562 | #ifdef CONFIG_PROC_FS | 1568 | #ifdef CONFIG_PROC_FS |
| 1563 | extern int tcp4_proc_init(void); | 1569 | int tcp4_proc_init(void); |
| 1564 | extern void tcp4_proc_exit(void); | 1570 | void tcp4_proc_exit(void); |
| 1565 | #endif | 1571 | #endif |
| 1566 | 1572 | ||
| 1567 | /* TCP af-specific functions */ | 1573 | /* TCP af-specific functions */ |
| @@ -1592,9 +1598,9 @@ struct tcp_request_sock_ops { | |||
| 1592 | #endif | 1598 | #endif |
| 1593 | }; | 1599 | }; |
| 1594 | 1600 | ||
| 1595 | extern int tcpv4_offload_init(void); | 1601 | int tcpv4_offload_init(void); |
| 1596 | 1602 | ||
| 1597 | extern void tcp_v4_init(void); | 1603 | void tcp_v4_init(void); |
| 1598 | extern void tcp_init(void); | 1604 | void tcp_init(void); |
| 1599 | 1605 | ||
| 1600 | #endif /* _TCP_H */ | 1606 | #endif /* _TCP_H */ |
diff --git a/include/net/tcp_memcontrol.h b/include/net/tcp_memcontrol.h index 7df18bc43a97..05b94d9453de 100644 --- a/include/net/tcp_memcontrol.h +++ b/include/net/tcp_memcontrol.h | |||
| @@ -1,19 +1,7 @@ | |||
| 1 | #ifndef _TCP_MEMCG_H | 1 | #ifndef _TCP_MEMCG_H |
| 2 | #define _TCP_MEMCG_H | 2 | #define _TCP_MEMCG_H |
| 3 | 3 | ||
| 4 | struct tcp_memcontrol { | ||
| 5 | struct cg_proto cg_proto; | ||
| 6 | /* per-cgroup tcp memory pressure knobs */ | ||
| 7 | struct res_counter tcp_memory_allocated; | ||
| 8 | struct percpu_counter tcp_sockets_allocated; | ||
| 9 | /* those two are read-mostly, leave them at the end */ | ||
| 10 | long tcp_prot_mem[3]; | ||
| 11 | int tcp_memory_pressure; | ||
| 12 | }; | ||
| 13 | |||
| 14 | struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg); | 4 | struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg); |
| 15 | int tcp_init_cgroup(struct mem_cgroup *memcg, struct cgroup_subsys *ss); | 5 | int tcp_init_cgroup(struct mem_cgroup *memcg, struct cgroup_subsys *ss); |
| 16 | void tcp_destroy_cgroup(struct mem_cgroup *memcg); | 6 | void tcp_destroy_cgroup(struct mem_cgroup *memcg); |
| 17 | unsigned long long tcp_max_memory(const struct mem_cgroup *memcg); | ||
| 18 | void tcp_prot_mem(struct mem_cgroup *memcg, long val, int idx); | ||
| 19 | #endif /* _TCP_MEMCG_H */ | 7 | #endif /* _TCP_MEMCG_H */ |
diff --git a/include/net/udp.h b/include/net/udp.h index ef2e0b7843a0..a24f0f3e107f 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
| @@ -79,7 +79,7 @@ struct udp_table { | |||
| 79 | unsigned int log; | 79 | unsigned int log; |
| 80 | }; | 80 | }; |
| 81 | extern struct udp_table udp_table; | 81 | extern struct udp_table udp_table; |
| 82 | extern void udp_table_init(struct udp_table *, const char *); | 82 | void udp_table_init(struct udp_table *, const char *); |
| 83 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, | 83 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, |
| 84 | struct net *net, unsigned int num) | 84 | struct net *net, unsigned int num) |
| 85 | { | 85 | { |
| @@ -162,52 +162,53 @@ static inline void udp_lib_hash(struct sock *sk) | |||
| 162 | BUG(); | 162 | BUG(); |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | extern void udp_lib_unhash(struct sock *sk); | 165 | void udp_lib_unhash(struct sock *sk); |
| 166 | extern void udp_lib_rehash(struct sock *sk, u16 new_hash); | 166 | void udp_lib_rehash(struct sock *sk, u16 new_hash); |
| 167 | 167 | ||
| 168 | static inline void udp_lib_close(struct sock *sk, long timeout) | 168 | static inline void udp_lib_close(struct sock *sk, long timeout) |
| 169 | { | 169 | { |
| 170 | sk_common_release(sk); | 170 | sk_common_release(sk); |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, | 173 | int udp_lib_get_port(struct sock *sk, unsigned short snum, |
| 174 | int (*)(const struct sock *,const struct sock *), | 174 | int (*)(const struct sock *, const struct sock *), |
| 175 | unsigned int hash2_nulladdr); | 175 | unsigned int hash2_nulladdr); |
| 176 | 176 | ||
| 177 | /* net/ipv4/udp.c */ | 177 | /* net/ipv4/udp.c */ |
| 178 | extern int udp_get_port(struct sock *sk, unsigned short snum, | 178 | void udp_v4_early_demux(struct sk_buff *skb); |
| 179 | int (*saddr_cmp)(const struct sock *, | 179 | int udp_get_port(struct sock *sk, unsigned short snum, |
| 180 | const struct sock *)); | 180 | int (*saddr_cmp)(const struct sock *, |
| 181 | extern void udp_err(struct sk_buff *, u32); | 181 | const struct sock *)); |
| 182 | extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, | 182 | void udp_err(struct sk_buff *, u32); |
| 183 | struct msghdr *msg, size_t len); | 183 | int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
| 184 | extern int udp_push_pending_frames(struct sock *sk); | 184 | size_t len); |
| 185 | extern void udp_flush_pending_frames(struct sock *sk); | 185 | int udp_push_pending_frames(struct sock *sk); |
| 186 | extern void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst); | 186 | void udp_flush_pending_frames(struct sock *sk); |
| 187 | extern int udp_rcv(struct sk_buff *skb); | 187 | void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst); |
| 188 | extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 188 | int udp_rcv(struct sk_buff *skb); |
| 189 | extern int udp_disconnect(struct sock *sk, int flags); | 189 | int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
| 190 | extern unsigned int udp_poll(struct file *file, struct socket *sock, | 190 | int udp_disconnect(struct sock *sk, int flags); |
| 191 | poll_table *wait); | 191 | unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait); |
| 192 | extern struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | 192 | struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, |
| 193 | netdev_features_t features); | 193 | netdev_features_t features); |
| 194 | extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, | 194 | int udp_lib_getsockopt(struct sock *sk, int level, int optname, |
| 195 | char __user *optval, int __user *optlen); | 195 | char __user *optval, int __user *optlen); |
| 196 | extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | 196 | int udp_lib_setsockopt(struct sock *sk, int level, int optname, |
| 197 | char __user *optval, unsigned int optlen, | 197 | char __user *optval, unsigned int optlen, |
| 198 | int (*push_pending_frames)(struct sock *)); | 198 | int (*push_pending_frames)(struct sock *)); |
| 199 | extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | 199 | struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, |
| 200 | __be32 daddr, __be16 dport, | 200 | __be32 daddr, __be16 dport, int dif); |
| 201 | int dif); | 201 | struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, |
| 202 | extern struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | 202 | __be32 daddr, __be16 dport, int dif, |
| 203 | __be32 daddr, __be16 dport, | 203 | struct udp_table *tbl); |
| 204 | int dif, struct udp_table *tbl); | 204 | struct sock *udp6_lib_lookup(struct net *net, |
| 205 | extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport, | 205 | const struct in6_addr *saddr, __be16 sport, |
| 206 | const struct in6_addr *daddr, __be16 dport, | 206 | const struct in6_addr *daddr, __be16 dport, |
| 207 | int dif); | 207 | int dif); |
| 208 | extern struct sock *__udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport, | 208 | struct sock *__udp6_lib_lookup(struct net *net, |
| 209 | const struct in6_addr *daddr, __be16 dport, | 209 | const struct in6_addr *saddr, __be16 sport, |
| 210 | int dif, struct udp_table *tbl); | 210 | const struct in6_addr *daddr, __be16 dport, |
| 211 | int dif, struct udp_table *tbl); | ||
| 211 | 212 | ||
| 212 | /* | 213 | /* |
| 213 | * SNMP statistics for UDP and UDP-Lite | 214 | * SNMP statistics for UDP and UDP-Lite |
| @@ -229,13 +230,13 @@ extern struct sock *__udp6_lib_lookup(struct net *net, const struct in6_addr *sa | |||
| 229 | } while(0) | 230 | } while(0) |
| 230 | 231 | ||
| 231 | #if IS_ENABLED(CONFIG_IPV6) | 232 | #if IS_ENABLED(CONFIG_IPV6) |
| 232 | #define UDPX_INC_STATS_BH(sk, field) \ | 233 | #define UDPX_INC_STATS_BH(sk, field) \ |
| 233 | do { \ | 234 | do { \ |
| 234 | if ((sk)->sk_family == AF_INET) \ | 235 | if ((sk)->sk_family == AF_INET) \ |
| 235 | UDP_INC_STATS_BH(sock_net(sk), field, 0); \ | 236 | UDP_INC_STATS_BH(sock_net(sk), field, 0); \ |
| 236 | else \ | 237 | else \ |
| 237 | UDP6_INC_STATS_BH(sock_net(sk), field, 0); \ | 238 | UDP6_INC_STATS_BH(sock_net(sk), field, 0); \ |
| 238 | } while (0); | 239 | } while (0) |
| 239 | #else | 240 | #else |
| 240 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0) | 241 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0) |
| 241 | #endif | 242 | #endif |
| @@ -259,19 +260,19 @@ struct udp_iter_state { | |||
| 259 | }; | 260 | }; |
| 260 | 261 | ||
| 261 | #ifdef CONFIG_PROC_FS | 262 | #ifdef CONFIG_PROC_FS |
| 262 | extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); | 263 | int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); |
| 263 | extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); | 264 | void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); |
| 264 | 265 | ||
| 265 | extern int udp4_proc_init(void); | 266 | int udp4_proc_init(void); |
| 266 | extern void udp4_proc_exit(void); | 267 | void udp4_proc_exit(void); |
| 267 | #endif | 268 | #endif |
| 268 | 269 | ||
| 269 | extern int udpv4_offload_init(void); | 270 | int udpv4_offload_init(void); |
| 270 | 271 | ||
| 271 | extern void udp_init(void); | 272 | void udp_init(void); |
| 272 | 273 | ||
| 273 | extern void udp_encap_enable(void); | 274 | void udp_encap_enable(void); |
| 274 | #if IS_ENABLED(CONFIG_IPV6) | 275 | #if IS_ENABLED(CONFIG_IPV6) |
| 275 | extern void udpv6_encap_enable(void); | 276 | void udpv6_encap_enable(void); |
| 276 | #endif | 277 | #endif |
| 277 | #endif /* _UDP_H */ | 278 | #endif /* _UDP_H */ |
diff --git a/include/net/udplite.h b/include/net/udplite.h index 71375459a884..2caadabcd07b 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h | |||
| @@ -126,7 +126,7 @@ static inline __wsum udplite_csum(struct sk_buff *skb) | |||
| 126 | return skb_checksum(skb, off, len, 0); | 126 | return skb_checksum(skb, off, len, 0); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | extern void udplite4_register(void); | 129 | void udplite4_register(void); |
| 130 | extern int udplite_get_port(struct sock *sk, unsigned short snum, | 130 | int udplite_get_port(struct sock *sk, unsigned short snum, |
| 131 | int (*scmp)(const struct sock *, const struct sock *)); | 131 | int (*scmp)(const struct sock *, const struct sock *)); |
| 132 | #endif /* _UDPLITE_H */ | 132 | #endif /* _UDPLITE_H */ |
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 2d64d3cd4999..6b6d180fb91a 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
| @@ -36,5 +36,16 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, | |||
| 36 | 36 | ||
| 37 | __be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); | 37 | __be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); |
| 38 | 38 | ||
| 39 | /* IP header + UDP + VXLAN + Ethernet header */ | ||
| 40 | #define VXLAN_HEADROOM (20 + 8 + 8 + 14) | ||
| 41 | /* IPv6 header + UDP + VXLAN + Ethernet header */ | ||
| 42 | #define VXLAN6_HEADROOM (40 + 8 + 8 + 14) | ||
| 43 | |||
| 44 | #if IS_ENABLED(CONFIG_VXLAN) | ||
| 39 | void vxlan_get_rx_port(struct net_device *netdev); | 45 | void vxlan_get_rx_port(struct net_device *netdev); |
| 46 | #else | ||
| 47 | static inline void vxlan_get_rx_port(struct net_device *netdev) | ||
| 48 | { | ||
| 49 | } | ||
| 50 | #endif | ||
| 40 | #endif | 51 | #endif |
diff --git a/include/net/wext.h b/include/net/wext.h index 4f6e7423174c..345911965dbb 100644 --- a/include/net/wext.h +++ b/include/net/wext.h | |||
| @@ -6,13 +6,13 @@ | |||
| 6 | struct net; | 6 | struct net; |
| 7 | 7 | ||
| 8 | #ifdef CONFIG_WEXT_CORE | 8 | #ifdef CONFIG_WEXT_CORE |
| 9 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 9 | int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
| 10 | void __user *arg); | 10 | void __user *arg); |
| 11 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | 11 | int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, |
| 12 | unsigned long arg); | 12 | unsigned long arg); |
| 13 | 13 | ||
| 14 | extern struct iw_statistics *get_wireless_stats(struct net_device *dev); | 14 | struct iw_statistics *get_wireless_stats(struct net_device *dev); |
| 15 | extern int call_commit_handler(struct net_device *dev); | 15 | int call_commit_handler(struct net_device *dev); |
| 16 | #else | 16 | #else |
| 17 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 17 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
| 18 | void __user *arg) | 18 | void __user *arg) |
| @@ -27,8 +27,8 @@ static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | |||
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | #ifdef CONFIG_WEXT_PROC | 29 | #ifdef CONFIG_WEXT_PROC |
| 30 | extern int wext_proc_init(struct net *net); | 30 | int wext_proc_init(struct net *net); |
| 31 | extern void wext_proc_exit(struct net *net); | 31 | void wext_proc_exit(struct net *net); |
| 32 | #else | 32 | #else |
| 33 | static inline int wext_proc_init(struct net *net) | 33 | static inline int wext_proc_init(struct net *net) |
| 34 | { | 34 | { |
diff --git a/include/net/wimax.h b/include/net/wimax.h index bbb74f990cab..98498e1daa06 100644 --- a/include/net/wimax.h +++ b/include/net/wimax.h | |||
| @@ -438,9 +438,9 @@ struct wimax_dev { | |||
| 438 | * | 438 | * |
| 439 | * These functions are not exported to user space. | 439 | * These functions are not exported to user space. |
| 440 | */ | 440 | */ |
| 441 | extern void wimax_dev_init(struct wimax_dev *); | 441 | void wimax_dev_init(struct wimax_dev *); |
| 442 | extern int wimax_dev_add(struct wimax_dev *, struct net_device *); | 442 | int wimax_dev_add(struct wimax_dev *, struct net_device *); |
| 443 | extern void wimax_dev_rm(struct wimax_dev *); | 443 | void wimax_dev_rm(struct wimax_dev *); |
| 444 | 444 | ||
| 445 | static inline | 445 | static inline |
| 446 | struct wimax_dev *net_dev_to_wimax(struct net_device *net_dev) | 446 | struct wimax_dev *net_dev_to_wimax(struct net_device *net_dev) |
| @@ -454,8 +454,8 @@ struct device *wimax_dev_to_dev(struct wimax_dev *wimax_dev) | |||
| 454 | return wimax_dev->net_dev->dev.parent; | 454 | return wimax_dev->net_dev->dev.parent; |
| 455 | } | 455 | } |
| 456 | 456 | ||
| 457 | extern void wimax_state_change(struct wimax_dev *, enum wimax_st); | 457 | void wimax_state_change(struct wimax_dev *, enum wimax_st); |
| 458 | extern enum wimax_st wimax_state_get(struct wimax_dev *); | 458 | enum wimax_st wimax_state_get(struct wimax_dev *); |
| 459 | 459 | ||
| 460 | /* | 460 | /* |
| 461 | * Radio Switch state reporting. | 461 | * Radio Switch state reporting. |
| @@ -463,8 +463,8 @@ extern enum wimax_st wimax_state_get(struct wimax_dev *); | |||
| 463 | * enum wimax_rf_state is declared in linux/wimax.h so the exports | 463 | * enum wimax_rf_state is declared in linux/wimax.h so the exports |
| 464 | * to user space can use it. | 464 | * to user space can use it. |
| 465 | */ | 465 | */ |
| 466 | extern void wimax_report_rfkill_hw(struct wimax_dev *, enum wimax_rf_state); | 466 | void wimax_report_rfkill_hw(struct wimax_dev *, enum wimax_rf_state); |
| 467 | extern void wimax_report_rfkill_sw(struct wimax_dev *, enum wimax_rf_state); | 467 | void wimax_report_rfkill_sw(struct wimax_dev *, enum wimax_rf_state); |
| 468 | 468 | ||
| 469 | 469 | ||
| 470 | /* | 470 | /* |
| @@ -490,15 +490,14 @@ extern void wimax_report_rfkill_sw(struct wimax_dev *, enum wimax_rf_state); | |||
| 490 | * send diagnostics information that a device-specific diagnostics | 490 | * send diagnostics information that a device-specific diagnostics |
| 491 | * tool would be interested in. | 491 | * tool would be interested in. |
| 492 | */ | 492 | */ |
| 493 | extern struct sk_buff *wimax_msg_alloc(struct wimax_dev *, const char *, | 493 | struct sk_buff *wimax_msg_alloc(struct wimax_dev *, const char *, const void *, |
| 494 | const void *, size_t, gfp_t); | 494 | size_t, gfp_t); |
| 495 | extern int wimax_msg_send(struct wimax_dev *, struct sk_buff *); | 495 | int wimax_msg_send(struct wimax_dev *, struct sk_buff *); |
| 496 | extern int wimax_msg(struct wimax_dev *, const char *, | 496 | int wimax_msg(struct wimax_dev *, const char *, const void *, size_t, gfp_t); |
| 497 | const void *, size_t, gfp_t); | ||
| 498 | 497 | ||
| 499 | extern const void *wimax_msg_data_len(struct sk_buff *, size_t *); | 498 | const void *wimax_msg_data_len(struct sk_buff *, size_t *); |
| 500 | extern const void *wimax_msg_data(struct sk_buff *); | 499 | const void *wimax_msg_data(struct sk_buff *); |
| 501 | extern ssize_t wimax_msg_len(struct sk_buff *); | 500 | ssize_t wimax_msg_len(struct sk_buff *); |
| 502 | 501 | ||
| 503 | 502 | ||
| 504 | /* | 503 | /* |
| @@ -513,7 +512,7 @@ extern ssize_t wimax_msg_len(struct sk_buff *); | |||
| 513 | * device's control structure and (as such) the 'struct wimax_dev' is | 512 | * device's control structure and (as such) the 'struct wimax_dev' is |
| 514 | * referenced by the caller. | 513 | * referenced by the caller. |
| 515 | */ | 514 | */ |
| 516 | extern int wimax_rfkill(struct wimax_dev *, enum wimax_rf_state); | 515 | int wimax_rfkill(struct wimax_dev *, enum wimax_rf_state); |
| 517 | extern int wimax_reset(struct wimax_dev *); | 516 | int wimax_reset(struct wimax_dev *); |
| 518 | 517 | ||
| 519 | #endif /* #ifndef __NET__WIMAX_H__ */ | 518 | #endif /* #ifndef __NET__WIMAX_H__ */ |
diff --git a/include/net/x25.h b/include/net/x25.h index b4a8a8923128..c383aa4edbf0 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
| @@ -187,57 +187,57 @@ extern int sysctl_x25_clear_request_timeout; | |||
| 187 | extern int sysctl_x25_ack_holdback_timeout; | 187 | extern int sysctl_x25_ack_holdback_timeout; |
| 188 | extern int sysctl_x25_forward; | 188 | extern int sysctl_x25_forward; |
| 189 | 189 | ||
| 190 | extern int x25_parse_address_block(struct sk_buff *skb, | 190 | int x25_parse_address_block(struct sk_buff *skb, |
| 191 | struct x25_address *called_addr, | 191 | struct x25_address *called_addr, |
| 192 | struct x25_address *calling_addr); | 192 | struct x25_address *calling_addr); |
| 193 | 193 | ||
| 194 | extern int x25_addr_ntoa(unsigned char *, struct x25_address *, | 194 | int x25_addr_ntoa(unsigned char *, struct x25_address *, struct x25_address *); |
| 195 | struct x25_address *); | 195 | int x25_addr_aton(unsigned char *, struct x25_address *, struct x25_address *); |
| 196 | extern int x25_addr_aton(unsigned char *, struct x25_address *, | 196 | struct sock *x25_find_socket(unsigned int, struct x25_neigh *); |
| 197 | struct x25_address *); | 197 | void x25_destroy_socket_from_timer(struct sock *); |
| 198 | extern struct sock *x25_find_socket(unsigned int, struct x25_neigh *); | 198 | int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int); |
| 199 | extern void x25_destroy_socket_from_timer(struct sock *); | 199 | void x25_kill_by_neigh(struct x25_neigh *); |
| 200 | extern int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int); | ||
| 201 | extern void x25_kill_by_neigh(struct x25_neigh *); | ||
| 202 | 200 | ||
| 203 | /* x25_dev.c */ | 201 | /* x25_dev.c */ |
| 204 | extern void x25_send_frame(struct sk_buff *, struct x25_neigh *); | 202 | void x25_send_frame(struct sk_buff *, struct x25_neigh *); |
| 205 | extern int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); | 203 | int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, |
| 206 | extern void x25_establish_link(struct x25_neigh *); | 204 | struct packet_type *, struct net_device *); |
| 207 | extern void x25_terminate_link(struct x25_neigh *); | 205 | void x25_establish_link(struct x25_neigh *); |
| 206 | void x25_terminate_link(struct x25_neigh *); | ||
| 208 | 207 | ||
| 209 | /* x25_facilities.c */ | 208 | /* x25_facilities.c */ |
| 210 | extern int x25_parse_facilities(struct sk_buff *, struct x25_facilities *, | 209 | int x25_parse_facilities(struct sk_buff *, struct x25_facilities *, |
| 211 | struct x25_dte_facilities *, unsigned long *); | 210 | struct x25_dte_facilities *, unsigned long *); |
| 212 | extern int x25_create_facilities(unsigned char *, struct x25_facilities *, | 211 | int x25_create_facilities(unsigned char *, struct x25_facilities *, |
| 213 | struct x25_dte_facilities *, unsigned long); | 212 | struct x25_dte_facilities *, unsigned long); |
| 214 | extern int x25_negotiate_facilities(struct sk_buff *, struct sock *, | 213 | int x25_negotiate_facilities(struct sk_buff *, struct sock *, |
| 215 | struct x25_facilities *, | 214 | struct x25_facilities *, |
| 216 | struct x25_dte_facilities *); | 215 | struct x25_dte_facilities *); |
| 217 | extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); | 216 | void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); |
| 218 | 217 | ||
| 219 | /* x25_forward.c */ | 218 | /* x25_forward.c */ |
| 220 | extern void x25_clear_forward_by_lci(unsigned int lci); | 219 | void x25_clear_forward_by_lci(unsigned int lci); |
| 221 | extern void x25_clear_forward_by_dev(struct net_device *); | 220 | void x25_clear_forward_by_dev(struct net_device *); |
| 222 | extern int x25_forward_data(int, struct x25_neigh *, struct sk_buff *); | 221 | int x25_forward_data(int, struct x25_neigh *, struct sk_buff *); |
| 223 | extern int x25_forward_call(struct x25_address *, struct x25_neigh *, | 222 | int x25_forward_call(struct x25_address *, struct x25_neigh *, struct sk_buff *, |
| 224 | struct sk_buff *, int); | 223 | int); |
| 225 | 224 | ||
| 226 | /* x25_in.c */ | 225 | /* x25_in.c */ |
| 227 | extern int x25_process_rx_frame(struct sock *, struct sk_buff *); | 226 | int x25_process_rx_frame(struct sock *, struct sk_buff *); |
| 228 | extern int x25_backlog_rcv(struct sock *, struct sk_buff *); | 227 | int x25_backlog_rcv(struct sock *, struct sk_buff *); |
| 229 | 228 | ||
| 230 | /* x25_link.c */ | 229 | /* x25_link.c */ |
| 231 | extern void x25_link_control(struct sk_buff *, struct x25_neigh *, unsigned short); | 230 | void x25_link_control(struct sk_buff *, struct x25_neigh *, unsigned short); |
| 232 | extern void x25_link_device_up(struct net_device *); | 231 | void x25_link_device_up(struct net_device *); |
| 233 | extern void x25_link_device_down(struct net_device *); | 232 | void x25_link_device_down(struct net_device *); |
| 234 | extern void x25_link_established(struct x25_neigh *); | 233 | void x25_link_established(struct x25_neigh *); |
| 235 | extern void x25_link_terminated(struct x25_neigh *); | 234 | void x25_link_terminated(struct x25_neigh *); |
| 236 | extern void x25_transmit_clear_request(struct x25_neigh *, unsigned int, unsigned char); | 235 | void x25_transmit_clear_request(struct x25_neigh *, unsigned int, |
| 237 | extern void x25_transmit_link(struct sk_buff *, struct x25_neigh *); | 236 | unsigned char); |
| 238 | extern int x25_subscr_ioctl(unsigned int, void __user *); | 237 | void x25_transmit_link(struct sk_buff *, struct x25_neigh *); |
| 239 | extern struct x25_neigh *x25_get_neigh(struct net_device *); | 238 | int x25_subscr_ioctl(unsigned int, void __user *); |
| 240 | extern void x25_link_free(void); | 239 | struct x25_neigh *x25_get_neigh(struct net_device *); |
| 240 | void x25_link_free(void); | ||
| 241 | 241 | ||
| 242 | /* x25_neigh.c */ | 242 | /* x25_neigh.c */ |
| 243 | static __inline__ void x25_neigh_hold(struct x25_neigh *nb) | 243 | static __inline__ void x25_neigh_hold(struct x25_neigh *nb) |
| @@ -252,16 +252,16 @@ static __inline__ void x25_neigh_put(struct x25_neigh *nb) | |||
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | /* x25_out.c */ | 254 | /* x25_out.c */ |
| 255 | extern int x25_output(struct sock *, struct sk_buff *); | 255 | int x25_output(struct sock *, struct sk_buff *); |
| 256 | extern void x25_kick(struct sock *); | 256 | void x25_kick(struct sock *); |
| 257 | extern void x25_enquiry_response(struct sock *); | 257 | void x25_enquiry_response(struct sock *); |
| 258 | 258 | ||
| 259 | /* x25_route.c */ | 259 | /* x25_route.c */ |
| 260 | extern struct x25_route *x25_get_route(struct x25_address *addr); | 260 | struct x25_route *x25_get_route(struct x25_address *addr); |
| 261 | extern struct net_device *x25_dev_get(char *); | 261 | struct net_device *x25_dev_get(char *); |
| 262 | extern void x25_route_device_down(struct net_device *dev); | 262 | void x25_route_device_down(struct net_device *dev); |
| 263 | extern int x25_route_ioctl(unsigned int, void __user *); | 263 | int x25_route_ioctl(unsigned int, void __user *); |
| 264 | extern void x25_route_free(void); | 264 | void x25_route_free(void); |
| 265 | 265 | ||
| 266 | static __inline__ void x25_route_hold(struct x25_route *rt) | 266 | static __inline__ void x25_route_hold(struct x25_route *rt) |
| 267 | { | 267 | { |
| @@ -275,30 +275,31 @@ static __inline__ void x25_route_put(struct x25_route *rt) | |||
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | /* x25_subr.c */ | 277 | /* x25_subr.c */ |
| 278 | extern void x25_clear_queues(struct sock *); | 278 | void x25_clear_queues(struct sock *); |
| 279 | extern void x25_frames_acked(struct sock *, unsigned short); | 279 | void x25_frames_acked(struct sock *, unsigned short); |
| 280 | extern void x25_requeue_frames(struct sock *); | 280 | void x25_requeue_frames(struct sock *); |
| 281 | extern int x25_validate_nr(struct sock *, unsigned short); | 281 | int x25_validate_nr(struct sock *, unsigned short); |
| 282 | extern void x25_write_internal(struct sock *, int); | 282 | void x25_write_internal(struct sock *, int); |
| 283 | extern int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *, int *); | 283 | int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *, |
| 284 | extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char); | 284 | int *); |
| 285 | void x25_disconnect(struct sock *, int, unsigned char, unsigned char); | ||
| 285 | 286 | ||
| 286 | /* x25_timer.c */ | 287 | /* x25_timer.c */ |
| 287 | extern void x25_init_timers(struct sock *sk); | 288 | void x25_init_timers(struct sock *sk); |
| 288 | extern void x25_start_heartbeat(struct sock *); | 289 | void x25_start_heartbeat(struct sock *); |
| 289 | extern void x25_start_t2timer(struct sock *); | 290 | void x25_start_t2timer(struct sock *); |
| 290 | extern void x25_start_t21timer(struct sock *); | 291 | void x25_start_t21timer(struct sock *); |
| 291 | extern void x25_start_t22timer(struct sock *); | 292 | void x25_start_t22timer(struct sock *); |
| 292 | extern void x25_start_t23timer(struct sock *); | 293 | void x25_start_t23timer(struct sock *); |
| 293 | extern void x25_stop_heartbeat(struct sock *); | 294 | void x25_stop_heartbeat(struct sock *); |
| 294 | extern void x25_stop_timer(struct sock *); | 295 | void x25_stop_timer(struct sock *); |
| 295 | extern unsigned long x25_display_timer(struct sock *); | 296 | unsigned long x25_display_timer(struct sock *); |
| 296 | extern void x25_check_rbuf(struct sock *); | 297 | void x25_check_rbuf(struct sock *); |
| 297 | 298 | ||
| 298 | /* sysctl_net_x25.c */ | 299 | /* sysctl_net_x25.c */ |
| 299 | #ifdef CONFIG_SYSCTL | 300 | #ifdef CONFIG_SYSCTL |
| 300 | extern void x25_register_sysctl(void); | 301 | void x25_register_sysctl(void); |
| 301 | extern void x25_unregister_sysctl(void); | 302 | void x25_unregister_sysctl(void); |
| 302 | #else | 303 | #else |
| 303 | static inline void x25_register_sysctl(void) {}; | 304 | static inline void x25_register_sysctl(void) {}; |
| 304 | static inline void x25_unregister_sysctl(void) {}; | 305 | static inline void x25_unregister_sysctl(void) {}; |
| @@ -318,6 +319,6 @@ extern rwlock_t x25_forward_list_lock; | |||
| 318 | extern struct list_head x25_neigh_list; | 319 | extern struct list_head x25_neigh_list; |
| 319 | extern rwlock_t x25_neigh_list_lock; | 320 | extern rwlock_t x25_neigh_list_lock; |
| 320 | 321 | ||
| 321 | extern int x25_proc_init(void); | 322 | int x25_proc_init(void); |
| 322 | extern void x25_proc_exit(void); | 323 | void x25_proc_exit(void); |
| 323 | #endif | 324 | #endif |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e253bf0cc7ef..6b82fdf4ba71 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -307,15 +307,17 @@ struct xfrm_policy_afinfo { | |||
| 307 | struct dst_entry *(*blackhole_route)(struct net *net, struct dst_entry *orig); | 307 | struct dst_entry *(*blackhole_route)(struct net *net, struct dst_entry *orig); |
| 308 | }; | 308 | }; |
| 309 | 309 | ||
| 310 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | 310 | int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); |
| 311 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 311 | int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
| 312 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c); | 312 | void km_policy_notify(struct xfrm_policy *xp, int dir, |
| 313 | extern void km_state_notify(struct xfrm_state *x, const struct km_event *c); | 313 | const struct km_event *c); |
| 314 | void km_state_notify(struct xfrm_state *x, const struct km_event *c); | ||
| 314 | 315 | ||
| 315 | struct xfrm_tmpl; | 316 | struct xfrm_tmpl; |
| 316 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); | 317 | int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, |
| 317 | extern void km_state_expired(struct xfrm_state *x, int hard, u32 portid); | 318 | struct xfrm_policy *pol); |
| 318 | extern int __xfrm_state_delete(struct xfrm_state *x); | 319 | void km_state_expired(struct xfrm_state *x, int hard, u32 portid); |
| 320 | int __xfrm_state_delete(struct xfrm_state *x); | ||
| 319 | 321 | ||
| 320 | struct xfrm_state_afinfo { | 322 | struct xfrm_state_afinfo { |
| 321 | unsigned int family; | 323 | unsigned int family; |
| @@ -344,12 +346,12 @@ struct xfrm_state_afinfo { | |||
| 344 | void (*local_error)(struct sk_buff *skb, u32 mtu); | 346 | void (*local_error)(struct sk_buff *skb, u32 mtu); |
| 345 | }; | 347 | }; |
| 346 | 348 | ||
| 347 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); | 349 | int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); |
| 348 | extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); | 350 | int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); |
| 349 | extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family); | 351 | struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family); |
| 350 | extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo); | 352 | void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo); |
| 351 | 353 | ||
| 352 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); | 354 | void xfrm_state_delete_tunnel(struct xfrm_state *x); |
| 353 | 355 | ||
| 354 | struct xfrm_type { | 356 | struct xfrm_type { |
| 355 | char *description; | 357 | char *description; |
| @@ -372,8 +374,8 @@ struct xfrm_type { | |||
| 372 | u32 (*get_mtu)(struct xfrm_state *, int size); | 374 | u32 (*get_mtu)(struct xfrm_state *, int size); |
| 373 | }; | 375 | }; |
| 374 | 376 | ||
| 375 | extern int xfrm_register_type(const struct xfrm_type *type, unsigned short family); | 377 | int xfrm_register_type(const struct xfrm_type *type, unsigned short family); |
| 376 | extern int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family); | 378 | int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family); |
| 377 | 379 | ||
| 378 | struct xfrm_mode { | 380 | struct xfrm_mode { |
| 379 | /* | 381 | /* |
| @@ -434,8 +436,8 @@ enum { | |||
| 434 | XFRM_MODE_FLAG_TUNNEL = 1, | 436 | XFRM_MODE_FLAG_TUNNEL = 1, |
| 435 | }; | 437 | }; |
| 436 | 438 | ||
| 437 | extern int xfrm_register_mode(struct xfrm_mode *mode, int family); | 439 | int xfrm_register_mode(struct xfrm_mode *mode, int family); |
| 438 | extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family); | 440 | int xfrm_unregister_mode(struct xfrm_mode *mode, int family); |
| 439 | 441 | ||
| 440 | static inline int xfrm_af2proto(unsigned int family) | 442 | static inline int xfrm_af2proto(unsigned int family) |
| 441 | { | 443 | { |
| @@ -595,8 +597,8 @@ struct xfrm_mgr { | |||
| 595 | const struct xfrm_kmaddress *k); | 597 | const struct xfrm_kmaddress *k); |
| 596 | }; | 598 | }; |
| 597 | 599 | ||
| 598 | extern int xfrm_register_km(struct xfrm_mgr *km); | 600 | int xfrm_register_km(struct xfrm_mgr *km); |
| 599 | extern int xfrm_unregister_km(struct xfrm_mgr *km); | 601 | int xfrm_unregister_km(struct xfrm_mgr *km); |
| 600 | 602 | ||
| 601 | /* | 603 | /* |
| 602 | * This structure is used for the duration where packets are being | 604 | * This structure is used for the duration where packets are being |
| @@ -713,23 +715,23 @@ static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, | |||
| 713 | audit_log_task_context(audit_buf); | 715 | audit_log_task_context(audit_buf); |
| 714 | } | 716 | } |
| 715 | 717 | ||
| 716 | extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 718 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, |
| 717 | kuid_t auid, u32 ses, u32 secid); | 719 | u32 ses, u32 secid); |
| 718 | extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 720 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, |
| 719 | kuid_t auid, u32 ses, u32 secid); | 721 | u32 ses, u32 secid); |
| 720 | extern void xfrm_audit_state_add(struct xfrm_state *x, int result, | 722 | void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, |
| 721 | kuid_t auid, u32 ses, u32 secid); | 723 | u32 ses, u32 secid); |
| 722 | extern void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 724 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, |
| 723 | kuid_t auid, u32 ses, u32 secid); | 725 | u32 ses, u32 secid); |
| 724 | extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x, | 726 | void xfrm_audit_state_replay_overflow(struct xfrm_state *x, |
| 725 | struct sk_buff *skb); | 727 | struct sk_buff *skb); |
| 726 | extern void xfrm_audit_state_replay(struct xfrm_state *x, | 728 | void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, |
| 727 | struct sk_buff *skb, __be32 net_seq); | 729 | __be32 net_seq); |
| 728 | extern void xfrm_audit_state_notfound_simple(struct sk_buff *skb, u16 family); | 730 | void xfrm_audit_state_notfound_simple(struct sk_buff *skb, u16 family); |
| 729 | extern void xfrm_audit_state_notfound(struct sk_buff *skb, u16 family, | 731 | void xfrm_audit_state_notfound(struct sk_buff *skb, u16 family, __be32 net_spi, |
| 730 | __be32 net_spi, __be32 net_seq); | 732 | __be32 net_seq); |
| 731 | extern void xfrm_audit_state_icvfail(struct xfrm_state *x, | 733 | void xfrm_audit_state_icvfail(struct xfrm_state *x, struct sk_buff *skb, |
| 732 | struct sk_buff *skb, u8 proto); | 734 | u8 proto); |
| 733 | #else | 735 | #else |
| 734 | 736 | ||
| 735 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 737 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
| @@ -784,7 +786,7 @@ static inline void xfrm_pol_hold(struct xfrm_policy *policy) | |||
| 784 | atomic_inc(&policy->refcnt); | 786 | atomic_inc(&policy->refcnt); |
| 785 | } | 787 | } |
| 786 | 788 | ||
| 787 | extern void xfrm_policy_destroy(struct xfrm_policy *policy); | 789 | void xfrm_policy_destroy(struct xfrm_policy *policy); |
| 788 | 790 | ||
| 789 | static inline void xfrm_pol_put(struct xfrm_policy *policy) | 791 | static inline void xfrm_pol_put(struct xfrm_policy *policy) |
| 790 | { | 792 | { |
| @@ -799,7 +801,7 @@ static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols) | |||
| 799 | xfrm_pol_put(pols[i]); | 801 | xfrm_pol_put(pols[i]); |
| 800 | } | 802 | } |
| 801 | 803 | ||
| 802 | extern void __xfrm_state_destroy(struct xfrm_state *); | 804 | void __xfrm_state_destroy(struct xfrm_state *); |
| 803 | 805 | ||
| 804 | static inline void __xfrm_state_put(struct xfrm_state *x) | 806 | static inline void __xfrm_state_put(struct xfrm_state *x) |
| 805 | { | 807 | { |
| @@ -903,9 +905,8 @@ __be16 xfrm_flowi_dport(const struct flowi *fl, const union flowi_uli *uli) | |||
| 903 | return port; | 905 | return port; |
| 904 | } | 906 | } |
| 905 | 907 | ||
| 906 | extern bool xfrm_selector_match(const struct xfrm_selector *sel, | 908 | bool xfrm_selector_match(const struct xfrm_selector *sel, |
| 907 | const struct flowi *fl, | 909 | const struct flowi *fl, unsigned short family); |
| 908 | unsigned short family); | ||
| 909 | 910 | ||
| 910 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 911 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| 911 | /* If neither has a context --> match | 912 | /* If neither has a context --> match |
| @@ -975,7 +976,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | |||
| 975 | } | 976 | } |
| 976 | #endif | 977 | #endif |
| 977 | 978 | ||
| 978 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | 979 | void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); |
| 979 | 980 | ||
| 980 | struct sec_path { | 981 | struct sec_path { |
| 981 | atomic_t refcnt; | 982 | atomic_t refcnt; |
| @@ -1000,7 +1001,7 @@ secpath_get(struct sec_path *sp) | |||
| 1000 | return sp; | 1001 | return sp; |
| 1001 | } | 1002 | } |
| 1002 | 1003 | ||
| 1003 | extern void __secpath_destroy(struct sec_path *sp); | 1004 | void __secpath_destroy(struct sec_path *sp); |
| 1004 | 1005 | ||
| 1005 | static inline void | 1006 | static inline void |
| 1006 | secpath_put(struct sec_path *sp) | 1007 | secpath_put(struct sec_path *sp) |
| @@ -1009,7 +1010,7 @@ secpath_put(struct sec_path *sp) | |||
| 1009 | __secpath_destroy(sp); | 1010 | __secpath_destroy(sp); |
| 1010 | } | 1011 | } |
| 1011 | 1012 | ||
| 1012 | extern struct sec_path *secpath_dup(struct sec_path *src); | 1013 | struct sec_path *secpath_dup(struct sec_path *src); |
| 1013 | 1014 | ||
| 1014 | static inline void | 1015 | static inline void |
| 1015 | secpath_reset(struct sk_buff *skb) | 1016 | secpath_reset(struct sk_buff *skb) |
| @@ -1059,7 +1060,8 @@ xfrm_state_addr_cmp(const struct xfrm_tmpl *tmpl, const struct xfrm_state *x, un | |||
| 1059 | } | 1060 | } |
| 1060 | 1061 | ||
| 1061 | #ifdef CONFIG_XFRM | 1062 | #ifdef CONFIG_XFRM |
| 1062 | extern int __xfrm_policy_check(struct sock *, int dir, struct sk_buff *skb, unsigned short family); | 1063 | int __xfrm_policy_check(struct sock *, int dir, struct sk_buff *skb, |
| 1064 | unsigned short family); | ||
| 1063 | 1065 | ||
| 1064 | static inline int __xfrm_policy_check2(struct sock *sk, int dir, | 1066 | static inline int __xfrm_policy_check2(struct sock *sk, int dir, |
| 1065 | struct sk_buff *skb, | 1067 | struct sk_buff *skb, |
| @@ -1103,8 +1105,8 @@ static inline int xfrm6_policy_check_reverse(struct sock *sk, int dir, | |||
| 1103 | return __xfrm_policy_check2(sk, dir, skb, AF_INET6, 1); | 1105 | return __xfrm_policy_check2(sk, dir, skb, AF_INET6, 1); |
| 1104 | } | 1106 | } |
| 1105 | 1107 | ||
| 1106 | extern int __xfrm_decode_session(struct sk_buff *skb, struct flowi *fl, | 1108 | int __xfrm_decode_session(struct sk_buff *skb, struct flowi *fl, |
| 1107 | unsigned int family, int reverse); | 1109 | unsigned int family, int reverse); |
| 1108 | 1110 | ||
| 1109 | static inline int xfrm_decode_session(struct sk_buff *skb, struct flowi *fl, | 1111 | static inline int xfrm_decode_session(struct sk_buff *skb, struct flowi *fl, |
| 1110 | unsigned int family) | 1112 | unsigned int family) |
| @@ -1119,7 +1121,7 @@ static inline int xfrm_decode_session_reverse(struct sk_buff *skb, | |||
| 1119 | return __xfrm_decode_session(skb, fl, family, 1); | 1121 | return __xfrm_decode_session(skb, fl, family, 1); |
| 1120 | } | 1122 | } |
| 1121 | 1123 | ||
| 1122 | extern int __xfrm_route_forward(struct sk_buff *skb, unsigned short family); | 1124 | int __xfrm_route_forward(struct sk_buff *skb, unsigned short family); |
| 1123 | 1125 | ||
| 1124 | static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family) | 1126 | static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family) |
| 1125 | { | 1127 | { |
| @@ -1140,7 +1142,7 @@ static inline int xfrm6_route_forward(struct sk_buff *skb) | |||
| 1140 | return xfrm_route_forward(skb, AF_INET6); | 1142 | return xfrm_route_forward(skb, AF_INET6); |
| 1141 | } | 1143 | } |
| 1142 | 1144 | ||
| 1143 | extern int __xfrm_sk_clone_policy(struct sock *sk); | 1145 | int __xfrm_sk_clone_policy(struct sock *sk); |
| 1144 | 1146 | ||
| 1145 | static inline int xfrm_sk_clone_policy(struct sock *sk) | 1147 | static inline int xfrm_sk_clone_policy(struct sock *sk) |
| 1146 | { | 1148 | { |
| @@ -1149,7 +1151,7 @@ static inline int xfrm_sk_clone_policy(struct sock *sk) | |||
| 1149 | return 0; | 1151 | return 0; |
| 1150 | } | 1152 | } |
| 1151 | 1153 | ||
| 1152 | extern int xfrm_policy_delete(struct xfrm_policy *pol, int dir); | 1154 | int xfrm_policy_delete(struct xfrm_policy *pol, int dir); |
| 1153 | 1155 | ||
| 1154 | static inline void xfrm_sk_free_policy(struct sock *sk) | 1156 | static inline void xfrm_sk_free_policy(struct sock *sk) |
| 1155 | { | 1157 | { |
| @@ -1163,7 +1165,7 @@ static inline void xfrm_sk_free_policy(struct sock *sk) | |||
| 1163 | } | 1165 | } |
| 1164 | } | 1166 | } |
| 1165 | 1167 | ||
| 1166 | extern void xfrm_garbage_collect(struct net *net); | 1168 | void xfrm_garbage_collect(struct net *net); |
| 1167 | 1169 | ||
| 1168 | #else | 1170 | #else |
| 1169 | 1171 | ||
| @@ -1355,6 +1357,12 @@ struct xfrm_tunnel { | |||
| 1355 | int priority; | 1357 | int priority; |
| 1356 | }; | 1358 | }; |
| 1357 | 1359 | ||
| 1360 | struct xfrm_tunnel_notifier { | ||
| 1361 | int (*handler)(struct sk_buff *skb); | ||
| 1362 | struct xfrm_tunnel_notifier __rcu *next; | ||
| 1363 | int priority; | ||
| 1364 | }; | ||
| 1365 | |||
| 1358 | struct xfrm6_tunnel { | 1366 | struct xfrm6_tunnel { |
| 1359 | int (*handler)(struct sk_buff *skb); | 1367 | int (*handler)(struct sk_buff *skb); |
| 1360 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, | 1368 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, |
| @@ -1363,16 +1371,16 @@ struct xfrm6_tunnel { | |||
| 1363 | int priority; | 1371 | int priority; |
| 1364 | }; | 1372 | }; |
| 1365 | 1373 | ||
| 1366 | extern void xfrm_init(void); | 1374 | void xfrm_init(void); |
| 1367 | extern void xfrm4_init(void); | 1375 | void xfrm4_init(void); |
| 1368 | extern int xfrm_state_init(struct net *net); | 1376 | int xfrm_state_init(struct net *net); |
| 1369 | extern void xfrm_state_fini(struct net *net); | 1377 | void xfrm_state_fini(struct net *net); |
| 1370 | extern void xfrm4_state_init(void); | 1378 | void xfrm4_state_init(void); |
| 1371 | #ifdef CONFIG_XFRM | 1379 | #ifdef CONFIG_XFRM |
| 1372 | extern int xfrm6_init(void); | 1380 | int xfrm6_init(void); |
| 1373 | extern void xfrm6_fini(void); | 1381 | void xfrm6_fini(void); |
| 1374 | extern int xfrm6_state_init(void); | 1382 | int xfrm6_state_init(void); |
| 1375 | extern void xfrm6_state_fini(void); | 1383 | void xfrm6_state_fini(void); |
| 1376 | #else | 1384 | #else |
| 1377 | static inline int xfrm6_init(void) | 1385 | static inline int xfrm6_init(void) |
| 1378 | { | 1386 | { |
| @@ -1385,52 +1393,52 @@ static inline void xfrm6_fini(void) | |||
| 1385 | #endif | 1393 | #endif |
| 1386 | 1394 | ||
| 1387 | #ifdef CONFIG_XFRM_STATISTICS | 1395 | #ifdef CONFIG_XFRM_STATISTICS |
| 1388 | extern int xfrm_proc_init(struct net *net); | 1396 | int xfrm_proc_init(struct net *net); |
| 1389 | extern void xfrm_proc_fini(struct net *net); | 1397 | void xfrm_proc_fini(struct net *net); |
| 1390 | #endif | 1398 | #endif |
| 1391 | 1399 | ||
| 1392 | extern int xfrm_sysctl_init(struct net *net); | 1400 | int xfrm_sysctl_init(struct net *net); |
| 1393 | #ifdef CONFIG_SYSCTL | 1401 | #ifdef CONFIG_SYSCTL |
| 1394 | extern void xfrm_sysctl_fini(struct net *net); | 1402 | void xfrm_sysctl_fini(struct net *net); |
| 1395 | #else | 1403 | #else |
| 1396 | static inline void xfrm_sysctl_fini(struct net *net) | 1404 | static inline void xfrm_sysctl_fini(struct net *net) |
| 1397 | { | 1405 | { |
| 1398 | } | 1406 | } |
| 1399 | #endif | 1407 | #endif |
| 1400 | 1408 | ||
| 1401 | extern void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); | 1409 | void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); |
| 1402 | extern int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, | 1410 | int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, |
| 1403 | int (*func)(struct xfrm_state *, int, void*), void *); | 1411 | int (*func)(struct xfrm_state *, int, void*), void *); |
| 1404 | extern void xfrm_state_walk_done(struct xfrm_state_walk *walk); | 1412 | void xfrm_state_walk_done(struct xfrm_state_walk *walk); |
| 1405 | extern struct xfrm_state *xfrm_state_alloc(struct net *net); | 1413 | struct xfrm_state *xfrm_state_alloc(struct net *net); |
| 1406 | extern struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, | 1414 | struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, |
| 1407 | const xfrm_address_t *saddr, | 1415 | const xfrm_address_t *saddr, |
| 1408 | const struct flowi *fl, | 1416 | const struct flowi *fl, |
| 1409 | struct xfrm_tmpl *tmpl, | 1417 | struct xfrm_tmpl *tmpl, |
| 1410 | struct xfrm_policy *pol, int *err, | 1418 | struct xfrm_policy *pol, int *err, |
| 1411 | unsigned short family); | 1419 | unsigned short family); |
| 1412 | extern struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark, | 1420 | struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark, |
| 1413 | xfrm_address_t *daddr, | 1421 | xfrm_address_t *daddr, |
| 1414 | xfrm_address_t *saddr, | 1422 | xfrm_address_t *saddr, |
| 1415 | unsigned short family, | 1423 | unsigned short family, |
| 1416 | u8 mode, u8 proto, u32 reqid); | 1424 | u8 mode, u8 proto, u32 reqid); |
| 1417 | extern int xfrm_state_check_expire(struct xfrm_state *x); | 1425 | int xfrm_state_check_expire(struct xfrm_state *x); |
| 1418 | extern void xfrm_state_insert(struct xfrm_state *x); | 1426 | void xfrm_state_insert(struct xfrm_state *x); |
| 1419 | extern int xfrm_state_add(struct xfrm_state *x); | 1427 | int xfrm_state_add(struct xfrm_state *x); |
| 1420 | extern int xfrm_state_update(struct xfrm_state *x); | 1428 | int xfrm_state_update(struct xfrm_state *x); |
| 1421 | extern struct xfrm_state *xfrm_state_lookup(struct net *net, u32 mark, | 1429 | struct xfrm_state *xfrm_state_lookup(struct net *net, u32 mark, |
| 1422 | const xfrm_address_t *daddr, __be32 spi, | 1430 | const xfrm_address_t *daddr, __be32 spi, |
| 1423 | u8 proto, unsigned short family); | 1431 | u8 proto, unsigned short family); |
| 1424 | extern struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark, | 1432 | struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark, |
| 1425 | const xfrm_address_t *daddr, | 1433 | const xfrm_address_t *daddr, |
| 1426 | const xfrm_address_t *saddr, | 1434 | const xfrm_address_t *saddr, |
| 1427 | u8 proto, | 1435 | u8 proto, |
| 1428 | unsigned short family); | 1436 | unsigned short family); |
| 1429 | #ifdef CONFIG_XFRM_SUB_POLICY | 1437 | #ifdef CONFIG_XFRM_SUB_POLICY |
| 1430 | extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, | 1438 | int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, |
| 1431 | int n, unsigned short family); | 1439 | unsigned short family); |
| 1432 | extern int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, | 1440 | int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, |
| 1433 | int n, unsigned short family); | 1441 | unsigned short family); |
| 1434 | #else | 1442 | #else |
| 1435 | static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, | 1443 | static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, |
| 1436 | int n, unsigned short family) | 1444 | int n, unsigned short family) |
| @@ -1462,68 +1470,69 @@ struct xfrmk_spdinfo { | |||
| 1462 | u32 spdhmcnt; | 1470 | u32 spdhmcnt; |
| 1463 | }; | 1471 | }; |
| 1464 | 1472 | ||
| 1465 | extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark, | 1473 | struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark, u32 seq); |
| 1466 | u32 seq); | 1474 | int xfrm_state_delete(struct xfrm_state *x); |
| 1467 | extern int xfrm_state_delete(struct xfrm_state *x); | 1475 | int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); |
| 1468 | extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); | 1476 | void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); |
| 1469 | extern void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); | 1477 | void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si); |
| 1470 | extern void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si); | 1478 | u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq); |
| 1471 | extern u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq); | 1479 | int xfrm_init_replay(struct xfrm_state *x); |
| 1472 | extern int xfrm_init_replay(struct xfrm_state *x); | 1480 | int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
| 1473 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 1481 | int __xfrm_init_state(struct xfrm_state *x, bool init_replay); |
| 1474 | extern int __xfrm_init_state(struct xfrm_state *x, bool init_replay); | 1482 | int xfrm_init_state(struct xfrm_state *x); |
| 1475 | extern int xfrm_init_state(struct xfrm_state *x); | 1483 | int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb); |
| 1476 | extern int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb); | 1484 | int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type); |
| 1477 | extern int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, | 1485 | int xfrm_input_resume(struct sk_buff *skb, int nexthdr); |
| 1478 | int encap_type); | 1486 | int xfrm_output_resume(struct sk_buff *skb, int err); |
| 1479 | extern int xfrm_input_resume(struct sk_buff *skb, int nexthdr); | 1487 | int xfrm_output(struct sk_buff *skb); |
| 1480 | extern int xfrm_output_resume(struct sk_buff *skb, int err); | 1488 | int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1481 | extern int xfrm_output(struct sk_buff *skb); | 1489 | void xfrm_local_error(struct sk_buff *skb, int mtu); |
| 1482 | extern int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1490 | int xfrm4_extract_header(struct sk_buff *skb); |
| 1483 | extern void xfrm_local_error(struct sk_buff *skb, int mtu); | 1491 | int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb); |
| 1484 | extern int xfrm4_extract_header(struct sk_buff *skb); | 1492 | int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, |
| 1485 | extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb); | 1493 | int encap_type); |
| 1486 | extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, | 1494 | int xfrm4_transport_finish(struct sk_buff *skb, int async); |
| 1487 | int encap_type); | 1495 | int xfrm4_rcv(struct sk_buff *skb); |
| 1488 | extern int xfrm4_transport_finish(struct sk_buff *skb, int async); | ||
| 1489 | extern int xfrm4_rcv(struct sk_buff *skb); | ||
| 1490 | 1496 | ||
| 1491 | static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) | 1497 | static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) |
| 1492 | { | 1498 | { |
| 1493 | return xfrm4_rcv_encap(skb, nexthdr, spi, 0); | 1499 | return xfrm4_rcv_encap(skb, nexthdr, spi, 0); |
| 1494 | } | 1500 | } |
| 1495 | 1501 | ||
| 1496 | extern int xfrm4_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1502 | int xfrm4_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1497 | extern int xfrm4_prepare_output(struct xfrm_state *x, struct sk_buff *skb); | 1503 | int xfrm4_prepare_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1498 | extern int xfrm4_output(struct sk_buff *skb); | 1504 | int xfrm4_output(struct sk_buff *skb); |
| 1499 | extern int xfrm4_output_finish(struct sk_buff *skb); | 1505 | int xfrm4_output_finish(struct sk_buff *skb); |
| 1500 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); | 1506 | int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); |
| 1501 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); | 1507 | int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); |
| 1502 | extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler); | 1508 | void xfrm4_local_error(struct sk_buff *skb, u32 mtu); |
| 1503 | extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler); | 1509 | int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler); |
| 1504 | extern void xfrm4_local_error(struct sk_buff *skb, u32 mtu); | 1510 | int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler); |
| 1505 | extern int xfrm6_extract_header(struct sk_buff *skb); | 1511 | int xfrm6_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler); |
| 1506 | extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); | 1512 | int xfrm6_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler); |
| 1507 | extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); | 1513 | int xfrm6_extract_header(struct sk_buff *skb); |
| 1508 | extern int xfrm6_transport_finish(struct sk_buff *skb, int async); | 1514 | int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); |
| 1509 | extern int xfrm6_rcv(struct sk_buff *skb); | 1515 | int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); |
| 1510 | extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | 1516 | int xfrm6_transport_finish(struct sk_buff *skb, int async); |
| 1511 | xfrm_address_t *saddr, u8 proto); | 1517 | int xfrm6_rcv(struct sk_buff *skb); |
| 1512 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); | 1518 | int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, |
| 1513 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); | 1519 | xfrm_address_t *saddr, u8 proto); |
| 1514 | extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr); | 1520 | void xfrm6_local_error(struct sk_buff *skb, u32 mtu); |
| 1515 | extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr); | 1521 | int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); |
| 1516 | extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1522 | int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); |
| 1517 | extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); | 1523 | __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr); |
| 1518 | extern int xfrm6_output(struct sk_buff *skb); | 1524 | __be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr); |
| 1519 | extern int xfrm6_output_finish(struct sk_buff *skb); | 1525 | int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1520 | extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | 1526 | int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1521 | u8 **prevhdr); | 1527 | int xfrm6_output(struct sk_buff *skb); |
| 1522 | extern void xfrm6_local_error(struct sk_buff *skb, u32 mtu); | 1528 | int xfrm6_output_finish(struct sk_buff *skb); |
| 1529 | int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | ||
| 1530 | u8 **prevhdr); | ||
| 1523 | 1531 | ||
| 1524 | #ifdef CONFIG_XFRM | 1532 | #ifdef CONFIG_XFRM |
| 1525 | extern int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb); | 1533 | int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb); |
| 1526 | extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen); | 1534 | int xfrm_user_policy(struct sock *sk, int optname, |
| 1535 | u8 __user *optval, int optlen); | ||
| 1527 | #else | 1536 | #else |
| 1528 | static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen) | 1537 | static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen) |
| 1529 | { | 1538 | { |
| @@ -1540,59 +1549,62 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb) | |||
| 1540 | 1549 | ||
| 1541 | struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp); | 1550 | struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp); |
| 1542 | 1551 | ||
| 1543 | extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); | 1552 | void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); |
| 1544 | extern int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, | 1553 | int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, |
| 1545 | int (*func)(struct xfrm_policy *, int, int, void*), void *); | 1554 | int (*func)(struct xfrm_policy *, int, int, void*), |
| 1546 | extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); | 1555 | void *); |
| 1556 | void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); | ||
| 1547 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); | 1557 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); |
| 1548 | struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, | 1558 | struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, |
| 1549 | u8 type, int dir, | 1559 | u8 type, int dir, |
| 1550 | struct xfrm_selector *sel, | 1560 | struct xfrm_selector *sel, |
| 1551 | struct xfrm_sec_ctx *ctx, int delete, | 1561 | struct xfrm_sec_ctx *ctx, int delete, |
| 1552 | int *err); | 1562 | int *err); |
| 1553 | struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, u32 id, int delete, int *err); | 1563 | struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, |
| 1564 | u32 id, int delete, int *err); | ||
| 1554 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); | 1565 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); |
| 1555 | u32 xfrm_get_acqseq(void); | 1566 | u32 xfrm_get_acqseq(void); |
| 1556 | extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); | 1567 | int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); |
| 1557 | struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, | 1568 | struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, |
| 1558 | u8 mode, u32 reqid, u8 proto, | 1569 | u8 mode, u32 reqid, u8 proto, |
| 1559 | const xfrm_address_t *daddr, | 1570 | const xfrm_address_t *daddr, |
| 1560 | const xfrm_address_t *saddr, int create, | 1571 | const xfrm_address_t *saddr, int create, |
| 1561 | unsigned short family); | 1572 | unsigned short family); |
| 1562 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); | 1573 | int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); |
| 1563 | 1574 | ||
| 1564 | #ifdef CONFIG_XFRM_MIGRATE | 1575 | #ifdef CONFIG_XFRM_MIGRATE |
| 1565 | extern int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | 1576 | int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, |
| 1566 | const struct xfrm_migrate *m, int num_bundles, | 1577 | const struct xfrm_migrate *m, int num_bundles, |
| 1567 | const struct xfrm_kmaddress *k); | 1578 | const struct xfrm_kmaddress *k); |
| 1568 | extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m); | 1579 | struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m); |
| 1569 | extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x, | 1580 | struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, |
| 1570 | struct xfrm_migrate *m); | 1581 | struct xfrm_migrate *m); |
| 1571 | extern int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | 1582 | int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, |
| 1572 | struct xfrm_migrate *m, int num_bundles, | 1583 | struct xfrm_migrate *m, int num_bundles, |
| 1573 | struct xfrm_kmaddress *k); | 1584 | struct xfrm_kmaddress *k); |
| 1574 | #endif | 1585 | #endif |
| 1575 | 1586 | ||
| 1576 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 1587 | int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
| 1577 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 portid); | 1588 | void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 portid); |
| 1578 | extern int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 1589 | int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, |
| 1579 | 1590 | xfrm_address_t *addr); | |
| 1580 | extern void xfrm_input_init(void); | 1591 | |
| 1581 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); | 1592 | void xfrm_input_init(void); |
| 1582 | 1593 | int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); | |
| 1583 | extern void xfrm_probe_algs(void); | 1594 | |
| 1584 | extern int xfrm_count_pfkey_auth_supported(void); | 1595 | void xfrm_probe_algs(void); |
| 1585 | extern int xfrm_count_pfkey_enc_supported(void); | 1596 | int xfrm_count_pfkey_auth_supported(void); |
| 1586 | extern struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx); | 1597 | int xfrm_count_pfkey_enc_supported(void); |
| 1587 | extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); | 1598 | struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx); |
| 1588 | extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); | 1599 | struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); |
| 1589 | extern struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); | 1600 | struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); |
| 1590 | extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); | 1601 | struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); |
| 1591 | extern struct xfrm_algo_desc *xfrm_aalg_get_byname(const char *name, int probe); | 1602 | struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); |
| 1592 | extern struct xfrm_algo_desc *xfrm_ealg_get_byname(const char *name, int probe); | 1603 | struct xfrm_algo_desc *xfrm_aalg_get_byname(const char *name, int probe); |
| 1593 | extern struct xfrm_algo_desc *xfrm_calg_get_byname(const char *name, int probe); | 1604 | struct xfrm_algo_desc *xfrm_ealg_get_byname(const char *name, int probe); |
| 1594 | extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, | 1605 | struct xfrm_algo_desc *xfrm_calg_get_byname(const char *name, int probe); |
| 1595 | int probe); | 1606 | struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, |
| 1607 | int probe); | ||
| 1596 | 1608 | ||
| 1597 | static inline bool xfrm6_addr_equal(const xfrm_address_t *a, | 1609 | static inline bool xfrm6_addr_equal(const xfrm_address_t *a, |
| 1598 | const xfrm_address_t *b) | 1610 | const xfrm_address_t *b) |
