/*
* Copyright (c) 1983 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef lint
-static char sccsid[] = "@(#)af.c 5.3 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)af.c 5.8 (Berkeley) %G%";
+#endif /* not lint */
#include "defs.h"
*/
int inet_hash(), inet_netmatch(), inet_output(),
inet_portmatch(), inet_portcheck(),
- inet_checkhost(), inet_ishost(), inet_canon();
+ inet_checkhost(), inet_rtflags(), inet_sendroute(), inet_canon();
char *inet_format();
+
#define NIL { 0 }
#define INET \
{ inet_hash, inet_netmatch, inet_output, \
inet_portmatch, inet_portcheck, inet_checkhost, \
- inet_ishost, inet_canon, inet_format }
+ inet_rtflags, inet_sendroute, inet_canon, \
+ inet_format \
+ }
-struct afswitch afswitch[AF_MAX] =
- { NIL, NIL, INET, };
+struct afswitch afswitch[AF_MAX] = {
+ NIL, /* 0- unused */
+ NIL, /* 1- Unix domain, unused */
+ INET, /* Internet */
+};
int af_max = sizeof(afswitch) / sizeof(afswitch[0]);
{
u_long i = ntohl(sin->sin_addr.s_addr);
-#define IN_BADCLASS(i) (((long) (i) & 0xe0000000) == 0xe0000000)
+#ifndef IN_EXPERIMENTAL
+#define IN_EXPERIMENTAL(i) (((long) (i) & 0xe0000000) == 0xe0000000)
+#endif
- if (IN_BADCLASS(i) || sin->sin_port != 0)
+ if (IN_EXPERIMENTAL(i) || sin->sin_port != 0)
return (0);
if (i != 0 && (i & 0xff000000) == 0)
return (0);
return (1);
}
-/*
- * Return 1 if the address is
- * for an Internet host, 0 for a network.
- */
-inet_ishost(sin)
- struct sockaddr_in *sin;
-{
-
- return (inet_lnaof(sin->sin_addr) != 0);
-}
-
inet_canon(sin)
struct sockaddr_in *sin;
{