haiku/headers/private/net/net_datalink_protocol.h

47 lines
1.3 KiB
C
Raw Normal View History

/*
* 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 21:38:23 +04:00
* 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 {
* 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 21:38:23 +04:00
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;
* 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 21:38:23 +04:00
status_t (*init_protocol)(net_interface* interface, net_domain* domain,
net_datalink_protocol** _protocol);
status_t (*uninit_protocol)(net_datalink_protocol* self);
* 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 21:38:23 +04:00
status_t (*send_data)(net_datalink_protocol* self, net_buffer* buffer);
* 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 21:38:23 +04:00
status_t (*interface_up)(net_datalink_protocol* self);
void (*interface_down)(net_datalink_protocol* self);
* 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 21:38:23 +04:00
status_t (*change_address)(net_datalink_protocol* self,
net_interface_address* address, int32 option,
const struct sockaddr* oldAddress,
const struct sockaddr* newAddress);
* 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 21:38:23 +04:00
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);
};
* 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 21:38:23 +04:00
#endif // NET_DATALINK_PROTOCOL_H