* Renamed the proprietary SIOC_* ioctls to B_SOCKET_* - no reason to pollute
global name space, and have ugly identifiers for nothing :-)
* Added a flags field to struct ifaliasreq. Added flags to mark an alias that
is currently being configured, or has been automatically configured.
Those flags aren't used yet, but they will replace IFF_CONFIGURING and
friends.
* Implemented deleting addresses only from interfaces via ifconfig.
* Added more command aliases for delete to ifconfig ("del", and "delete", for
more consistency with route).
* Fixed control_routes() to only release a reference to an address if it
actually got one before.
* If an interface address is deleted, its routes are now removed as well.
* InterfaceAddress now holds a reference to its interface as planned.
* Implemented removing interfaces. Works quite nicely.
* When downing an interface, all of its routes are now removed. When upping
it again, at least the default routes are added.
* datalink.cpp's get_interface_name_or_index() leaked a reference to the
interface found.
* SIOCAIFADDR would also leak a reference when new addresses were added.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37872 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -61,6 +61,7 @@ struct ifaliasreq {
|
||||
struct sockaddr_storage ifra_destination;
|
||||
};
|
||||
struct sockaddr_storage ifra_mask;
|
||||
uint32_t ifra_flags;
|
||||
};
|
||||
|
||||
/* interface flags */
|
||||
@@ -74,10 +75,15 @@ struct ifaliasreq {
|
||||
#define IFF_ALLMULTI 0x0200 /* receive all multicast packets */
|
||||
#define IFF_SIMPLEX 0x0800 /* doesn't receive own transmissions */
|
||||
#define IFF_LINK 0x1000 /* has link */
|
||||
#define IFF_AUTO_CONFIGURED 0x2000 /* has been automatically configured */
|
||||
#define IFF_CONFIGURING 0x4000 /* auto configuration in progress */
|
||||
#define IFF_AUTO_CONFIGURED 0x2000
|
||||
#define IFF_CONFIGURING 0x4000
|
||||
#define IFF_MULTICAST 0x8000 /* supports multicast */
|
||||
|
||||
/* interface alias flags */
|
||||
#define IFAF_AUTO_CONFIGURED 0x0001 /* has been automatically configured */
|
||||
#define IFAF_CONFIGURING 0x0002 /* auto configuration in progress */
|
||||
|
||||
|
||||
/* used with SIOCGIFCOUNT, and SIOCGIFCONF */
|
||||
struct ifconf {
|
||||
int ifc_len; /* size of buffer */
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#define _SYS_SOCKIO_H
|
||||
|
||||
|
||||
/*! Socket I/O control codes, usually via struct ifreq */
|
||||
/*! Socket I/O control codes, usually via struct ifreq, most of them should
|
||||
be compatible with the BSDs.
|
||||
*/
|
||||
|
||||
|
||||
#define SIOCADDRT 8900 /* add route */
|
||||
@@ -66,11 +68,12 @@
|
||||
#define SIOCSIFGENERIC 8945 /* generic IF set op */
|
||||
#define SIOCGIFGENERIC 8946 /* generic IF get op */
|
||||
|
||||
#define SIOC_IF_ALIAS_REMOVE 8918 /* synonym for SIOCDIFADDR */
|
||||
#define SIOC_IF_ALIAS_ADD 8919 /* synonym for SIOCAIFADDR */
|
||||
#define SIOC_IF_ALIAS_SET 8947 /* set interface alias, ifaliasreq */
|
||||
#define SIOC_IF_ALIAS_GET 8948 /* get interface alias, ifaliasreq */
|
||||
#define SIOC_IF_ALIAS_COUNT 8959 /* count interface aliases */
|
||||
/* Haiku specific extensions */
|
||||
#define B_SOCKET_REMOVE_ALIAS 8918 /* synonym for SIOCDIFADDR */
|
||||
#define B_SOCKET_ADD_ALIAS 8919 /* synonym for SIOCAIFADDR */
|
||||
#define B_SOCKET_SET_ALIAS 8947 /* set interface alias, ifaliasreq */
|
||||
#define B_SOCKET_GET_ALIAS 8948 /* get interface alias, ifaliasreq */
|
||||
#define B_SOCKET_COUNT_ALIASES 8949 /* count interface aliases */
|
||||
|
||||
#define SIOCEND 9000 /* SIOCEND >= highest SIOC* */
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ typedef struct net_interface_address {
|
||||
struct sockaddr* local;
|
||||
struct sockaddr* destination;
|
||||
struct sockaddr* mask;
|
||||
uint32_t flags;
|
||||
} net_interface_address;
|
||||
|
||||
typedef struct net_interface {
|
||||
|
||||
Reference in New Issue
Block a user