1 /* 2 * Copyright (c) 1983 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that this notice is preserved and that due credit is given 7 * to the University of California at Berkeley. The name of the University 8 * may not be used to endorse or promote products derived from this 9 * software without specific prior written permission. This software 10 * is provided ``as is'' without express or implied warranty. 11 * 12 * @(#)htable.h 5.2 (Berkeley) 02/23/88 13 */ 14 15 #include <sys/types.h> 16 #include <netinet/in.h> 17 18 /* 19 * common definitions for htable 20 */ 21 22 struct addr { 23 struct in_addr addr_val; 24 struct addr *addr_link; 25 }; 26 27 struct name { 28 char *name_val; 29 struct name *name_link; 30 }; 31 32 struct gateway { 33 struct gateway *g_link; 34 struct gateway *g_dst; /* connected gateway if metric > 0 */ 35 struct gateway *g_firstent; /* first entry for this gateway */ 36 struct name *g_name; 37 int g_net; 38 struct in_addr g_addr; /* address on g_net */ 39 int g_metric; /* hops to this net */ 40 }; 41 42 #define NOADDR ((struct addr *)0) 43 #define NONAME ((struct name *)0) 44 45 #define KW_NET 1 46 #define KW_GATEWAY 2 47 #define KW_HOST 3 48 49 struct name *newname(); 50 char *malloc(); 51 52 char *infile; /* Input file name */ 53