FreeBSD kernel IPv4 code
|
#include <sys/cdefs.h>
#include "opt_bpf.h"
#include "opt_inet.h"
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/devctl.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/taskqueue.h>
#include <sys/counter.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/if_llatbl.h>
#include <net/if_types.h>
#include <net/route.h>
#include <net/vnet.h>
#include <crypto/sha1.h>
Go to the source code of this file.
Data Structures | |
struct | carp_softc |
struct | carp_if |
Macros | |
#define | CARP_SENDAD_MAX_ERRORS 3 |
#define | CARP_SENDAD_MIN_SUCCESS 3 |
#define | CARP_HMAC_PAD 64 |
#define | CIF_PROMISC 0x00000001 |
#define | CARP_INET 0 |
#define | CARP_INET6 1 |
#define | V_carp_allow VNET(carp_allow) |
#define | V_carp_dscp VNET(carp_dscp) |
#define | V_carp_preempt VNET(carp_preempt) |
#define | V_carp_log VNET(carp_log) |
#define | V_carp_demotion VNET(carp_demotion) |
#define | V_carp_senderr_adj VNET(carp_senderr_adj) |
#define | V_carp_ifdown_adj VNET(carp_ifdown_adj) |
#define | CARPSTATS_ADD(name, val) |
#define | CARPSTATS_INC(name) CARPSTATS_ADD(name, 1) |
#define | CARP_LOCK_INIT(sc) |
#define | CARP_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) |
#define | CARP_LOCK_ASSERT(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) |
#define | CARP_LOCK(sc) mtx_lock(&(sc)->sc_mtx) |
#define | CARP_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) |
#define | CIF_LOCK_INIT(cif) |
#define | CIF_LOCK_DESTROY(cif) mtx_destroy(&(cif)->cif_mtx) |
#define | CIF_LOCK_ASSERT(cif) mtx_assert(&(cif)->cif_mtx, MA_OWNED) |
#define | CIF_LOCK(cif) mtx_lock(&(cif)->cif_mtx) |
#define | CIF_UNLOCK(cif) mtx_unlock(&(cif)->cif_mtx) |
#define | CIF_FREE(cif) |
#define | CARP_LOG(...) |
#define | CARP_DEBUG(...) |
#define | IFNET_FOREACH_IFA(ifp, ifa) |
#define | CARP_FOREACH_IFA(sc, ifa) |
#define | IFNET_FOREACH_CARP(ifp, sc) |
#define | DEMOTE_ADVSKEW(sc) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_CARP, "CARP", "CARP addresses") |
VNET_DEFINE_STATIC (int, carp_allow) | |
VNET_DEFINE_STATIC (int, carp_dscp) | |
VNET_DEFINE_STATIC (int, carp_preempt)=0 | |
VNET_DEFINE_STATIC (int, carp_log) | |
VNET_DEFINE_STATIC (int, carp_demotion)=0 | |
VNET_DEFINE_STATIC (int, carp_senderr_adj) | |
VNET_DEFINE_STATIC (int, carp_ifdown_adj) | |
static int | carp_allow_sysctl (SYSCTL_HANDLER_ARGS) |
static int | carp_dscp_sysctl (SYSCTL_HANDLER_ARGS) |
static int | carp_demote_adj_sysctl (SYSCTL_HANDLER_ARGS) |
SYSCTL_NODE (_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "CARP") | |
SYSCTL_PROC (_net_inet_carp, OID_AUTO, allow, CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, 0, 0, carp_allow_sysctl, "I", "Accept incoming CARP packets") | |
SYSCTL_PROC (_net_inet_carp, OID_AUTO, dscp, CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, 0, 0, carp_dscp_sysctl, "I", "DSCP value for carp packets") | |
SYSCTL_INT (_net_inet_carp, OID_AUTO, preempt, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(carp_preempt), 0, "High-priority backup preemption mode") | |
SYSCTL_INT (_net_inet_carp, OID_AUTO, log, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(carp_log), 0, "CARP log level") | |
SYSCTL_PROC (_net_inet_carp, OID_AUTO, demotion, CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, 0, 0, carp_demote_adj_sysctl, "I", "Adjust demotion factor (skew of advskew)") | |
SYSCTL_INT (_net_inet_carp, OID_AUTO, senderr_demotion_factor, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(carp_senderr_adj), 0, "Send error demotion factor adjustment") | |
SYSCTL_INT (_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(carp_ifdown_adj), 0, "Interface down demotion factor adjustment") | |
VNET_PCPUSTAT_DEFINE (struct carpstats, carpstats) | |
VNET_PCPUSTAT_SYSINIT (carpstats) | |
VNET_PCPUSTAT_SYSUNINIT (carpstats) | |
SYSCTL_VNET_PCPUSTAT (_net_inet_carp, OID_AUTO, stats, struct carpstats, carpstats, "CARP statistics (struct carpstats, netinet/ip_carp.h)") | |
static void | carp_input_c (struct mbuf *, struct carp_header *, sa_family_t) |
static struct carp_softc * | carp_alloc (struct ifnet *) |
static void | carp_destroy (struct carp_softc *) |
static struct carp_if * | carp_alloc_if (struct ifnet *) |
static void | carp_free_if (struct carp_if *) |
static void | carp_set_state (struct carp_softc *, int, const char *reason) |
static void | carp_sc_state (struct carp_softc *) |
static void | carp_setrun (struct carp_softc *, sa_family_t) |
static void | carp_master_down (void *) |
static void | carp_master_down_locked (struct carp_softc *, const char *reason) |
static void | carp_send_ad (void *) |
static void | carp_send_ad_locked (struct carp_softc *) |
static void | carp_addroute (struct carp_softc *) |
static void | carp_ifa_addroute (struct ifaddr *) |
static void | carp_delroute (struct carp_softc *) |
static void | carp_ifa_delroute (struct ifaddr *) |
static void | carp_send_ad_all (void *, int) |
static void | carp_demote_adj (int, char *) |
static | LIST_HEAD (carp_softc) |
static void | carp_hmac_generate (struct carp_softc *sc, uint32_t counter[2], unsigned char md[20]) |
static int | carp_hmac_verify (struct carp_softc *sc, uint32_t counter[2], unsigned char md[20]) |
static int | carp_source_is_self (struct mbuf *m, struct ifaddr *ifa, sa_family_t af) |
static int | carp_prepare_ad (struct mbuf *m, struct carp_softc *sc, struct carp_header *ch) |
static void | carp_send_ad_all (void *ctx __unused, int pending __unused) |
static void | carp_send_ad_error (struct carp_softc *sc, int error) |
static struct ifaddr * | carp_best_ifa (int af, struct ifnet *ifp) |
int | carp_master (struct ifaddr *ifa) |
int | carp_forus (struct ifnet *ifp, u_char *dhost) |
static int | carp_multicast_setup (struct carp_if *cif, sa_family_t sa) |
static void | carp_multicast_cleanup (struct carp_if *cif, sa_family_t sa) |
int | carp_output (struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa) |
static void | carp_grow_ifas (struct carp_softc *sc) |
static void | carp_carprcp (struct carpreq *carpr, struct carp_softc *sc, int priv) |
int | carp_ioctl (struct ifreq *ifr, u_long cmd, struct thread *td) |
static int | carp_get_vhid (struct ifaddr *ifa) |
int | carp_attach (struct ifaddr *ifa, int vhid) |
void | carp_detach (struct ifaddr *ifa, bool keep_cif) |
static void | carp_linkstate (struct ifnet *ifp) |
static void | carp_mod_cleanup (void) |
static int | carp_mod_load (void) |
static int | carp_modevent (module_t mod, int type, void *data) |
DECLARE_MODULE (carp, carp_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY) | |
Variables | |
static int | proto_reg [] = {-1, -1} |
static moduledata_t | carp_mod |
#define CARP_DEBUG | ( | ... | ) |
#define CARP_FOREACH_IFA | ( | sc, | |
ifa | |||
) |
#define CARP_LOCK_ASSERT | ( | sc | ) | mtx_assert(&(sc)->sc_mtx, MA_OWNED) |
#define CARP_LOCK_DESTROY | ( | sc | ) | mtx_destroy(&(sc)->sc_mtx) |
#define CARP_LOCK_INIT | ( | sc | ) |
#define CARP_LOG | ( | ... | ) |
#define CARPSTATS_ADD | ( | name, | |
val | |||
) |
#define CARPSTATS_INC | ( | name | ) | CARPSTATS_ADD(name, 1) |
#define CIF_FREE | ( | cif | ) |
#define CIF_LOCK_ASSERT | ( | cif | ) | mtx_assert(&(cif)->cif_mtx, MA_OWNED) |
#define CIF_LOCK_DESTROY | ( | cif | ) | mtx_destroy(&(cif)->cif_mtx) |
#define CIF_LOCK_INIT | ( | cif | ) |
#define CIF_PROMISC 0x00000001 |
#define DEMOTE_ADVSKEW | ( | sc | ) |
#define IFNET_FOREACH_CARP | ( | ifp, | |
sc | |||
) |
#define IFNET_FOREACH_IFA | ( | ifp, | |
ifa | |||
) |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 1062 of file ip_carp.c.
References CARP_FOREACH_IFA, and carp_ifa_addroute().
Referenced by carp_master_down_locked().
|
static |
Definition at line 1580 of file ip_carp.c.
References carp_alloc_if(), CARP_DFLTINTV, CARP_LOCK_INIT, CIF_LOCK, CIF_UNLOCK, carp_softc::sc_ad_tmo, carp_softc::sc_advbase, carp_softc::sc_carpdev, carp_softc::sc_ifas, carp_softc::sc_ifasiz, carp_softc::sc_init_counter, carp_softc::sc_mtx, carp_softc::sc_state, and carp_softc::sc_vhid.
Referenced by carp_ioctl().
|
static |
Definition at line 1669 of file ip_carp.c.
References CIF_LOCK_INIT, and CIF_PROMISC.
Referenced by carp_alloc().
|
static |
Definition at line 2118 of file ip_carp.c.
References CARP_LOCK, carp_sc_state(), CARP_UNLOCK, carp_softc::sc_carpdev, and V_carp_allow.
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().
|
static |
Definition at line 900 of file ip_carp.c.
Referenced by carp_send_ad_locked().
|
static |
Definition at line 1717 of file ip_carp.c.
References CARP_LOCK, CARP_UNLOCK, carpreq::carpr_advbase, carpreq::carpr_advskew, carpreq::carpr_key, carpreq::carpr_state, carpreq::carpr_vhid, carp_softc::sc_advbase, carp_softc::sc_advskew, carp_softc::sc_key, carp_softc::sc_state, and carp_softc::sc_vhid.
Referenced by carp_ioctl().
|
static |
Definition at line 1093 of file ip_carp.c.
References CARP_FOREACH_IFA, and carp_ifa_delroute().
Referenced by carp_input_c(), and carp_ioctl().
|
static |
Definition at line 2110 of file ip_carp.c.
References CARP_LOG, and V_carp_demotion.
Referenced by carp_demote_adj_sysctl(), carp_destroy(), carp_mod_load(), carp_sc_state(), and carp_send_ad_error().
|
static |
Definition at line 2163 of file ip_carp.c.
References carp_demote_adj(), and V_carp_demotion.
|
static |
Definition at line 1636 of file ip_carp.c.
References carp_demote_adj(), CARP_LOCK_DESTROY, CARP_UNLOCK, CIF_LOCK, CIF_UNLOCK, carp_softc::sc_ad_tmo, carp_softc::sc_carpdev, carp_softc::sc_ifas, carp_softc::sc_suppress, and V_carp_ifdown_adj.
Referenced by 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().
|
static |
Definition at line 2145 of file ip_carp.c.
References V_carp_dscp.
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().
|
static |
Definition at line 1695 of file ip_carp.c.
References CIF_LOCK_ASSERT, CIF_LOCK_DESTROY, and CIF_PROMISC.
|
static |
Definition at line 1900 of file ip_carp.c.
Referenced by carp_mod_load().
|
static |
Definition at line 1622 of file ip_carp.c.
References CARP_LOCK, CARP_UNLOCK, carp_softc::sc_ifas, and carp_softc::sc_ifasiz.
Referenced by carp_attach().
|
static |
Definition at line 414 of file ip_carp.c.
References CARP_LOCK_ASSERT, carp_softc::sc_counter, carp_softc::sc_pad, and carp_softc::sc_sha1.
Referenced by carp_hmac_verify(), and carp_prepare_ad().
|
static |
Definition at line 435 of file ip_carp.c.
References carp_hmac_generate(), and CARP_LOCK_ASSERT.
Referenced by carp_input_c().
|
static |
Definition at line 1071 of file ip_carp.c.
References ifatoia, and in_addprefix().
Referenced by carp_addroute().
|
static |
Definition at line 1102 of file ip_carp.c.
References ifatoia, and in_scrubprefix().
Referenced by carp_delroute(), and carp_detach().
|
static |
Definition at line 647 of file ip_carp.c.
References carp_header::carp_advbase, carp_header::carp_advskew, carp_header::carp_counter, CARP_DEBUG, carp_delroute(), carp_hmac_verify(), CARP_LOCK, carp_master_down_locked(), carp_header::carp_md, carp_set_state(), carp_setrun(), carp_source_is_self(), CARP_UNLOCK, carp_header::carp_version, CARP_VERSION, carp_header::carp_vhid, CARPSTATS_INC, DEMOTE_ADVSKEW, IFNET_FOREACH_IFA, carp_softc::sc_ad_tmo, carp_softc::sc_advbase, carp_softc::sc_counter, carp_softc::sc_init_counter, carp_softc::sc_state, carp_softc::sc_vhid, and V_carp_preempt.
int carp_ioctl | ( | struct ifreq * | ifr, |
u_long | cmd, | ||
struct thread * | td | ||
) |
Definition at line 1733 of file ip_carp.c.
References carp_softc::BACKUP, carp_alloc(), carp_carprcp(), carp_delroute(), CARP_DFLTINTV, CARP_LOCK, carp_master_down_locked(), CARP_MAXVHID, carp_set_state(), carp_setrun(), CARP_UNLOCK, carpreq::carpr_advbase, carpreq::carpr_advskew, carpreq::carpr_count, carpreq::carpr_key, carpreq::carpr_state, carpreq::carpr_vhid, CIF_UNLOCK, count, IFNET_FOREACH_CARP, carp_softc::INIT, carp_softc::MASTER, carp_softc::sc_ad_tmo, carp_softc::sc_addr, carp_softc::sc_advbase, carp_softc::sc_advskew, carp_softc::sc_key, carp_softc::sc_state, carp_softc::sc_vhid, SIOCGVH, and SIOCSVH.
Referenced by carp_mod_load().
|
static |
Definition at line 2066 of file ip_carp.c.
References CARP_LOCK, carp_sc_state(), CARP_UNLOCK, CIF_LOCK, CIF_UNLOCK, and IFNET_FOREACH_CARP.
Referenced by carp_mod_load().
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().
|
static |
Definition at line 1270 of file ip_carp.c.
References CARP_LOCK_ASSERT, carp_master_down_locked(), CARP_UNLOCK, carp_softc::sc_carpdev, and carp_softc::sc_state.
Referenced by carp_setrun().
|
static |
Definition at line 1289 of file ip_carp.c.
References carp_addroute(), CARP_LOCK_ASSERT, carp_send_ad_locked(), carp_set_state(), carp_setrun(), carp_softc::sc_carpdev, carp_softc::sc_state, and carp_softc::sc_vhid.
Referenced by carp_input_c(), carp_ioctl(), and carp_master_down().
|
static |
Definition at line 2206 of file ip_carp.c.
References carp_attach_p, carp_demote_adj_p, carp_detach_p, carp_forus_p, carp_get_vhid_p, CARP_INET, CARP_INET6, carp_ioctl_p, carp_linkstate_p, carp_master_p, carp_output_p, ipproto_unregister(), and proto_reg.
Referenced by carp_mod_load(), and carp_modevent().
|
static |
Definition at line 2242 of file ip_carp.c.
References carp_attach(), carp_attach_p, carp_demote_adj(), carp_demote_adj_p, carp_detach(), carp_detach_p, carp_forus(), carp_forus_p, carp_get_vhid(), carp_get_vhid_p, carp_iamatch(), carp_iamatch6(), CARP_INET, CARP_INET6, carp_ioctl(), carp_ioctl_p, carp_linkstate(), carp_linkstate_p, carp_macmatch6(), carp_master(), carp_master_p, carp_mod_cleanup(), carp_output(), carp_output_p, ipproto_register(), and proto_reg.
Referenced by carp_modevent().
|
static |
Definition at line 2296 of file ip_carp.c.
References carp_mod_cleanup(), and carp_mod_load().
|
static |
Definition at line 1486 of file ip_carp.c.
References in_mfilter::imf_inm, in_leavegroup(), ip_mfilter_first(), ip_mfilter_free(), and ip_mfilter_remove().
Referenced by carp_detach().
|
static |
Definition at line 1386 of file ip_carp.c.
References CARP_DFLTTL, in_mfilter::imf_inm, in_joingroup(), ip_mfilter_alloc(), ip_mfilter_first(), ip_mfilter_free(), ip_mfilter_init(), ip_mfilter_insert(), and in_addr::s_addr.
Referenced by carp_attach().
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().
|
static |
Definition at line 783 of file ip_carp.c.
References carp_header::carp_counter, carp_hmac_generate(), carp_header::carp_md, CARPSTATS_INC, carp_softc::sc_counter, and carp_softc::sc_init_counter.
Referenced by carp_send_ad_locked().
|
static |
Definition at line 2080 of file ip_carp.c.
References carp_demote_adj(), CARP_LOCK_ASSERT, carp_set_state(), carp_setrun(), carp_softc::INIT, carp_softc::sc_ad_tmo, carp_softc::sc_carpdev, carp_softc::sc_suppress, V_carp_allow, and V_carp_ifdown_adj.
Referenced by carp_allow_sysctl(), carp_attach(), carp_detach(), and carp_linkstate().
|
static |
Definition at line 839 of file ip_carp.c.
References CARP_LOCK_ASSERT, carp_send_ad_locked(), CARP_UNLOCK, and carp_softc::sc_carpdev.
Referenced by carp_send_ad_locked(), and carp_setrun().
|
static |
|
static |
Definition at line 818 of file ip_carp.c.
References CARP_LOCK, carp_send_ad_locked(), CARP_UNLOCK, carp_softc::sc_carpdev, and carp_softc::sc_state.
|
static |
Definition at line 854 of file ip_carp.c.
References carp_demote_adj(), CARP_SENDAD_MAX_ERRORS, CARP_SENDAD_MIN_SUCCESS, carp_softc::sc_carpdev, carp_softc::sc_sendad_errors, carp_softc::sc_sendad_success, and V_carp_senderr_adj.
Referenced by carp_send_ad_locked().
|
static |
Definition at line 920 of file ip_carp.c.
References carp_header::carp_advbase, CARP_ADVERTISEMENT, carp_header::carp_advskew, carp_header::carp_authlen, carp_best_ifa(), carp_header::carp_cksum, CARP_DEBUG, CARP_DFLTTL, CARP_LOCK_ASSERT, carp_header::carp_pad1, carp_prepare_ad(), carp_send_ad(), carp_send_ad_error(), carp_header::carp_type, carp_header::carp_version, CARP_VERSION, carp_header::carp_vhid, CARPSTATS_INC, DEMOTE_ADVSKEW, ifatoia, ip6_hdr::ip6_dst, ip6_hdr::ip6_src, IP_DF, ip::ip_dst, ip_fillid(), ip::ip_hl, ip::ip_len, ip::ip_off, ip_output(), ip::ip_p, IP_RAWOUTPUT, ip::ip_sum, ip::ip_tos, ip::ip_ttl, ip::ip_v, IPTOS_DSCP_OFFSET, IPV6_FLOWLABEL_LEN, IPV6_VERSION, IPVERSION, in_addr::s_addr, carp_softc::sc_ad_tmo, carp_softc::sc_advbase, carp_softc::sc_carpdev, carp_softc::sc_naddrs, carp_softc::sc_naddrs6, carp_softc::sc_vhid, and V_carp_dscp.
Referenced by carp_master_down_locked(), carp_send_ad(), and carp_send_ad_all().
|
static |
Definition at line 2044 of file ip_carp.c.
References CARP_LOCK_ASSERT, CARP_LOG, CARP_STATES, carp_softc::sc_carpdev, carp_softc::sc_state, carp_softc::sc_vhid, and state.
Referenced by carp_input_c(), carp_ioctl(), carp_master_down_locked(), carp_sc_state(), and carp_setrun().
|
static |
Definition at line 1325 of file ip_carp.c.
References CARP_LOCK_ASSERT, carp_master_down(), carp_send_ad(), carp_set_state(), carp_setrun(), carp_softc::sc_ad_tmo, carp_softc::sc_advbase, carp_softc::sc_advskew, carp_softc::sc_carpdev, carp_softc::sc_naddrs, carp_softc::sc_naddrs6, carp_softc::sc_state, and V_carp_allow.
Referenced by carp_input_c(), carp_ioctl(), carp_master_down_locked(), carp_sc_state(), and carp_setrun().
|
static |
Definition at line 616 of file ip_carp.c.
References ifatoia, ip6_hdr::ip6_src, and in_addr::s_addr.
Referenced by carp_input_c().
DECLARE_MODULE | ( | carp | , |
carp_mod | , | ||
SI_SUB_PROTO_DOMAIN | , | ||
SI_ORDER_ANY | |||
) |
|
static |
|
static |
SYSCTL_INT | ( | _net_inet_carp | , |
OID_AUTO | , | ||
ifdown_demotion_factor | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEcarp_ifdown_adj, | ||
0 | , | ||
"Interface down demotion factor adjustment" | |||
) |
SYSCTL_INT | ( | _net_inet_carp | , |
OID_AUTO | , | ||
log | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEcarp_log, | ||
0 | , | ||
"CARP log level" | |||
) |
SYSCTL_INT | ( | _net_inet_carp | , |
OID_AUTO | , | ||
preempt | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEcarp_preempt, | ||
0 | , | ||
"High-priority backup preemption mode" | |||
) |
SYSCTL_INT | ( | _net_inet_carp | , |
OID_AUTO | , | ||
senderr_demotion_factor | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEcarp_senderr_adj, | ||
0 | , | ||
"Send error demotion factor adjustment" | |||
) |
SYSCTL_NODE | ( | _net_inet | , |
IPPROTO_CARP | , | ||
carp | , | ||
CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
0 | , | ||
"CARP" | |||
) |
SYSCTL_PROC | ( | _net_inet_carp | , |
OID_AUTO | , | ||
allow | , | ||
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
0 | , | ||
0 | , | ||
carp_allow_sysctl | , | ||
"I" | , | ||
"Accept incoming CARP packets" | |||
) |
SYSCTL_PROC | ( | _net_inet_carp | , |
OID_AUTO | , | ||
demotion | , | ||
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
0 | , | ||
0 | , | ||
carp_demote_adj_sysctl | , | ||
"I" | , | ||
"Adjust demotion factor (skew of advskew)" | |||
) |
SYSCTL_PROC | ( | _net_inet_carp | , |
OID_AUTO | , | ||
dscp | , | ||
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
0 | , | ||
0 | , | ||
carp_dscp_sysctl | , | ||
"I" | , | ||
"DSCP value for carp packets" | |||
) |
SYSCTL_VNET_PCPUSTAT | ( | _net_inet_carp | , |
OID_AUTO | , | ||
stats | , | ||
struct carpstats | , | ||
carpstats | , | ||
"CARP statistics (struct carpstats, netinet/ip_carp.h)" | |||
) |
VNET_DEFINE_STATIC | ( | int | , |
carp_allow | |||
) |
|
pure virtual |
VNET_DEFINE_STATIC | ( | int | , |
carp_dscp | |||
) |
VNET_DEFINE_STATIC | ( | int | , |
carp_ifdown_adj | |||
) |
VNET_DEFINE_STATIC | ( | int | , |
carp_log | |||
) |
|
pure virtual |
VNET_DEFINE_STATIC | ( | int | , |
carp_senderr_adj | |||
) |
VNET_PCPUSTAT_SYSINIT | ( | carpstats | ) |
VNET_PCPUSTAT_SYSUNINIT | ( | carpstats | ) |
|
static |
|
static |
Definition at line 153 of file ip_carp.c.
Referenced by carp_mod_cleanup(), and carp_mod_load().