FreeBSD kernel IPv4 code
ip_carp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  carp_header
 
struct  carpstats
 
struct  carpreq
 

Macros

#define CARP_DFLTTL   255
 
#define CARP_VERSION   2
 
#define CARP_ADVERTISEMENT   0x01
 
#define CARP_KEY_LEN   20 /* a sha1 hash of a passphrase */
 
#define CARP_DFLTINTV   1
 
#define CARP_MAXVHID   255
 
#define CARP_STATES   "INIT", "BACKUP", "MASTER"
 
#define CARP_MAXSTATE   2
 
#define CARP_MAXSKEW   240
 
#define SIOCSVH   _IOWR('i', 245, struct ifreq)
 
#define SIOCGVH   _IOWR('i', 246, struct ifreq)
 

Functions

int carp_ioctl (struct ifreq *, u_long, struct thread *)
 
int carp_attach (struct ifaddr *, int)
 
void carp_detach (struct ifaddr *, bool)
 
void carp_carpdev_state (struct ifnet *)
 
int carp_input (struct mbuf **, int *, int)
 
int carp6_input (struct mbuf **, int *, int)
 
int carp_output (struct ifnet *, struct mbuf *, const struct sockaddr *)
 
int carp_master (struct ifaddr *)
 
int carp_iamatch (struct ifaddr *, uint8_t **)
 
struct ifaddr * carp_iamatch6 (struct ifnet *, struct in6_addr *)
 
char * carp_macmatch6 (struct ifnet *, struct mbuf *, const struct in6_addr *)
 
int carp_forus (struct ifnet *, u_char *)
 

Variables

struct carp_header __packed
 
int(* carp_ioctl_p )(struct ifreq *, u_long, struct thread *)
 
int(* carp_attach_p )(struct ifaddr *, int)
 
void(* carp_detach_p )(struct ifaddr *, bool)
 
void(* carp_linkstate_p )(struct ifnet *)
 
void(* carp_demote_adj_p )(int, char *)
 
int(* carp_master_p )(struct ifaddr *)
 
int(* carp_forus_p )(struct ifnet *, u_char *)
 
int(* carp_output_p )(struct ifnet *, struct mbuf *, const struct sockaddr *)
 
int(* carp_get_vhid_p )(struct ifaddr *)
 

Macro Definition Documentation

◆ CARP_ADVERTISEMENT

#define CARP_ADVERTISEMENT   0x01

Definition at line 91 of file ip_carp.h.

◆ CARP_DFLTINTV

#define CARP_DFLTINTV   1

Definition at line 96 of file ip_carp.h.

◆ CARP_DFLTTL

#define CARP_DFLTTL   255

Definition at line 85 of file ip_carp.h.

◆ CARP_KEY_LEN

#define CARP_KEY_LEN   20 /* a sha1 hash of a passphrase */

Definition at line 93 of file ip_carp.h.

◆ CARP_MAXSKEW

#define CARP_MAXSKEW   240

Definition at line 133 of file ip_carp.h.

◆ CARP_MAXSTATE

#define CARP_MAXSTATE   2

Definition at line 131 of file ip_carp.h.

◆ CARP_MAXVHID

#define CARP_MAXVHID   255

Definition at line 128 of file ip_carp.h.

◆ CARP_STATES

#define CARP_STATES   "INIT", "BACKUP", "MASTER"

Definition at line 130 of file ip_carp.h.

◆ CARP_VERSION

#define CARP_VERSION   2

Definition at line 88 of file ip_carp.h.

◆ SIOCGVH

#define SIOCGVH   _IOWR('i', 246, struct ifreq)

Definition at line 138 of file ip_carp.h.

◆ SIOCSVH

#define SIOCSVH   _IOWR('i', 245, struct ifreq)

Definition at line 137 of file ip_carp.h.

Function Documentation

◆ carp6_input()

int carp6_input ( struct mbuf **  ,
int *  ,
int   
)

◆ carp_attach()

int carp_attach ( struct ifaddr *  ifa,
int  vhid 
)

Definition at line 1910 of file ip_carp.c.

References carp_grow_ifas(), CARP_LOCK, carp_multicast_setup(), carp_sc_state(), CARP_UNLOCK, CIF_FREE, IFNET_FOREACH_CARP, carp_softc::sc_ifas, carp_softc::sc_ifasiz, carp_softc::sc_naddrs, carp_softc::sc_naddrs6, and carp_softc::sc_vhid.

Referenced by carp_mod_load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ carp_carpdev_state()

void carp_carpdev_state ( struct ifnet *  )

◆ carp_detach()

void carp_detach ( struct ifaddr *  ifa,
bool  keep_cif 
)

Definition at line 1986 of file ip_carp.c.

References carp_destroy(), carp_ifa_delroute(), CARP_LOCK, carp_multicast_cleanup(), carp_sc_state(), CARP_UNLOCK, CIF_FREE, carp_softc::sc_ifas, carp_softc::sc_naddrs, and carp_softc::sc_naddrs6.

Referenced by carp_mod_load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ carp_forus()

int carp_forus ( struct ifnet *  ifp,
u_char *  dhost 
)

Definition at line 1243 of file ip_carp.c.

References CIF_LOCK, CIF_UNLOCK, IFNET_FOREACH_CARP, carp_softc::MASTER, carp_softc::sc_addr, and carp_softc::sc_state.

Referenced by carp_mod_load().

Here is the caller graph for this function:

◆ carp_iamatch()

int carp_iamatch ( struct ifaddr *  ,
uint8_t **   
)

Referenced by carp_mod_load().

Here is the caller graph for this function:

◆ carp_iamatch6()

struct ifaddr * carp_iamatch6 ( struct ifnet *  ,
struct in6_addr *   
)

Referenced by carp_mod_load().

Here is the caller graph for this function:

◆ carp_input()

int carp_input ( struct mbuf **  ,
int *  ,
int   
)

◆ carp_ioctl()

◆ carp_macmatch6()

char * carp_macmatch6 ( struct ifnet *  ,
struct mbuf *  ,
const struct in6_addr *   
)

Referenced by carp_mod_load().

Here is the caller graph for this function:

◆ carp_master()

int carp_master ( struct ifaddr *  ifa)

Definition at line 1124 of file ip_carp.c.

References carp_softc::MASTER, and carp_softc::sc_state.

Referenced by carp_mod_load().

Here is the caller graph for this function:

◆ carp_output()

int carp_output ( struct ifnet *  ifp,
struct mbuf *  m,
const struct sockaddr *  sa 
)

Definition at line 1527 of file ip_carp.c.

References carp_softc::sc_vhid.

Referenced by carp_mod_load().

Here is the caller graph for this function:

Variable Documentation

◆ __packed

struct carp_header __packed

◆ carp_attach_p

int(* carp_attach_p) (struct ifaddr *, int) ( struct ifaddr *  ,
int   
)
extern

◆ carp_demote_adj_p

void(* carp_demote_adj_p) (int, char *) ( int  ,
char *   
)
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().

◆ carp_detach_p

void(* carp_detach_p) (struct ifaddr *, bool) ( struct ifaddr *  ,
bool   
)
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().

◆ carp_forus_p

int(* carp_forus_p) (struct ifnet *, u_char *) ( struct ifnet *  ,
u_char *   
)
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().

◆ carp_get_vhid_p

int(* carp_get_vhid_p) (struct ifaddr *) ( struct ifaddr *  )
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().

◆ carp_ioctl_p

int(* carp_ioctl_p) (struct ifreq *, u_long, struct thread *) ( struct ifreq *  ,
u_long  ,
struct thread *   
)
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().

◆ carp_linkstate_p

void(* carp_linkstate_p) (struct ifnet *) ( struct ifnet *  )
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().

◆ carp_master_p

int(* carp_master_p) (struct ifaddr *) ( struct ifaddr *  )
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().

◆ carp_output_p

int(* carp_output_p) (struct ifnet *, struct mbuf *, const struct sockaddr *) ( struct ifnet *  ,
struct mbuf *  ,
const struct sockaddr *   
)
extern

Referenced by carp_mod_cleanup(), and carp_mod_load().