2006-08-08 17:07:07 +04:00
|
|
|
/*
|
* 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.
|
2006-08-08 17:07:07 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef NET_DATALINK_H
|
|
|
|
#define NET_DATALINK_H
|
|
|
|
|
|
|
|
|
2010-08-03 15:23:03 +04:00
|
|
|
#include <net/if.h>
|
|
|
|
|
2006-08-08 17:07:07 +04:00
|
|
|
#include <net_buffer.h>
|
|
|
|
#include <net_routing_info.h>
|
|
|
|
|
|
|
|
#include <util/list.h>
|
|
|
|
|
|
|
|
|
|
|
|
#define NET_DATALINK_MODULE_NAME "network/stack/datalink/v1"
|
|
|
|
|
2010-08-03 15:23:03 +04:00
|
|
|
|
2020-03-22 05:22:06 +03:00
|
|
|
class Checksum;
|
2010-08-03 15:23:03 +04:00
|
|
|
struct net_protocol;
|
|
|
|
|
|
|
|
|
2006-08-08 17:07:07 +04:00
|
|
|
typedef struct net_datalink_protocol 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
|
|
|
|
2006-08-08 17:07:07 +04:00
|
|
|
typedef struct net_domain {
|
* 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
|
|
|
const char* name;
|
2006-08-08 17:07:07 +04:00
|
|
|
int family;
|
|
|
|
|
* 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_protocol_module_info* module;
|
|
|
|
struct net_address_module_info* address_module;
|
2006-08-08 17:07:07 +04:00
|
|
|
} net_domain;
|
|
|
|
|
* 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
|
|
|
typedef struct net_interface_address {
|
|
|
|
struct net_domain* domain;
|
|
|
|
struct net_interface* interface;
|
|
|
|
struct sockaddr* local;
|
|
|
|
struct sockaddr* destination;
|
|
|
|
struct sockaddr* mask;
|
2010-08-03 19:51:54 +04:00
|
|
|
uint32_t flags;
|
* 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
|
|
|
} net_interface_address;
|
|
|
|
|
|
|
|
typedef struct net_interface {
|
|
|
|
struct net_device* device;
|
2006-08-08 17:07:07 +04:00
|
|
|
|
|
|
|
char name[IF_NAMESIZE];
|
|
|
|
uint32 index;
|
|
|
|
uint32 flags;
|
|
|
|
uint8 type;
|
|
|
|
uint32 metric;
|
* 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
|
|
|
} net_interface;
|
2006-08-08 17:07:07 +04:00
|
|
|
|
* 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
|
|
|
typedef struct net_route {
|
|
|
|
struct sockaddr* destination;
|
|
|
|
struct sockaddr* mask;
|
|
|
|
struct sockaddr* gateway;
|
2006-08-08 17:07:07 +04:00
|
|
|
uint32 flags;
|
|
|
|
uint32 mtu;
|
* 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_interface_address* interface_address;
|
|
|
|
} net_route;
|
2006-08-08 17:07:07 +04:00
|
|
|
|
* 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
|
|
|
typedef struct net_route_info {
|
2006-08-08 17:07:07 +04:00
|
|
|
struct list_link link;
|
* 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_route* route;
|
2006-08-08 17:07:07 +04:00
|
|
|
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
|
|
|
} net_route_info;
|
|
|
|
|
2006-08-08 17:07:07 +04:00
|
|
|
|
|
|
|
struct net_datalink_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 (*control)(net_domain* domain, int32 option, void* value,
|
|
|
|
size_t* _length);
|
2010-08-03 16:00:06 +04:00
|
|
|
status_t (*send_routed_data)(net_route* route, net_buffer* buffer);
|
|
|
|
status_t (*send_data)(struct net_protocol* 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
|
|
|
net_domain* domain, net_buffer* buffer);
|
|
|
|
|
|
|
|
bool (*is_local_address)(net_domain* domain,
|
|
|
|
const struct sockaddr* address,
|
|
|
|
net_interface_address** _interfaceAddress,
|
|
|
|
uint32* _matchedType);
|
|
|
|
bool (*is_local_link_address)(net_domain* domain,
|
|
|
|
bool unconfigured, const struct sockaddr* address,
|
|
|
|
net_interface_address** _interfaceAddress);
|
|
|
|
|
|
|
|
net_interface* (*get_interface)(net_domain* domain, uint32 index);
|
|
|
|
net_interface* (*get_interface_with_address)(
|
|
|
|
const struct sockaddr* address);
|
|
|
|
void (*put_interface)(net_interface* interface);
|
|
|
|
|
|
|
|
net_interface_address* (*get_interface_address)(
|
|
|
|
const struct sockaddr* address);
|
|
|
|
bool (*get_next_interface_address)(net_interface* interface,
|
|
|
|
net_interface_address** _address);
|
|
|
|
void (*put_interface_address)(net_interface_address* address);
|
|
|
|
|
|
|
|
status_t (*join_multicast)(net_interface* interface,
|
|
|
|
net_domain* domain, const struct sockaddr* address);
|
|
|
|
status_t (*leave_multicast)(net_interface* interface,
|
|
|
|
net_domain* domain, const struct sockaddr* address);
|
2006-08-08 17:07:07 +04:00
|
|
|
|
|
|
|
// routes
|
* 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 (*add_route)(net_domain* domain, const net_route* route);
|
|
|
|
status_t (*remove_route)(net_domain* domain, const net_route* route);
|
|
|
|
net_route* (*get_route)(net_domain* domain,
|
|
|
|
const struct sockaddr* address);
|
|
|
|
status_t (*get_buffer_route)(net_domain* domain,
|
|
|
|
struct net_buffer* buffer, net_route** _route);
|
|
|
|
void (*put_route)(net_domain* domain, net_route* route);
|
|
|
|
|
|
|
|
status_t (*register_route_info)(net_domain* domain,
|
|
|
|
net_route_info* info);
|
|
|
|
status_t (*unregister_route_info)(net_domain* domain,
|
|
|
|
net_route_info* info);
|
|
|
|
status_t (*update_route_info)(net_domain* domain,
|
|
|
|
net_route_info* info);
|
2006-08-08 17:07:07 +04:00
|
|
|
};
|
|
|
|
|
2010-07-28 21:09:12 +04:00
|
|
|
#define NET_ADDRESS_MODULE_FLAG_BROADCAST_ADDRESS 0x01
|
|
|
|
|
2006-08-08 17:07:07 +04:00
|
|
|
struct net_address_module_info {
|
|
|
|
module_info info;
|
2010-07-28 21:09:12 +04:00
|
|
|
uint32 flags;
|
2006-08-08 17:07:07 +04:00
|
|
|
|
* 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 (*copy_address)(const struct sockaddr* from,
|
|
|
|
struct sockaddr** to, bool replaceWithZeros,
|
|
|
|
const struct sockaddr* mask);
|
|
|
|
|
|
|
|
status_t (*mask_address)(const struct sockaddr* address,
|
|
|
|
const struct sockaddr* mask, struct sockaddr* result);
|
|
|
|
|
|
|
|
bool (*equal_addresses)(const struct sockaddr* a,
|
|
|
|
const struct sockaddr* b);
|
|
|
|
bool (*equal_ports)(const struct sockaddr* a,
|
|
|
|
const struct sockaddr* b);
|
|
|
|
bool (*equal_addresses_and_ports)(const struct sockaddr* a,
|
|
|
|
const struct sockaddr* b);
|
|
|
|
bool (*equal_masked_addresses)(const struct sockaddr* a,
|
|
|
|
const struct sockaddr* b, const struct sockaddr* mask);
|
|
|
|
bool (*is_empty_address)(const struct sockaddr* address,
|
|
|
|
bool checkPort);
|
|
|
|
bool (*is_same_family)(const struct sockaddr* address);
|
|
|
|
|
|
|
|
int32 (*first_mask_bit)(const struct sockaddr* mask);
|
|
|
|
|
|
|
|
bool (*check_mask)(const struct sockaddr* address);
|
|
|
|
|
|
|
|
status_t (*print_address)(const struct sockaddr* address,
|
|
|
|
char** buffer, bool printPort);
|
|
|
|
status_t (*print_address_buffer)(const struct sockaddr* address,
|
|
|
|
char* buffer, size_t bufferSize, bool printPort);
|
|
|
|
|
|
|
|
uint16 (*get_port)(const struct sockaddr* address);
|
|
|
|
status_t (*set_port)(struct sockaddr* address, uint16 port);
|
|
|
|
|
|
|
|
status_t (*set_to)(struct sockaddr* address,
|
|
|
|
const struct sockaddr* from);
|
|
|
|
status_t (*set_to_empty_address)(struct sockaddr* address);
|
|
|
|
status_t (*set_to_defaults)(struct sockaddr* defaultMask,
|
|
|
|
struct sockaddr* defaultBroadcast,
|
|
|
|
const struct sockaddr* address,
|
|
|
|
const struct sockaddr* netmask);
|
|
|
|
|
|
|
|
status_t (*update_to)(struct sockaddr* address,
|
|
|
|
const struct sockaddr* from);
|
|
|
|
|
|
|
|
uint32 (*hash_address)(const struct sockaddr* address,
|
|
|
|
bool includePort);
|
|
|
|
uint32 (*hash_address_pair)(const struct sockaddr* ourAddress,
|
|
|
|
const struct sockaddr* peerAddress);
|
|
|
|
|
2020-03-22 05:22:06 +03:00
|
|
|
status_t (*checksum_address)(Checksum* checksum,
|
* 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
|
|
|
const struct sockaddr* address);
|
|
|
|
|
|
|
|
void (*get_loopback_address)(struct sockaddr* result);
|
2006-08-08 17:07:07 +04:00
|
|
|
};
|
|
|
|
|
* 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
|
|
|
|
2006-08-08 17:07:07 +04:00
|
|
|
#endif // NET_DATALINK_H
|