allow coexistance of N build and AC build.
[tomato.git] / release / src / router / shared / nvparse.h
blob4e8e14b777faca4342315f1fa18d26f716c7d7b3
1 /*
2 * Routines for managing persistent storage of port mappings, etc.
4 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * $Id: nvparse.h 374496 2012-12-13 08:59:12Z $
21 #ifndef _nvparse_h_
22 #define _nvparse_h_
24 /* 256 entries per list */
25 #if defined(MAX_NVPARSE)
26 #undef MAX_NVPARSE
27 #define MAX_NVPARSE 256
28 #endif
30 /* Maximum number of Traffic Management rules */
31 #define MAX_NUM_TRF_MGMT_RULES 10
33 #if !defined(AUTOFW_PORT_DEPRECATED)
35 * Automatic (application specific) port forwards are described by a
36 * netconf_app_t structure. A specific outbound connection triggers
37 * the expectation of one or more inbound connections which may be
38 * optionally remapped to a different port range.
40 extern bool valid_autofw_port(const netconf_app_t *app);
41 extern bool get_autofw_port(int which, netconf_app_t *app);
42 extern bool set_autofw_port(int which, const netconf_app_t *app);
43 extern bool del_autofw_port(int which);
44 #endif /* !AUTOFW_PORT_DEPRECATED */
47 * Persistent (static) port forwards are described by a netconf_nat_t
48 * structure. On Linux, a netconf_filter_t that matches the target
49 * parameters of the netconf_nat_t should also be added to the INPUT
50 * and FORWARD tables to ACCEPT the forwarded connection.
52 extern bool valid_forward_port(const netconf_nat_t *nat);
53 extern bool get_forward_port(int which, netconf_nat_t *nat);
54 extern bool set_forward_port(int which, const netconf_nat_t *nat);
55 extern bool del_forward_port(int which);
58 * Client filters are described by two netconf_filter_t structures that
59 * differ in match.src.ipaddr alone (to support IP address ranges)
61 extern bool valid_filter_client(const netconf_filter_t *start, const netconf_filter_t *end);
62 extern bool get_filter_client(int which, netconf_filter_t *start, netconf_filter_t *end);
63 extern bool set_filter_client(int which, const netconf_filter_t *start,
64 const netconf_filter_t *end);
65 extern bool del_filter_client(int which);
67 #ifdef __CONFIG_URLFILTER__
69 * URL filters are described by two netconf_urlfilter_t structures that
70 * differ in match.src.ipaddr alone (to support IP address ranges)
72 extern bool valid_filter_url(const netconf_urlfilter_t *start, const netconf_urlfilter_t *end);
73 extern bool get_filter_url(int which, netconf_urlfilter_t *start, netconf_urlfilter_t *end);
74 extern bool set_filter_url(int which, const netconf_urlfilter_t *start,
75 const netconf_urlfilter_t *end);
76 extern bool del_filter_url(int which);
77 #endif /* __CONFIG_URLFILTER__ */
79 #ifdef TRAFFIC_MGMT
80 extern bool valid_trf_mgmt_port(const netconf_trmgmt_t *trmgmt);
81 extern bool set_trf_mgmt_port(char *prefix, int which, const netconf_trmgmt_t *trmgmt);
82 extern bool get_trf_mgmt_port(char *prefix, int which, netconf_trmgmt_t *trmgmt);
83 extern bool del_trf_mgmt_port(char *prefix, int which);
84 #endif /* TRAFFIC_MGMT */
87 * WPA/WDS per link configuration. Parameters after 'auth' are
88 * authentication algorithm dependant:
90 * When auth is "psk", the parameter list is:
92 * bool get_wds_wsec(int unit, int which, char *mac, char *role,
93 * char *crypto, char *auth, char *ssid, char *passphrase);
95 extern bool get_wds_wsec(int unit, int which, char *mac, char *role,
96 char *crypto, char *auth, ...);
97 extern bool set_wds_wsec(int unit, int which, char *mac, char *role,
98 char *crypto, char *auth, ...);
99 extern bool del_wds_wsec(int unit, int which);
101 /* Conversion routine for deprecated variables */
102 extern void convert_deprecated(void);
104 #endif /* _nvparse_h_ */