make rdr_name_type enum values more unique
This commit is contained in:
parent
b36a6e94f8
commit
7ea314412c
|
@ -65,17 +65,23 @@ update_portmapping_desc_timestamp(const char * ifname,
|
|||
const char * desc, unsigned int timestamp);
|
||||
|
||||
#ifdef USE_NFTABLES
|
||||
/* only provided by nftables implementation at the moment */
|
||||
/*
|
||||
* only provided by nftables implementation at the moment.
|
||||
* Should be implemented for iptables too, for consistency
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
TABLE_NAME,
|
||||
TABLE4_NAME,
|
||||
TABLE6_NAME,
|
||||
NAT_CHAIN_NAME,
|
||||
NAT_POSTROUTING_CHAIN_NAME,
|
||||
FORWARD_CHAIN_NAME,
|
||||
RDR_TABLE_NAME,
|
||||
RDR_NAT_PREROUTING_CHAIN_NAME,
|
||||
RDR_NAT_POSTROUTING_CHAIN_NAME,
|
||||
RDR_FORWARD_CHAIN_NAME,
|
||||
} rdr_name_type;
|
||||
|
||||
/*
|
||||
* used by the config file parsing in the core
|
||||
* to set
|
||||
*/
|
||||
|
||||
int set_rdr_name( rdr_name_type param, const char * string );
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1269,13 +1269,13 @@ init(int argc, char * * argv, struct runtime_vars * v)
|
|||
#ifdef USE_NETFILTER
|
||||
#ifdef USE_NFTABLES
|
||||
case UPNPFORWARDCHAIN:
|
||||
set_rdr_name(FORWARD_CHAIN_NAME, ary_options[i].value);
|
||||
set_rdr_name(RDR_FORWARD_CHAIN_NAME, ary_options[i].value);
|
||||
break;
|
||||
case UPNPNATCHAIN:
|
||||
set_rdr_name(NAT_CHAIN_NAME, ary_options[i].value);
|
||||
set_rdr_name(RDR_NAT_PREROUTING_CHAIN_NAME, ary_options[i].value);
|
||||
break;
|
||||
case UPNPNATPOSTCHAIN:
|
||||
set_rdr_name(NAT_POSTROUTING_CHAIN_NAME, ary_options[i].value);
|
||||
set_rdr_name(RDR_NAT_POSTROUTING_CHAIN_NAME, ary_options[i].value);
|
||||
break;
|
||||
#else
|
||||
case UPNPFORWARDCHAIN:
|
||||
|
|
|
@ -155,16 +155,16 @@ set_rdr_name(rdr_name_type param, const char *string) {
|
|||
return -1;
|
||||
}
|
||||
switch (param) {
|
||||
case TABLE_NAME:
|
||||
case RDR_TABLE_NAME:
|
||||
nft_table = string;
|
||||
break;
|
||||
case NAT_CHAIN_NAME:
|
||||
case RDR_NAT_PREROUTING_CHAIN_NAME:
|
||||
nft_prerouting_chain = string;
|
||||
break;
|
||||
case NAT_POSTROUTING_CHAIN_NAME:
|
||||
case RDR_NAT_POSTROUTING_CHAIN_NAME:
|
||||
nft_postrouting_chain = string;
|
||||
break;
|
||||
case FORWARD_CHAIN_NAME:
|
||||
case RDR_FORWARD_CHAIN_NAME:
|
||||
nft_forward_chain = string;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue