Home | History | Annotate | Line # | Download | only in ifconfig
extern.h revision 1.11.2.1
      1  1.11.2.1  wrstuden /*	$NetBSD: extern.h,v 1.11.2.1 2008/09/18 04:28:24 wrstuden 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.11.2.1  wrstuden #ifndef	_IFCONFIG_EXTERN_H
     32  1.11.2.1  wrstuden #define	_IFCONFIG_EXTERN_H
     33  1.11.2.1  wrstuden 
     34  1.11.2.1  wrstuden #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.11.2.1  wrstuden typedef void (*usage_cb_t)(prop_dictionary_t);
     43  1.11.2.1  wrstuden typedef void (*status_cb_t)(prop_dictionary_t, prop_dictionary_t);
     44  1.11.2.1  wrstuden typedef void (*statistics_cb_t)(prop_dictionary_t);
     45  1.11.2.1  wrstuden 
     46  1.11.2.1  wrstuden enum flag_type {
     47  1.11.2.1  wrstuden 	  FLAG_T_MOD = 0
     48  1.11.2.1  wrstuden 	, FLAG_T_CMD = 1
     49  1.11.2.1  wrstuden };
     50  1.11.2.1  wrstuden 
     51  1.11.2.1  wrstuden typedef enum flag_type flag_type_t;
     52  1.11.2.1  wrstuden 
     53  1.11.2.1  wrstuden struct statistics_func {
     54  1.11.2.1  wrstuden 	SIMPLEQ_ENTRY(statistics_func)	f_next;
     55  1.11.2.1  wrstuden 	statistics_cb_t			f_func;
     56  1.11.2.1  wrstuden };
     57  1.11.2.1  wrstuden 
     58  1.11.2.1  wrstuden struct usage_func {
     59  1.11.2.1  wrstuden 	SIMPLEQ_ENTRY(usage_func)	f_next;
     60  1.11.2.1  wrstuden 	usage_cb_t			f_func;
     61  1.11.2.1  wrstuden };
     62  1.11.2.1  wrstuden 
     63  1.11.2.1  wrstuden struct status_func {
     64  1.11.2.1  wrstuden 	SIMPLEQ_ENTRY(status_func)	f_next;
     65  1.11.2.1  wrstuden 	status_cb_t			f_func;
     66  1.11.2.1  wrstuden };
     67  1.11.2.1  wrstuden 
     68  1.11.2.1  wrstuden struct cmdloop_branch {
     69  1.11.2.1  wrstuden 	SIMPLEQ_ENTRY(cmdloop_branch)	b_next;
     70  1.11.2.1  wrstuden 	struct parser			*b_parser;
     71  1.11.2.1  wrstuden };
     72  1.11.2.1  wrstuden 
     73  1.11.2.1  wrstuden 
     74  1.11.2.1  wrstuden typedef struct statistics_func statistics_func_t;
     75  1.11.2.1  wrstuden typedef struct status_func status_func_t;
     76  1.11.2.1  wrstuden typedef struct usage_func usage_func_t;
     77  1.11.2.1  wrstuden typedef struct cmdloop_branch cmdloop_branch_t;
     78  1.11.2.1  wrstuden 
     79  1.11.2.1  wrstuden void cmdloop_branch_init(cmdloop_branch_t *, struct parser *);
     80  1.11.2.1  wrstuden int register_family(struct afswtch *);
     81  1.11.2.1  wrstuden int register_cmdloop_branch(cmdloop_branch_t *);
     82  1.11.2.1  wrstuden void statistics_func_init(statistics_func_t *, statistics_cb_t);
     83  1.11.2.1  wrstuden void status_func_init(status_func_t *, status_cb_t);
     84  1.11.2.1  wrstuden void usage_func_init(usage_func_t *, usage_cb_t);
     85  1.11.2.1  wrstuden int register_statistics(statistics_func_t *);
     86  1.11.2.1  wrstuden int register_status(status_func_t *);
     87  1.11.2.1  wrstuden int register_usage(usage_func_t *);
     88  1.11.2.1  wrstuden int register_flag(int);
     89  1.11.2.1  wrstuden bool get_flag(int);
     90  1.11.2.1  wrstuden 
     91  1.11.2.1  wrstuden extern bool lflag, vflag, zflag;
     92  1.11.2.1  wrstuden 
     93  1.11.2.1  wrstuden #endif	/* _IFCONFIG_EXTERN_H */
     94