1/*
2 * Routines for managing persistent storage of port mappings, etc.
3 *
4 * Copyright 2005, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11 *
12 * $Id: nvparse.h,v 1.1.1.1 2008/10/15 03:31:22 james26_jang Exp $
13 */
14
15#ifndef _nvparse_h_
16#define _nvparse_h_
17
18/* 256 entries per list */
19#define MAX_NVPARSE 256
20
21/*
22 * Automatic (application specific) port forwards are described by a
23 * netconf_app_t structure. A specific outbound connection triggers
24 * the expectation of one or more inbound connections which may be
25 * optionally remapped to a different port range.
26 */
27extern bool valid_autofw_port(const netconf_app_t *app);
28extern bool get_autofw_port(int which, netconf_app_t *app);
29extern bool set_autofw_port(int which, const netconf_app_t *app);
30extern bool del_autofw_port(int which);
31
32/*
33 * Persistent (static) port forwards are described by a netconf_nat_t
34 * structure. On Linux, a netconf_filter_t that matches the target
35 * parameters of the netconf_nat_t should also be added to the INPUT
36 * and FORWARD tables to ACCEPT the forwarded connection.
37 */
38extern bool valid_forward_port(const netconf_nat_t *nat);
39extern bool get_forward_port(int which, netconf_nat_t *nat);
40extern bool set_forward_port(int which, const netconf_nat_t *nat);
41extern bool del_forward_port(int which);
42
43/*
44 * Client filters are described by two netconf_filter_t structures that
45 * differ in match.src.ipaddr alone (to support IP address ranges)
46 */
47extern bool valid_filter_client(const netconf_filter_t *start, const netconf_filter_t *end);
48extern bool get_filter_client(int which, netconf_filter_t *start, netconf_filter_t *end);
49extern bool set_filter_client(int which, const netconf_filter_t *start, const netconf_filter_t *end);
50extern bool del_filter_client(int which);
51
52/*
53* WPA/WDS per link configuration. Parameters after 'auth' are
54* authentication algorithm dependant:
55*
56* When auth is "psk", the parameter list is:
57*
58* 	bool get_wds_wsec(int unit, int which, char *mac, char *role,
59*		char *crypto, char *auth, char *ssid, char *passphrase);
60*/
61extern bool get_wds_wsec(int unit, int which, char *mac, char *role,
62			 char *crypto, char *auth, ...);
63extern bool set_wds_wsec(int unit, int which, char *mac, char *role,
64			 char *crypto, char *auth, ...);
65extern bool del_wds_wsec(int unit, int which);
66
67/* Conversion routine for deprecated variables */
68extern void convert_deprecated(void);
69
70#endif /* _nvparse_h_ */
71