~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/ppp_channel.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 #ifndef _PPP_CHANNEL_H_
  3 #define _PPP_CHANNEL_H_
  4 /*
  5  * Definitions for the interface between the generic PPP code
  6  * and a PPP channel.
  7  *
  8  * A PPP channel provides a way for the generic PPP code to send
  9  * and receive packets over some sort of communications medium.
 10  * Packets are stored in sk_buffs and have the 2-byte PPP protocol
 11  * number at the start, but not the address and control bytes.
 12  *
 13  * Copyright 1999 Paul Mackerras.
 14  *
 15  * ==FILEVERSION 20000322==
 16  */
 17 
 18 #include <linux/list.h>
 19 #include <linux/skbuff.h>
 20 #include <linux/poll.h>
 21 #include <net/net_namespace.h>
 22 
 23 struct net_device_path;
 24 struct net_device_path_ctx;
 25 struct ppp_channel;
 26 
 27 struct ppp_channel_ops {
 28         /* Send a packet (or multilink fragment) on this channel.
 29            Returns 1 if it was accepted, 0 if not. */
 30         int     (*start_xmit)(struct ppp_channel *, struct sk_buff *);
 31         /* Handle an ioctl call that has come in via /dev/ppp. */
 32         int     (*ioctl)(struct ppp_channel *, unsigned int, unsigned long);
 33         int     (*fill_forward_path)(struct net_device_path_ctx *,
 34                                      struct net_device_path *,
 35                                      const struct ppp_channel *);
 36 };
 37 
 38 struct ppp_channel {
 39         void            *private;       /* channel private data */
 40         const struct ppp_channel_ops *ops; /* operations for this channel */
 41         int             mtu;            /* max transmit packet size */
 42         int             hdrlen;         /* amount of headroom channel needs */
 43         void            *ppp;           /* opaque to channel */
 44         int             speed;          /* transfer rate (bytes/second) */
 45         /* the following is not used at present */
 46         int             latency;        /* overhead time in milliseconds */
 47 };
 48 
 49 #ifdef __KERNEL__
 50 /* Called by the channel when it can send some more data. */
 51 extern void ppp_output_wakeup(struct ppp_channel *);
 52 
 53 /* Called by the channel to process a received PPP packet.
 54    The packet should have just the 2-byte PPP protocol header. */
 55 extern void ppp_input(struct ppp_channel *, struct sk_buff *);
 56 
 57 /* Called by the channel when an input error occurs, indicating
 58    that we may have missed a packet. */
 59 extern void ppp_input_error(struct ppp_channel *, int code);
 60 
 61 /* Attach a channel to a given PPP unit in specified net. */
 62 extern int ppp_register_net_channel(struct net *, struct ppp_channel *);
 63 
 64 /* Attach a channel to a given PPP unit. */
 65 extern int ppp_register_channel(struct ppp_channel *);
 66 
 67 /* Detach a channel from its PPP unit (e.g. on hangup). */
 68 extern void ppp_unregister_channel(struct ppp_channel *);
 69 
 70 /* Get the channel number for a channel */
 71 extern int ppp_channel_index(struct ppp_channel *);
 72 
 73 /* Get the unit number associated with a channel, or -1 if none */
 74 extern int ppp_unit_number(struct ppp_channel *);
 75 
 76 /* Get the device name associated with a channel, or NULL if none */
 77 extern char *ppp_dev_name(struct ppp_channel *);
 78 
 79 /*
 80  * SMP locking notes:
 81  * The channel code must ensure that when it calls ppp_unregister_channel,
 82  * nothing is executing in any of the procedures above, for that
 83  * channel.  The generic layer will ensure that nothing is executing
 84  * in the start_xmit and ioctl routines for the channel by the time
 85  * that ppp_unregister_channel returns.
 86  */
 87 
 88 #endif /* __KERNEL__ */
 89 #endif
 90 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php