*
* Copyright 1997 by Henner Eisen <eis@baty.hanse.de>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*/
#ifndef _LINUX_CONCAP_H
#define _LINUX_CONCAP_H
#include <linux/skbuff.h>
#include <linux/netdevice.h>
protocol is processed at the uppermost layer of the network interface.
Based on a ideas developed in a 'synchronous device' thread in the
linux-x25 mailing list contributed by Alan Cox, Thomasz Motylewski
and Jonathan Naylor.
For more documetation on this refer to Documentation/isdn/README.concap
*/
struct concap_proto_ops;
struct concap_device_ops;
*/
struct concap_proto{
struct net_device *net_dev;
struct concap_device_ops *dops;
struct concap_proto_ops *pops;
spinlock_t lock;
int flags;
void *proto_data;
be accessed via *pops methods only*/
:
whatever
:
*/
};
* protocol entity. No receive method is offered because the encapsulation
* protocol directly calls netif_rx().
*/
struct concap_device_ops{
int (*data_req)(struct concap_proto *, struct sk_buff *);
support connection control.*/
int (*connect_req)(struct concap_proto *);
int (*disconn_req)(struct concap_proto *);
};
* device driver.
*/
struct concap_proto_ops{
struct concap_proto * (*proto_new) (void);
cprot may no loger be referenced after calling this */
void (*proto_del)(struct concap_proto *cprot);
or when the device driver resets the interface. All services of the
encapsulation protocol may be used after this*/
int (*restart)(struct concap_proto *cprot,
struct net_device *ndev,
struct concap_device_ops *dops);
protocol may not call any *dops methods after this. */
int (*close)(struct concap_proto *cprot);
int (*encap_and_xmit)(struct concap_proto *cprot, struct sk_buff *skb);
int (*data_ind)(struct concap_proto *cprot, struct sk_buff *skb);
Protocols that don't process these primitives might fill in
dummy methods here */
int (*connect_ind)(struct concap_proto *cprot);
int (*disconn_ind)(struct concap_proto *cprot);
Some network device support functions, like net_header(), rebuild_header(),
and others, that depend solely on the encapsulation protocol, might
be provided here, too. The net device would just fill them in its
corresponding fields when it is opened.
*/
};
*/
extern int concap_nop(struct concap_proto *cprot);
*/
extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb);
#endif