Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifpfsync.c
Show First 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
pfsync_status(int s) | pfsync_status(int s) | ||||
{ | { | ||||
nvlist_t *nvl; | nvlist_t *nvl; | ||||
char syncdev[IFNAMSIZ]; | char syncdev[IFNAMSIZ]; | ||||
char syncpeer_str[NI_MAXHOST]; | char syncpeer_str[NI_MAXHOST]; | ||||
struct sockaddr_storage syncpeer; | struct sockaddr_storage syncpeer; | ||||
int maxupdates; | int maxupdates = 0; | ||||
int flags; | int flags = 0; | ||||
int error; | int error; | ||||
nvl = nvlist_create(0); | nvl = nvlist_create(0); | ||||
if (pfsync_do_ioctl(s, SIOCGETPFSYNCNV, &nvl) == -1) { | if (pfsync_do_ioctl(s, SIOCGETPFSYNCNV, &nvl) == -1) { | ||||
nvlist_destroy(nvl); | nvlist_destroy(nvl); | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | static struct afswtch af_pfsync = { | ||||
.af_name = "af_pfsync", | .af_name = "af_pfsync", | ||||
.af_af = AF_UNSPEC, | .af_af = AF_UNSPEC, | ||||
.af_other_status = pfsync_status, | .af_other_status = pfsync_status, | ||||
}; | }; | ||||
static __constructor void | static __constructor void | ||||
pfsync_ctor(void) | pfsync_ctor(void) | ||||
{ | { | ||||
int i; | for (size_t i = 0; i < nitems(pfsync_cmds); i++) | ||||
for (i = 0; i < nitems(pfsync_cmds); i++) | |||||
cmd_register(&pfsync_cmds[i]); | cmd_register(&pfsync_cmds[i]); | ||||
af_register(&af_pfsync); | af_register(&af_pfsync); | ||||
} | } |