2006-08-08 13:07:07 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2006, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef NET_DATALINK_PROTOCOL_H
|
|
|
|
#define NET_DATALINK_PROTOCOL_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <net_buffer.h>
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct net_datalink_protocol {
|
|
|
|
struct net_datalink_protocol *next;
|
|
|
|
struct net_datalink_protocol_module_info *module;
|
|
|
|
struct net_interface *interface;
|
|
|
|
} net_datalink_protocol;
|
|
|
|
|
|
|
|
struct net_datalink_protocol_module_info {
|
|
|
|
module_info info;
|
|
|
|
|
|
|
|
status_t (*init_protocol)(struct net_interface *interface,
|
|
|
|
net_datalink_protocol **_protocol);
|
|
|
|
status_t (*uninit_protocol)(net_datalink_protocol *self);
|
|
|
|
|
|
|
|
status_t (*send_data)(net_datalink_protocol *self,
|
|
|
|
net_buffer *buffer);
|
Work in progress commit by Atis Elsts (I'm posting his ChangeLog comments
directly here), I made only a few style changes:
* introduced 'has_broadcast_address' field in
struct net_address_module_info
- REVIEW: the name, and the status of this field for UNIX and L2CAP
families
* ipv6 address family support
* ipv6 address printing
* ipv6 protocol support
* ipv6 multicast support
- TODO: add and remove multicast routes in a more proper way
- TODO: support MLD
* ipv6 datalink protocol support
* icmpv6 protocol support (EchoRequest and EchoResponse messages)
* ipv6 neigbor discovery protocol support
(Advertisement and Solicitation messages)
- TODO: only the very basic support is present,
the protocol state machine is by no means completed
- TODO: replying to Solicitation does not work too good ATM
(visible, when pinging Haiku from outside)
* added Jenkin's hash algorith
* minor changes in existing IPv4 code - cleanup function
ipv4_get_loopback_address(), written by myself
* add tests: raw, udp, tcp/udp, mullicast sender
* add 'hoplimit' field in struct net_buffer
- TODO: this is just a hack, more generic approach would be better.
* add 'receive_data' function pointer in
struct net_datalink_protocol_module_info
- TODO: this is also more like a hack, to support information
passing from ICMPv6 to IPv6_datagram level.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37604 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-19 16:55:55 +00:00
|
|
|
status_t (*receive_data)(net_buffer *buffer);
|
2006-08-08 13:07:07 +00:00
|
|
|
|
|
|
|
status_t (*interface_up)(net_datalink_protocol *self);
|
|
|
|
void (*interface_down)(net_datalink_protocol *self);
|
|
|
|
|
|
|
|
status_t (*control)(net_datalink_protocol *self,
|
|
|
|
int32 op, void *argument, size_t length);
|
2007-05-01 11:38:39 +00:00
|
|
|
|
|
|
|
status_t (*join_multicast)(net_datalink_protocol *self,
|
|
|
|
const sockaddr *address);
|
|
|
|
status_t (*leave_multicast)(net_datalink_protocol *self,
|
|
|
|
const sockaddr *address);
|
2006-08-08 13:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NET_DATALINK_PROTOCOL_H
|