Changeset View
Changeset View
Standalone View
Standalone View
lib/libifconfig/libifconfig.h
Show All 27 Lines | |||||
#pragma once | #pragma once | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/ip_carp.h> | |||||
#include <netinet6/in6_var.h> | #include <netinet6/in6_var.h> | ||||
#define ND6_IFF_DEFAULTIF 0x8000 | #define ND6_IFF_DEFAULTIF 0x8000 | ||||
typedef enum { | typedef enum { | ||||
OK = 0, | OK = 0, | ||||
OTHER, | OTHER, | ||||
IOCTL, | IOCTL, | ||||
SOCKET | SOCKET, | ||||
NETLINK | |||||
} ifconfig_errtype; | } ifconfig_errtype; | ||||
/* | /* | ||||
* Opaque definition so calling application can just pass a | * Opaque definition so calling application can just pass a | ||||
* pointer to it for library use. | * pointer to it for library use. | ||||
*/ | */ | ||||
struct ifconfig_handle; | struct ifconfig_handle; | ||||
typedef struct ifconfig_handle ifconfig_handle_t; | typedef struct ifconfig_handle ifconfig_handle_t; | ||||
struct carpreq; | |||||
struct ifaddrs; | struct ifaddrs; | ||||
struct ifbropreq; | struct ifbropreq; | ||||
struct ifbreq; | struct ifbreq; | ||||
struct in6_ndireq; | struct in6_ndireq; | ||||
struct lagg_reqall; | struct lagg_reqall; | ||||
struct lagg_reqflags; | struct lagg_reqflags; | ||||
struct lagg_reqopts; | struct lagg_reqopts; | ||||
struct lagg_reqport; | struct lagg_reqport; | ||||
▲ Show 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | |||||
* @param h An open ifconfig state object | * @param h An open ifconfig state object | ||||
* @param name The interface name | * @param name The interface name | ||||
* @param ifdr Return argument. | * @param ifdr Return argument. | ||||
* @return 0 on success, nonzero on failure | * @return 0 on success, nonzero on failure | ||||
*/ | */ | ||||
int ifconfig_media_get_downreason(ifconfig_handle_t *h, const char *name, | int ifconfig_media_get_downreason(ifconfig_handle_t *h, const char *name, | ||||
struct ifdownreason *ifdr); | struct ifdownreason *ifdr); | ||||
struct ifconfig_carp { | |||||
size_t carpr_count; | |||||
uint32_t carpr_vhid; | |||||
uint32_t carpr_state; | |||||
int32_t carpr_advbase; | |||||
int32_t carpr_advskew; | |||||
uint8_t carpr_key[CARP_KEY_LEN]; | |||||
}; | |||||
int ifconfig_carp_get_vhid(ifconfig_handle_t *h, const char *name, | |||||
struct ifconfig_carp *carpr, uint32_t vhid); | |||||
int ifconfig_carp_get_info(ifconfig_handle_t *h, const char *name, | int ifconfig_carp_get_info(ifconfig_handle_t *h, const char *name, | ||||
struct carpreq *carpr, int ncarpr); | struct ifconfig_carp *carpr, size_t ncarp); | ||||
int ifconfig_carp_set_info(ifconfig_handle_t *h, const char *name, | |||||
const struct ifconfig_carp *carpr); | |||||
/** Retrieve additional information about an inet address | /** Retrieve additional information about an inet address | ||||
* @param h An open ifconfig state object | * @param h An open ifconfig state object | ||||
* @param name The interface name | * @param name The interface name | ||||
* @param ifa Pointer to the address structure of interest | * @param ifa Pointer to the address structure of interest | ||||
* @param addr Return argument. It will be filled with additional information | * @param addr Return argument. It will be filled with additional information | ||||
* about the address. | * about the address. | ||||
* @return 0 on success, nonzero on failure. | * @return 0 on success, nonzero on failure. | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |