haiku/headers/private/net/net_datalink_protocol.h
Axel Dörfler 61729d9323 * Reworked the complete stack to allow more than one address per network
interface - this caused quite a number of changes.
* Network interfaces, and its addresses are now reference counted (not yet
  complete, though, InterfaceAddresses need to hold references to their
  interface as well).
* There are two known regressions of this commit that I will fix later:
  - you cannot remove interfaces anymore
  - IPv4 multicast was broken anyway, but now it's disabled, too.
* Moved a device_interfaces.cpp|h out of interfaces.cpp.
* The datalink layer chain is now instantiated per domain per interface,
  not just per interface anymore.
* When a buffer reaches the network layer, it has no known interface yet, ie.
  the ipv4|6|whatever modules need to set this manually.
* Added more debug output, and some new debugger commands, the control option
  is now printed in clear text.
* Added hash_address() function to the address modules. Added "const" to
  set_to_defaults() where needed.
* Fixed net_buffer's restore header functions offset use as reported by Atis.
* Improved buffer dump output, use the domain module to print the address if
  available.
* Moved net_buffer::type into the union, as it's not needed by the upper layers
  anymore.
* Moved IPv6 specific code from {add|remove}_default_route() to where it
  belongs, but disabled it for the time being.
* Completely discarded useless ipv4_datagram module.
* Added ping6 to the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-28 17:38:23 +00:00

47 lines
1.3 KiB
C

/*
* Copyright 2006-2010, 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;
struct net_domain* domain;
} net_datalink_protocol;
struct net_datalink_protocol_module_info {
module_info info;
status_t (*init_protocol)(net_interface* interface, net_domain* domain,
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 (*interface_up)(net_datalink_protocol* self);
void (*interface_down)(net_datalink_protocol* self);
status_t (*change_address)(net_datalink_protocol* self,
net_interface_address* address, int32 option,
const struct sockaddr* oldAddress,
const struct sockaddr* newAddress);
status_t (*control)(net_datalink_protocol* self, int32 option,
void* argument, size_t length);
status_t (*join_multicast)(net_datalink_protocol* self,
const struct sockaddr* address);
status_t (*leave_multicast)(net_datalink_protocol* self,
const struct sockaddr* address);
};
#endif // NET_DATALINK_PROTOCOL_H