| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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 | | - * |
|---|
| 9 | 4 | */ |
|---|
| 10 | 5 | #ifndef __IPVLAN_H |
|---|
| 11 | 6 | #define __IPVLAN_H |
|---|
| .. | .. |
|---|
| 165 | 160 | const void *iaddr, bool is_v6); |
|---|
| 166 | 161 | bool ipvlan_addr_busy(struct ipvl_port *port, void *iaddr, bool is_v6); |
|---|
| 167 | 162 | 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); |
|---|
| 172 | 166 | void ipvlan_count_rx(const struct ipvl_dev *ipvlan, |
|---|
| 173 | 167 | unsigned int len, bool success, bool mcast); |
|---|
| 174 | 168 | int ipvlan_link_new(struct net *src_net, struct net_device *dev, |
|---|
| .. | .. |
|---|
| 177 | 171 | void ipvlan_link_delete(struct net_device *dev, struct list_head *head); |
|---|
| 178 | 172 | void ipvlan_link_setup(struct net_device *dev); |
|---|
| 179 | 173 | 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 */ |
|---|
| 180 | 204 | |
|---|
| 181 | 205 | static inline bool netif_is_ipvlan_port(const struct net_device *dev) |
|---|
| 182 | 206 | { |
|---|