1 /*****************************************************************
2 **	@(#) scope.h
3 *****************************************************************/
4 #ifndef SCOPE_H
5 # define SCOPE_H
6 
7 typedef	struct	{
8 	char	name[15+1];
9 	const	char	*view;
10 	const	char	*domain;
11 	int	unique_scopeid;
12 	ip6_t	*matchprfx;
13 } scope_t;
14 
15 /* all prefixes from the command line */
16 typedef	struct	{
17 	ip6_t	*prfx;
18 	int	del;		/* add or delete correspondig AAAA resource records */
19 	scope_t	*scope;	/* which scope matches (NULL for any)*/
20 } prfx_t;
21 
22 #ifndef MAXSCOPES
23 # define	MAXSCOPES	16
24 #endif
25 #ifndef MAXPREFIXES
26 # define	MAXPREFIXES	16
27 #endif
28 
29 extern	prfx_t	*prfxstart (void);
30 extern	prfx_t	*prfxnext (void);
31 extern	int	prfxput (const ip6_t *prfx, int	to_del);
32 extern	prfx_t	*prfxget (int n);
33 extern	int	prfxdel (int n);
34 extern	int	scopeput (const char *scope, const char *view, const char *domain, ip6_t *prfx);
35 extern	scope_t	*scopeget (const char *scope);
36 extern	int	parsescopeline (const char * line, int delim);
37 extern	void	scopeset_clear (void);
38 extern	int	scopeset_set (int n);
39 extern	int	scopeset_get (int n);
40 extern	void	dumpscope (FILE *out);
41 extern	void	dumpprefixlist (FILE *out);
42 
43 #endif
44