extern.h revision 1.12 1 1.12 dyoung /* $NetBSD: extern.h,v 1.12 2008/07/02 07:44:14 dyoung Exp $ */
2 1.1 thorpej
3 1.1 thorpej /*
4 1.1 thorpej * Copyright (c) 1983, 1993
5 1.1 thorpej * The Regents of the University of California. All rights reserved.
6 1.1 thorpej *
7 1.1 thorpej * Redistribution and use in source and binary forms, with or without
8 1.1 thorpej * modification, are permitted provided that the following conditions
9 1.1 thorpej * are met:
10 1.1 thorpej * 1. Redistributions of source code must retain the above copyright
11 1.1 thorpej * notice, this list of conditions and the following disclaimer.
12 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 thorpej * notice, this list of conditions and the following disclaimer in the
14 1.1 thorpej * documentation and/or other materials provided with the distribution.
15 1.1 thorpej * 3. Neither the name of the University nor the names of its contributors
16 1.1 thorpej * may be used to endorse or promote products derived from this software
17 1.1 thorpej * without specific prior written permission.
18 1.1 thorpej *
19 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.1 thorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.1 thorpej * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.1 thorpej * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.1 thorpej * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.1 thorpej * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.1 thorpej * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1 thorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 thorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1 thorpej * SUCH DAMAGE.
30 1.1 thorpej */
31 1.12 dyoung #ifndef _IFCONFIG_EXTERN_H
32 1.12 dyoung #define _IFCONFIG_EXTERN_H
33 1.12 dyoung
34 1.12 dyoung #include <prop/proplib.h>
35 1.11 dyoung #include "util.h"
36 1.1 thorpej
37 1.6 thorpej #define RIDADDR 0
38 1.6 thorpej #define ADDR 1
39 1.6 thorpej #define MASK 2
40 1.6 thorpej #define DSTADDR 3
41 1.6 thorpej
42 1.12 dyoung typedef void (*status_cb_t)(prop_dictionary_t, prop_dictionary_t);
43 1.12 dyoung typedef void (*statistics_cb_t)(prop_dictionary_t);
44 1.12 dyoung
45 1.12 dyoung struct statistics_func {
46 1.12 dyoung SIMPLEQ_ENTRY(statistics_func) f_next;
47 1.12 dyoung statistics_cb_t f_func;
48 1.12 dyoung };
49 1.12 dyoung
50 1.12 dyoung struct status_func {
51 1.12 dyoung SIMPLEQ_ENTRY(status_func) f_next;
52 1.12 dyoung status_cb_t f_func;
53 1.12 dyoung };
54 1.12 dyoung
55 1.12 dyoung struct cmdloop_branch {
56 1.12 dyoung SIMPLEQ_ENTRY(cmdloop_branch) b_next;
57 1.12 dyoung struct parser *b_parser;
58 1.12 dyoung };
59 1.12 dyoung
60 1.12 dyoung
61 1.12 dyoung typedef struct statistics_func statistics_func_t;
62 1.12 dyoung typedef struct status_func status_func_t;
63 1.12 dyoung typedef struct cmdloop_branch cmdloop_branch_t;
64 1.12 dyoung
65 1.12 dyoung void cmdloop_branch_init(cmdloop_branch_t *, struct parser *);
66 1.12 dyoung int register_family(struct afswtch *);
67 1.12 dyoung int register_cmdloop_branch(cmdloop_branch_t *);
68 1.12 dyoung void statistics_func_init(statistics_func_t *, statistics_cb_t);
69 1.12 dyoung void status_func_init(status_func_t *, status_cb_t);
70 1.12 dyoung int register_statistics(statistics_func_t *);
71 1.12 dyoung int register_status(status_func_t *);
72 1.12 dyoung int register_flag(int);
73 1.12 dyoung bool get_flag(int);
74 1.12 dyoung
75 1.12 dyoung extern bool lflag, vflag, zflag;
76 1.12 dyoung
77 1.12 dyoung #endif /* _IFCONFIG_EXTERN_H */
78