Skip to content

Commit

Permalink
net: add missing includes and forward declarations under net/
Browse files Browse the repository at this point in the history
This patch adds missing includes to headers under include/net.
All these problems are currently masked by the existing users
including the missing dependency before the broken header.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Jul 22, 2022
1 parent 735dbc6 commit 949d6b4
Show file tree
Hide file tree
Showing 63 changed files with 183 additions and 11 deletions.
5 changes: 5 additions & 0 deletions include/linux/lapb.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
#ifndef LAPB_KERNEL_H
#define LAPB_KERNEL_H

#include <linux/skbuff.h>
#include <linux/timer.h>

struct net_device;

#define LAPB_OK 0
#define LAPB_BADTOKEN 1
#define LAPB_INVALUE 2
Expand Down
1 change: 1 addition & 0 deletions include/net/af_vsock.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <linux/kernel.h>
#include <linux/workqueue.h>
#include <net/sock.h>
#include <uapi/linux/vm_sockets.h>

#include "vsock_addr.h"
Expand Down
3 changes: 3 additions & 0 deletions include/net/amt.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

#include <linux/siphash.h>
#include <linux/jhash.h>
#include <linux/netdevice.h>
#include <net/gro_cells.h>
#include <net/rtnetlink.h>

enum amt_msg_type {
AMT_MSG_DISCOVERY = 1,
Expand Down
2 changes: 2 additions & 0 deletions include/net/ax88796.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#ifndef __NET_AX88796_PLAT_H
#define __NET_AX88796_PLAT_H

#include <linux/types.h>

struct sk_buff;
struct net_device;
struct platform_device;
Expand Down
8 changes: 8 additions & 0 deletions include/net/bond_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#ifndef _NET_BOND_OPTIONS_H
#define _NET_BOND_OPTIONS_H

#include <linux/bits.h>
#include <linux/limits.h>
#include <linux/types.h>
#include <linux/string.h>

struct netlink_ext_ack;
struct nlattr;

#define BOND_OPT_MAX_NAMELEN 32
#define BOND_OPT_VALID(opt) ((opt) < BOND_OPT_LAST)
#define BOND_MODE_ALL_EX(x) (~(x))
Expand Down
1 change: 1 addition & 0 deletions include/net/codel_qdisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* Implemented on linux by Dave Taht and Eric Dumazet
*/

#include <net/codel.h>
#include <net/pkt_sched.h>

/* Qdiscs using codel plugin must use codel_skb_cb in their own cb[] */
Expand Down
7 changes: 7 additions & 0 deletions include/net/datalink.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
#ifndef _NET_INET_DATALINK_H_
#define _NET_INET_DATALINK_H_

#include <linux/list.h>

struct llc_sap;
struct net_device;
struct packet_type;
struct sk_buff;

struct datalink_proto {
unsigned char type[8];

Expand Down
2 changes: 2 additions & 0 deletions include/net/dcbevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#ifndef _DCB_EVENT_H
#define _DCB_EVENT_H

struct notifier_block;

enum dcbevent_notif_type {
DCB_APP_EVENT = 1,
};
Expand Down
2 changes: 2 additions & 0 deletions include/net/dcbnl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <linux/dcbnl.h>

struct net_device;

struct dcb_app_type {
int ifindex;
struct dcb_app app;
Expand Down
1 change: 1 addition & 0 deletions include/net/dn_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef _NET_DN_DEV_H
#define _NET_DN_DEV_H

#include <linux/netdevice.h>

struct dn_dev;

Expand Down
2 changes: 2 additions & 0 deletions include/net/dn_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <linux/netlink.h>
#include <linux/refcount.h>
#include <linux/rtnetlink.h>
#include <net/fib_rules.h>

extern const struct nla_policy rtm_dn_policy[];

Expand Down
2 changes: 2 additions & 0 deletions include/net/dn_neigh.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _NET_DN_NEIGH_H
#define _NET_DN_NEIGH_H

#include <net/neighbour.h>

/*
* The position of the first two fields of
* this structure are critical - SJW
Expand Down
6 changes: 6 additions & 0 deletions include/net/dn_nsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
*******************************************************************************/
/* dn_nsp.c functions prototyping */
#include <linux/atomic.h>
#include <linux/types.h>
#include <net/sock.h>

struct sk_buff;
struct sk_buff_head;

void dn_nsp_send_data_ack(struct sock *sk);
void dn_nsp_send_oth_ack(struct sock *sk);
Expand Down
3 changes: 3 additions & 0 deletions include/net/dn_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*******************************************************************************/

#include <linux/types.h>
#include <net/dst.h>

struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri);
int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *,
struct sock *sk, int flags);
Expand Down
3 changes: 3 additions & 0 deletions include/net/erspan.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
* GRE proto ERSPAN type I/II = 0x88BE, type III = 0x22EB
*/

#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/skbuff.h>
#include <uapi/linux/erspan.h>

#define ERSPAN_VERSION 0x1 /* ERSPAN type II */
Expand Down
1 change: 1 addition & 0 deletions include/net/esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <linux/skbuff.h>

struct ip_esp_hdr;
struct xfrm_state;

static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
{
Expand Down
3 changes: 3 additions & 0 deletions include/net/ethoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#ifndef LINUX_NET_ETHOC_H
#define LINUX_NET_ETHOC_H 1

#include <linux/if.h>
#include <linux/types.h>

struct ethoc_platform_data {
u8 hwaddr[IFHWADDRLEN];
s8 phy_id;
Expand Down
2 changes: 2 additions & 0 deletions include/net/firewire.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _NET_FIREWIRE_H
#define _NET_FIREWIRE_H

#include <linux/types.h>

/* Pseudo L2 address */
#define FWNET_ALEN 16
union fwnet_hwaddr {
Expand Down
4 changes: 4 additions & 0 deletions include/net/fq.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#ifndef __NET_SCHED_FQ_H
#define __NET_SCHED_FQ_H

#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/types.h>

struct fq_tin;

/**
Expand Down
2 changes: 2 additions & 0 deletions include/net/garp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _NET_GARP_H
#define _NET_GARP_H

#include <linux/if_ether.h>
#include <linux/types.h>
#include <net/stp.h>

#define GARP_PROTOCOL_ID 0x1
Expand Down
4 changes: 4 additions & 0 deletions include/net/gtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#ifndef _GTP_H_
#define _GTP_H_

#include <linux/netdevice.h>
#include <linux/types.h>
#include <net/rtnetlink.h>

/* General GTP protocol related definitions. */

#define GTP0_PORT 3386
Expand Down
3 changes: 3 additions & 0 deletions include/net/gue.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
* may refer to options placed after this field.
*/

#include <asm/byteorder.h>
#include <linux/types.h>

struct guehdr {
union {
struct {
Expand Down
2 changes: 2 additions & 0 deletions include/net/hwbm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _HWBM_H
#define _HWBM_H

#include <linux/mutex.h>

struct hwbm_pool {
/* Capacity of the pool */
int size;
Expand Down
2 changes: 2 additions & 0 deletions include/net/ila.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#ifndef _NET_ILA_H
#define _NET_ILA_H

struct sk_buff;

int ila_xlat_outgoing(struct sk_buff *skb);
int ila_xlat_incoming(struct sk_buff *skb);

Expand Down
2 changes: 2 additions & 0 deletions include/net/inet6_connection_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <linux/types.h>

struct flowi;
struct flowi6;
struct request_sock;
struct sk_buff;
struct sock;
Expand Down
6 changes: 6 additions & 0 deletions include/net/inet_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#define _INET_COMMON_H

#include <linux/indirect_call_wrapper.h>
#include <linux/net.h>
#include <linux/netdev_features.h>
#include <linux/types.h>
#include <net/sock.h>

extern const struct proto_ops inet_stream_ops;
extern const struct proto_ops inet_dgram_ops;
Expand All @@ -12,6 +16,8 @@ extern const struct proto_ops inet_dgram_ops;
*/

struct msghdr;
struct net;
struct page;
struct sock;
struct sockaddr;
struct socket;
Expand Down
3 changes: 3 additions & 0 deletions include/net/inet_frag.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include <linux/rhashtable-types.h>
#include <linux/completion.h>
#include <linux/in6.h>
#include <linux/rbtree_types.h>
#include <linux/refcount.h>

/* Per netns frag queues directory */
struct fqdir {
Expand Down
20 changes: 10 additions & 10 deletions include/net/ip6_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
#ifndef _NET_IP6_ROUTE_H
#define _NET_IP6_ROUTE_H

#include <net/addrconf.h>
#include <net/flow.h>
#include <net/ip6_fib.h>
#include <net/sock.h>
#include <net/lwtunnel.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/route.h>
#include <net/nexthop.h>

struct route_info {
__u8 type;
__u8 length;
Expand All @@ -19,16 +29,6 @@ struct route_info {
__u8 prefix[]; /* 0,8 or 16 */
};

#include <net/addrconf.h>
#include <net/flow.h>
#include <net/ip6_fib.h>
#include <net/sock.h>
#include <net/lwtunnel.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/route.h>
#include <net/nexthop.h>

#define RT6_LOOKUP_F_IFACE 0x00000001
#define RT6_LOOKUP_F_REACHABLE 0x00000002
#define RT6_LOOKUP_F_HAS_SADDR 0x00000004
Expand Down
2 changes: 2 additions & 0 deletions include/net/ipcomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
#ifndef _NET_IPCOMP_H
#define _NET_IPCOMP_H

#include <linux/skbuff.h>
#include <linux/types.h>

#define IPCOMP_SCRATCH_SIZE 65400

struct crypto_comp;
struct ip_comp_hdr;

struct ipcomp_data {
u16 threshold;
Expand Down
2 changes: 2 additions & 0 deletions include/net/ipconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/* The following are initdata: */

#include <linux/types.h>

extern int ic_proto_enabled; /* Protocols enabled (see IC_xxx) */
extern int ic_set_manually; /* IPconfig parameters set manually */

Expand Down
7 changes: 7 additions & 0 deletions include/net/llc_c_ac.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
* Connection state transition actions
* (Fb = F bit; Pb = P bit; Xb = X bit)
*/

#include <linux/types.h>

struct sk_buff;
struct sock;
struct timer_list;

#define LLC_CONN_AC_CLR_REMOTE_BUSY 1
#define LLC_CONN_AC_CONN_IND 2
#define LLC_CONN_AC_CONN_CONFIRM 3
Expand Down
4 changes: 4 additions & 0 deletions include/net/llc_c_st.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*
* See the GNU General Public License for more details.
*/

#include <net/llc_c_ac.h>
#include <net/llc_c_ev.h>

/* Connection component state management */
/* connection states */
#define LLC_CONN_OUT_OF_SVC 0 /* prior to allocation */
Expand Down
4 changes: 4 additions & 0 deletions include/net/llc_s_ac.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*
* See the GNU General Public License for more details.
*/

struct llc_sap;
struct sk_buff;

/* SAP component actions */
#define SAP_ACT_UNITDATA_IND 1
#define SAP_ACT_SEND_UI 2
Expand Down
1 change: 1 addition & 0 deletions include/net/llc_s_ev.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include <linux/skbuff.h>
#include <net/llc.h>

/* Defines SAP component events */
/* Types of events (possible values in 'ev->type') */
Expand Down
3 changes: 3 additions & 0 deletions include/net/mpls_iptunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#ifndef _NET_MPLS_IPTUNNEL_H
#define _NET_MPLS_IPTUNNEL_H 1

#include <linux/types.h>
#include <net/lwtunnel.h>

struct mpls_iptunnel_encap {
u8 labels;
u8 ttl_propagate;
Expand Down
4 changes: 4 additions & 0 deletions include/net/mrp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#ifndef _NET_MRP_H
#define _NET_MRP_H

#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/types.h>

#define MRP_END_MARK 0x0

struct mrp_pdu_hdr {
Expand Down
Loading

0 comments on commit 949d6b4

Please sign in to comment.