• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Based on include/net/if_inet6.h
4  *	Authors:
5  *	Pedro Roque		<roque@di.fc.ul.pt>
6  *
7  * NewIP inet interface/address list definitions
8  * Linux NewIP INET implementation
9  */
10 #ifndef _NET_IF_NINET_H
11 #define _NET_IF_NINET_H
12 
13 #include <linux/nip.h>
14 
15 #define NIP_IOCTL_FLAG_INVALID  35
16 
17 enum {
18 	NINET_IFADDR_STATE_NEW,
19 	NINET_IFADDR_STATE_DEAD,
20 };
21 
22 struct ninet_ifaddr {
23 	struct nip_addr addr;
24 
25 	/* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
26 	__u32 valid_lft;
27 	__u32 preferred_lft;
28 	refcount_t refcnt;
29 
30 	/* protect one ifaddr itself */
31 	spinlock_t lock;
32 
33 	int state;
34 
35 	__u32 flags;
36 
37 	unsigned long cstamp; /* created timestamp */
38 	unsigned long tstamp; /* updated timestamp */
39 
40 	struct ninet_dev *idev;
41 	struct nip_rt_info *rt;
42 
43 	struct hlist_node addr_lst;
44 	struct list_head if_list;
45 
46 	struct rcu_head rcu;
47 };
48 
49 struct ninet_dev {
50 	struct net_device *dev;
51 
52 	struct list_head addr_list;
53 
54 	rwlock_t lock;
55 	refcount_t refcnt;
56 	__u32 if_flags;
57 	int dead;
58 
59 	struct neigh_parms *nd_parms;
60 	struct nip_devconf cnf;
61 
62 	unsigned long tstamp; /* newip InterfaceTable update timestamp */
63 	struct rcu_head rcu;
64 };
65 
66 int ninet_gifconf(struct net_device *dev, char __user *buf, int len, int size);
67 int ninet_ioctl_cmd(struct socket *sock, const struct iovec *iov);
68 
69 #endif
70