xref: /haiku/headers/private/net/net_datalink_protocol.h (revision 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef NET_DATALINK_PROTOCOL_H
6 #define NET_DATALINK_PROTOCOL_H
7 
8 
9 #include <net_buffer.h>
10 
11 
12 typedef struct net_datalink_protocol {
13 	struct net_datalink_protocol				*next;
14 	struct net_datalink_protocol_module_info	*module;
15 	struct net_interface						*interface;
16 } net_datalink_protocol;
17 
18 struct net_datalink_protocol_module_info {
19 	module_info info;
20 
21 	status_t	(*init_protocol)(struct net_interface *interface,
22 					net_datalink_protocol **_protocol);
23 	status_t	(*uninit_protocol)(net_datalink_protocol *self);
24 
25 	status_t	(*send_data)(net_datalink_protocol *self,
26 					net_buffer *buffer);
27 
28 	status_t	(*interface_up)(net_datalink_protocol *self);
29 	void		(*interface_down)(net_datalink_protocol *self);
30 
31 	status_t	(*control)(net_datalink_protocol *self,
32 					int32 op, void *argument, size_t length);
33 };
34 
35 #endif	// NET_DATALINK_PROTOCOL_H
36