forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/net/ipvlan/ipvlan.h
....@@ -1,11 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (c) 2014 Mahesh Bandewar <maheshb@google.com>
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License as
6
- * published by the Free Software Foundation; either version 2 of
7
- * the License, or (at your option) any later version.
8
- *
94 */
105 #ifndef __IPVLAN_H
116 #define __IPVLAN_H
....@@ -165,10 +160,9 @@
165160 const void *iaddr, bool is_v6);
166161 bool ipvlan_addr_busy(struct ipvl_port *port, void *iaddr, bool is_v6);
167162 void ipvlan_ht_addr_del(struct ipvl_addr *addr);
168
-struct sk_buff *ipvlan_l3_rcv(struct net_device *dev, struct sk_buff *skb,
169
- u16 proto);
170
-unsigned int ipvlan_nf_input(void *priv, struct sk_buff *skb,
171
- const struct nf_hook_state *state);
163
+struct ipvl_addr *ipvlan_addr_lookup(struct ipvl_port *port, void *lyr3h,
164
+ int addr_type, bool use_dest);
165
+void *ipvlan_get_L3_hdr(struct ipvl_port *port, struct sk_buff *skb, int *type);
172166 void ipvlan_count_rx(const struct ipvl_dev *ipvlan,
173167 unsigned int len, bool success, bool mcast);
174168 int ipvlan_link_new(struct net *src_net, struct net_device *dev,
....@@ -177,6 +171,36 @@
177171 void ipvlan_link_delete(struct net_device *dev, struct list_head *head);
178172 void ipvlan_link_setup(struct net_device *dev);
179173 int ipvlan_link_register(struct rtnl_link_ops *ops);
174
+#ifdef CONFIG_IPVLAN_L3S
175
+int ipvlan_l3s_register(struct ipvl_port *port);
176
+void ipvlan_l3s_unregister(struct ipvl_port *port);
177
+void ipvlan_migrate_l3s_hook(struct net *oldnet, struct net *newnet);
178
+int ipvlan_l3s_init(void);
179
+void ipvlan_l3s_cleanup(void);
180
+#else
181
+static inline int ipvlan_l3s_register(struct ipvl_port *port)
182
+{
183
+ return -ENOTSUPP;
184
+}
185
+
186
+static inline void ipvlan_l3s_unregister(struct ipvl_port *port)
187
+{
188
+}
189
+
190
+static inline void ipvlan_migrate_l3s_hook(struct net *oldnet,
191
+ struct net *newnet)
192
+{
193
+}
194
+
195
+static inline int ipvlan_l3s_init(void)
196
+{
197
+ return 0;
198
+}
199
+
200
+static inline void ipvlan_l3s_cleanup(void)
201
+{
202
+}
203
+#endif /* CONFIG_IPVLAN_L3S */
180204
181205 static inline bool netif_is_ipvlan_port(const struct net_device *dev)
182206 {