linux/drivers/net/wan/hdlc_ppp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Generic HDLC support routines for Linux
 * Point-to-point protocol support
 *
 * Copyright (C) 1999 - 2008 Krzysztof Halasa <[email protected]>
 */

#include <linux/errno.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pkt_sched.h>
#include <linux/poll.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/spinlock.h>

#define DEBUG_CP
#define DEBUG_STATE
#define DEBUG_HARD_HEADER

#define HDLC_ADDR_ALLSTATIONS
#define HDLC_CTRL_UI

#define PID_LCP
#define PID_IP
#define PID_IPCP
#define PID_IPV6
#define PID_IPV6CP

enum {};
enum {};
#if DEBUG_CP
static const char *const code_names[CP_CODES] = {
	"0", "ConfReq", "ConfAck", "ConfNak", "ConfRej", "TermReq",
	"TermAck", "CodeRej", "ProtoRej", "EchoReq", "EchoReply", "Discard"
};

static char debug_buffer[64 + 3 * DEBUG_CP];
#endif

enum {};

struct hdlc_header {};

struct cp_header {};

struct proto {};

struct ppp {};

enum {};
enum {};
enum {};

#if DEBUG_STATE
static const char *const state_names[STATES] = {
	"Closed", "Stopped", "Stopping", "ReqSent", "AckRecv", "AckSent",
	"Opened"
};

static const char *const event_names[EVENTS] = {
	"Start", "Stop", "TO+", "TO-", "RCR+", "RCR-", "RCA", "RCN",
	"RTR", "RTA", "RUC", "RXJ+", "RXJ-"
};
#endif

static struct sk_buff_head tx_queue; /* used when holding the spin lock */

static int ppp_ioctl(struct net_device *dev, struct if_settings *ifs);

static inline struct ppp *get_ppp(struct net_device *dev)
{}

static inline struct proto *get_proto(struct net_device *dev, u16 pid)
{}

static inline const char *proto_name(u16 pid)
{}

static __be16 ppp_type_trans(struct sk_buff *skb, struct net_device *dev)
{}

static int ppp_hard_header(struct sk_buff *skb, struct net_device *dev,
			   u16 type, const void *daddr, const void *saddr,
			   unsigned int len)
{}

static void ppp_tx_flush(void)
{}

static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code,
		      u8 id, unsigned int len, const void *data)
{}

/* State transition table (compare STD-51)
   Events                                   Actions
   TO+  = Timeout with counter > 0          irc = Initialize-Restart-Count
   TO-  = Timeout with counter expired      zrc = Zero-Restart-Count

   RCR+ = Receive-Configure-Request (Good)  scr = Send-Configure-Request
   RCR- = Receive-Configure-Request (Bad)
   RCA  = Receive-Configure-Ack             sca = Send-Configure-Ack
   RCN  = Receive-Configure-Nak/Rej         scn = Send-Configure-Nak/Rej

   RTR  = Receive-Terminate-Request         str = Send-Terminate-Request
   RTA  = Receive-Terminate-Ack             sta = Send-Terminate-Ack

   RUC  = Receive-Unknown-Code              scj = Send-Code-Reject
   RXJ+ = Receive-Code-Reject (permitted)
       or Receive-Protocol-Reject
   RXJ- = Receive-Code-Reject (catastrophic)
       or Receive-Protocol-Reject
*/
static int cp_table[EVENTS][STATES] =;

/* SCA: RCR+ must supply id, len and data
   SCN: RCR- must supply code, id, len and data
   STA: RTR must supply id
   SCJ: RUC must supply CP packet len and data */
static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,
			 u8 id, unsigned int len, const void *data)
{}

static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,
			    unsigned int req_len, const u8 *data)
{}

static int ppp_rx(struct sk_buff *skb)
{}

static void ppp_timer(struct timer_list *t)
{}

static void ppp_start(struct net_device *dev)
{}

static void ppp_stop(struct net_device *dev)
{}

static void ppp_close(struct net_device *dev)
{}

static struct hdlc_proto proto =;

static const struct header_ops ppp_header_ops =;

static int ppp_ioctl(struct net_device *dev, struct if_settings *ifs)
{}

static int __init hdlc_ppp_init(void)
{}

static void __exit hdlc_ppp_exit(void)
{}

module_init();
module_exit(hdlc_ppp_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();