--- zzzz-none-000/linux-4.4.271/include/linux/if_pppox.h 2021-06-03 06:22:09.000000000 +0000 +++ maple-fsgw-759/linux-4.4.271/include/linux/if_pppox.h 2023-12-20 10:37:35.000000000 +0000 @@ -1,6 +1,22 @@ +/* + ************************************************************************** + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + ************************************************************************** + */ + /*************************************************************************** * Linux PPP over X - Generic PPP transport layer sockets - * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516) + * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516) * * This file supplies definitions required by the PPP over Ethernet driver * (pppox.c). All version information wrt this file is located in pppox.c @@ -12,6 +28,7 @@ * 2 of the License, or (at your option) any later version. * */ + #ifndef __LINUX_IF_PPPOX_H #define __LINUX_IF_PPPOX_H @@ -42,6 +59,7 @@ u32 ack_sent, ack_recv; u32 seq_sent, seq_recv; int ppp_flags; + bool pptp_offload_mode; }; #include @@ -98,4 +116,49 @@ PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/ }; +/* + * PPPoE Channel specific operations + */ +struct pppoe_channel_ops { + /* Must be first - general to all PPP channels */ + struct ppp_channel_ops ops; + int (*get_addressing)(struct ppp_channel *, struct pppoe_opt *); +}; + +/* PPTP client callback */ +typedef int (*pptp_gre_seq_offload_callback_t)(struct sk_buff *skb, + struct net_device *pptp_dev); + +/* Return PPPoE channel specific addressing information */ +extern int pppoe_channel_addressing_get(struct ppp_channel *chan, + struct pppoe_opt *addressing); + +/* Lookup PPTP session info and return PPTP session using dip and peer call id */ +extern int pptp_session_find(struct pptp_opt *opt, __be16 peer_call_id, + __be32 peer_ip_addr); + +/* Lookup PPTP session info and return PPTP session using sip, dip and local call id */ +extern int pptp_session_find_by_src_callid(struct pptp_opt *opt, __be16 src_call_id, + __be32 daddr, __be32 saddr); + +/* Return PPTP session information given the channel */ +extern void pptp_channel_addressing_get(struct pptp_opt *opt, + struct ppp_channel *chan); + +/* Enable the PPTP session offload flag */ +extern int pptp_session_enable_offload_mode(__be16 peer_call_id, + __be32 peer_ip_addr); + +/* Disable the PPTP session offload flag */ +extern int pptp_session_disable_offload_mode(__be16 peer_call_id, + __be32 peer_ip_addr); + +/* Register the PPTP GRE packets sequence number offload callback */ +extern int +pptp_register_gre_seq_offload_callback(pptp_gre_seq_offload_callback_t + pptp_client_cb); + +/* Unregister the PPTP GRE packets sequence number offload callback */ +extern void pptp_unregister_gre_seq_offload_callback(void); + #endif /* !(__LINUX_IF_PPPOX_H) */