154359Sroberto/* this is a hacked version of if.h from unix to contain the stuff we need only to build named (bind) with 254359Sroberto the minimal amount of changes... by l. kahn */ 354359Sroberto 454359Sroberto /* 554359Sroberto * Copyright (c) 1982, 1986 Regents of the University of California. 654359Sroberto * All rights reserved. The Berkeley software License Agreement 754359Sroberto * specifies the terms and conditions for redistribution. 854359Sroberto */ 954359Sroberto 1054359Sroberto#ifndef _NET_IF_H 1154359Sroberto#define _NET_IF_H 1254359Sroberto 1354359Sroberto 1454359Sroberto/* #pragma ident "@(#)if.h 1.3 93/06/30 SMI" 1554359Sroberto/* if.h 1.26 90/05/29 SMI; from UCB 7.1 6/4/86 */ 1654359Sroberto 1754359Sroberto#ifdef __cplusplus 1854359Srobertoextern "C" { 1954359Sroberto#endif 2054359Sroberto 2154359Sroberto/* 2254359Sroberto * Structures defining a network interface, providing a packet 2354359Sroberto * transport mechanism (ala level 0 of the PUP protocols). 2454359Sroberto * 2554359Sroberto * Each interface accepts output datagrams of a specified maximum 2654359Sroberto * length, and provides higher level routines with input datagrams 2754359Sroberto * received from its medium. 2854359Sroberto * 2954359Sroberto * Output occurs when the routine if_output is called, with three parameters: 3054359Sroberto * (*ifp->if_output)(ifp, m, dst) 3154359Sroberto * Here m is the mbuf chain to be sent and dst is the destination address. 3254359Sroberto * The output routine encapsulates the supplied datagram if necessary, 3354359Sroberto * and then transmits it on its medium. 3454359Sroberto * 3554359Sroberto * On input, each interface unwraps the data received by it, and either 3654359Sroberto * places it on the input queue of a internetwork datagram routine 3754359Sroberto * and posts the associated software interrupt, or passes the datagram to a raw 3854359Sroberto * packet input routine. 3954359Sroberto * 4054359Sroberto * Routines exist for locating interfaces by their addresses 4154359Sroberto * or for locating a interface on a certain network, as well as more general 4254359Sroberto * routing and gateway routines maintaining information used to locate 4354359Sroberto * interfaces. These routines live in the files if.c and route.c 4454359Sroberto */ 4554359Sroberto 4654359Sroberto/* 4754359Sroberto * Structure defining a queue for a network interface. 4854359Sroberto * 4954359Sroberto * (Would like to call this struct ``if'', but C isn't PL/1.) 5054359Sroberto */ 5154359Sroberto/* 5254359Sroberto * Interface request structure used for socket 5354359Sroberto * ioctl's. All interface ioctl's must have parameter 5454359Sroberto * definitions which begin with ifr_name. The 5554359Sroberto * remainder may be interface specific. 5654359Sroberto */ 5754359Sroberto#ifdef FD_SETSIZE 5854359Sroberto#undef FD_SETSIZE 5954359Sroberto#endif 6054359Sroberto#define FD_SETSIZE 512 6154359Sroberto#include <winsock.h> 6254359Srobertotypedef char *caddr_t; 6354359Sroberto 6454359Srobertoint get_winnt_interfaces(); 6554359Sroberto 6654359Srobertostruct ifreq { 6754359Sroberto#define IFNAMSIZ 16 6854359Sroberto char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 6954359Sroberto struct sockaddr ifru_addr; 7054359Sroberto char nt_mask[IFNAMSIZ]; /* new field to store mask returned from nt lookup l. kahn */ 7154359Sroberto 7254359Sroberto#define ifr_addr ifru_addr /* address */ 7354359Sroberto#define ifr_mask nt_mask /* nt mask in character form */ 7454359Sroberto 7554359Sroberto}; 7654359Sroberto 7754359Sroberto/* 7854359Sroberto * Structure used in SIOCGIFCONF request. 7954359Sroberto * Used to retrieve interface configuration 8054359Sroberto * for machine (useful for programs which 8154359Sroberto * must know all networks accessible). 8254359Sroberto */ 8354359Srobertostruct ifconf { 8454359Sroberto int ifc_len; /* size of associated buffer */ 8554359Sroberto union { 8654359Sroberto caddr_t ifcu_buf; 8754359Sroberto struct ifreq *ifcu_req; 8854359Sroberto } ifc_ifcu; 8954359Sroberto#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ 9054359Sroberto#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ 9154359Sroberto}; 9254359Sroberto 9354359Sroberto#ifdef __cplusplus 9454359Sroberto} 9554359Sroberto#endif 9654359Sroberto 9754359Sroberto#endif /* _NET_IF_H */ 9854359Sroberto 99