linux/net/phonet/af_phonet.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * File: af_phonet.c
 *
 * Phonet protocols family
 *
 * Copyright (C) 2008 Nokia Corporation.
 *
 * Authors: Sakari Ailus <[email protected]>
 *          Rémi Denis-Courmont
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
#include <net/sock.h>

#include <linux/if_phonet.h>
#include <linux/phonet.h>
#include <net/phonet/phonet.h>
#include <net/phonet/pn_dev.h>

/* Transport protocol registration */
static const struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;

static const struct phonet_protocol *phonet_proto_get(unsigned int protocol)
{}

static inline void phonet_proto_put(const struct phonet_protocol *pp)
{}

/* protocol family functions */

static int pn_socket_create(struct net *net, struct socket *sock, int protocol,
			    int kern)
{}

static const struct net_proto_family phonet_proto_family =;

/* Phonet device header operations */
static int pn_header_create(struct sk_buff *skb, struct net_device *dev,
				unsigned short type, const void *daddr,
				const void *saddr, unsigned int len)
{}

static int pn_header_parse(const struct sk_buff *skb, unsigned char *haddr)
{}

const struct header_ops phonet_header_ops =;
EXPORT_SYMBOL();

/*
 * Prepends an ISI header and sends a datagram.
 */
static int pn_send(struct sk_buff *skb, struct net_device *dev,
			u16 dst, u16 src, u8 res)
{}

static int pn_raw_send(const void *data, int len, struct net_device *dev,
			u16 dst, u16 src, u8 res)
{}

/*
 * Create a Phonet header for the skb and send it out. Returns
 * non-zero error code if failed. The skb is freed then.
 */
int pn_skb_send(struct sock *sk, struct sk_buff *skb,
		const struct sockaddr_pn *target)
{}
EXPORT_SYMBOL();

/* Do not send an error message in response to an error message */
static inline int can_respond(struct sk_buff *skb)
{}

static int send_obj_unreachable(struct sk_buff *rskb)
{}

static int send_reset_indications(struct sk_buff *rskb)
{}


/* packet type functions */

/*
 * Stuff received packets to associated sockets.
 * On error, returns non-zero and releases the skb.
 */
static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
			struct packet_type *pkttype,
			struct net_device *orig_dev)
{}

static struct packet_type phonet_packet_type __read_mostly =;

static DEFINE_MUTEX(proto_tab_lock);

int __init_or_module phonet_proto_register(unsigned int protocol,
				const struct phonet_protocol *pp)
{}
EXPORT_SYMBOL();

void phonet_proto_unregister(unsigned int protocol,
			const struct phonet_protocol *pp)
{}
EXPORT_SYMBOL();

/* Module registration */
static int __init phonet_init(void)
{}

static void __exit phonet_exit(void)
{}

module_init();
module_exit(phonet_exit);
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS_NETPROTO();