Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifpfsync.c
Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | pfsync_status(int s) | ||||
if (preq.pfsyncr_syncdev[0] != '\0') | if (preq.pfsyncr_syncdev[0] != '\0') | ||||
printf("pfsync: syncdev: %s ", preq.pfsyncr_syncdev); | printf("pfsync: syncdev: %s ", preq.pfsyncr_syncdev); | ||||
if (preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) | if (preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) | ||||
printf("syncpeer: %s ", inet_ntoa(preq.pfsyncr_syncpeer)); | printf("syncpeer: %s ", inet_ntoa(preq.pfsyncr_syncpeer)); | ||||
if (preq.pfsyncr_syncdev[0] != '\0' || | if (preq.pfsyncr_syncdev[0] != '\0' || | ||||
preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) { | preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) { | ||||
printf("maxupd: %d ", preq.pfsyncr_maxupdates); | printf("maxupd: %d ", preq.pfsyncr_maxupdates); | ||||
printf("defer: %s\n", preq.pfsyncr_defer ? "on" : "off"); | printf("defer: %s\n", | ||||
(preq.pfsyncr_defer & PFSYNCF_DEFER) ? "on" : "off"); | |||||
printf("\tsyncok: %d\n", | |||||
(preq.pfsyncr_defer & PFSYNCF_OK) ? 1 : 0); | |||||
} | } | ||||
donner: How about "defer: on (loaded)" in order to keep the line count. | |||||
Done Inline ActionsI initially considered adding it as 'syncok: 1' behind the 'defer: ...' line, but kept it on its own line to avoid breaking ifconfig parsers. Sadly we don't yet have libxo support in ifconfig, so people tend to grep/awk/sed/... the ifconfig output, and if we add a line we're much less likely to break those parsers than if we add something to an existing output line. kp: I initially considered adding it as 'syncok: 1' behind the 'defer: ...' line, but kept it on… | |||||
} | } | ||||
static struct cmd pfsync_cmds[] = { | static struct cmd pfsync_cmds[] = { | ||||
DEF_CMD_ARG("syncdev", setpfsync_syncdev), | DEF_CMD_ARG("syncdev", setpfsync_syncdev), | ||||
DEF_CMD("-syncdev", 1, unsetpfsync_syncdev), | DEF_CMD("-syncdev", 1, unsetpfsync_syncdev), | ||||
DEF_CMD_ARG("syncif", setpfsync_syncdev), | DEF_CMD_ARG("syncif", setpfsync_syncdev), | ||||
DEF_CMD("-syncif", 1, unsetpfsync_syncdev), | DEF_CMD("-syncif", 1, unsetpfsync_syncdev), | ||||
DEF_CMD_ARG("syncpeer", setpfsync_syncpeer), | DEF_CMD_ARG("syncpeer", setpfsync_syncpeer), | ||||
Show All 20 Lines |
How about "defer: on (loaded)" in order to keep the line count.