MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nat_show_data

Function nat_show_data

tools/ipfw/nat.c:987–1018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

985};
986
987static int
988nat_show_data(struct nat44_cfg_nat *cfg, void *arg)
989{
990 struct nat_list_arg *nla;
991 ipfw_obj_header *oh;
992
993 nla = (struct nat_list_arg *)arg;
994
995 switch (nla->cmd) {
996 case IP_FW_NAT44_XGETCONFIG:
997 if (nat_get_cmd(cfg->name, nla->cmd, &oh) != 0) {
998 warnx("Error getting nat instance %s info", cfg->name);
999 break;
1000 }
1001 nat_show_cfg((struct nat44_cfg_nat *)(oh + 1), NULL);
1002 free(oh);
1003 break;
1004 case IP_FW_NAT44_XGETLOG:
1005 if (nat_get_cmd(cfg->name, nla->cmd, &oh) == 0) {
1006 nat_show_log((struct nat44_cfg_nat *)(oh + 1), NULL);
1007 free(oh);
1008 break;
1009 }
1010 /* Handle error */
1011 if (nla->is_all != 0 && errno == ENOENT)
1012 break;
1013 warn("Error getting nat instance %s info", cfg->name);
1014 break;
1015 }
1016
1017 return (0);
1018}
1019
1020/*
1021 * Compare nat names.

Callers

nothing calls this directly

Calls 4

nat_get_cmdFunction · 0.85
nat_show_cfgFunction · 0.85
nat_show_logFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected