8d1485fa06
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
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
/*
|
|
* 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);
|
|
status_t (*receive_data)(net_buffer *buffer);
|
|
|
|
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);
|
|
|
|
status_t (*join_multicast)(net_datalink_protocol *self,
|
|
const sockaddr *address);
|
|
status_t (*leave_multicast)(net_datalink_protocol *self,
|
|
const sockaddr *address);
|
|
};
|
|
|
|
#endif // NET_DATALINK_PROTOCOL_H
|