route.h revision 75212
1/*
2 *			User Process PPP
3 *
4 *	    Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 *   Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc.  The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * $FreeBSD: head/usr.sbin/ppp/route.h 75212 2001-04-05 02:23:48Z brian $
21 *
22 */
23
24struct bundle;
25struct cmdargs;
26struct rt_msghdr;
27struct sockaddr;
28
29#define ROUTE_STATIC		0x00
30#define ROUTE_DSTMYADDR		0x01
31#define ROUTE_DSTHISADDR	0x02
32#define ROUTE_DSTDNS0		0x04
33#define ROUTE_DSTDNS1		0x08
34#define ROUTE_DSTANY		0x0f
35#define ROUTE_GWHISADDR		0x10	/* May be ORd with DST_* */
36
37struct sticky_route {
38  int type;				/* ROUTE_* value (not _STATIC) */
39  struct sticky_route *next;		/* next in list */
40
41  struct in_addr dst;
42  struct in_addr mask;
43  struct in_addr gw;
44};
45
46extern int GetIfIndex(char *);
47extern int route_Show(struct cmdargs const *);
48extern void route_IfDelete(struct bundle *, int);
49extern void route_UpdateMTU(struct bundle *);
50extern const char *Index2Nam(int);
51extern void route_Change(struct bundle *, struct sticky_route *,
52                         struct in_addr, struct in_addr, struct in_addr[2]);
53extern void route_Add(struct sticky_route **, int, struct in_addr,
54                      struct in_addr, struct in_addr);
55extern void route_Delete(struct sticky_route **, int, struct in_addr);
56extern void route_DeleteAll(struct sticky_route **);
57extern void route_Clean(struct bundle *, struct sticky_route *);
58extern void route_ShowSticky(struct prompt *, struct sticky_route *,
59                             const char *, int);
60extern void route_ParseHdr(struct rt_msghdr *, struct sockaddr *[RTAX_MAX]);
61extern int rt_Set(struct bundle *, int, struct in_addr,
62                           struct in_addr, struct in_addr, int, int);
63extern void rt_Update(struct bundle *, struct in_addr, struct in_addr);
64