| 985 | }; |
| 986 | |
| 987 | static int |
| 988 | nat_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. |
nothing calls this directly
no test coverage detected