2002-07-09 16:24:59 +04:00
|
|
|
/* in_var.h */
|
|
|
|
#ifndef NETINET_IN_VAR_H
|
|
|
|
#define NETINET_IN_VAR_H
|
|
|
|
|
2002-07-12 13:36:23 +04:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <net/if.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
struct in_ifaddr {
|
|
|
|
struct ifaddr ia_ifa;
|
|
|
|
struct in_ifaddr *ia_next;
|
|
|
|
|
|
|
|
uint32 ia_net;
|
|
|
|
uint32 ia_netmask;
|
|
|
|
uint32 ia_subnet;
|
|
|
|
uint32 ia_subnetmask;
|
|
|
|
struct in_addr ia_netbroadcast;
|
|
|
|
struct sockaddr_in ia_addr;
|
|
|
|
struct sockaddr_in ia_dstaddr; /* broadcast address */
|
|
|
|
struct sockaddr_in ia_sockmask;
|
|
|
|
/*XXX - milticast address list */
|
|
|
|
};
|
|
|
|
#define ia_ifp ia_ifa.ifa_ifp
|
|
|
|
#define ia_flags ia_ifa.ifa_flags
|
|
|
|
#define ia_broadaddr ia_dstaddr
|
|
|
|
|
|
|
|
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
|
|
|
|
#define sintosa(sin) ((struct sockaddr *)(sin))
|
|
|
|
|
|
|
|
/* used to pass in additional information, such as aliases */
|
|
|
|
struct in_aliasreq {
|
|
|
|
char ifa_name[IFNAMSIZ];
|
|
|
|
struct sockaddr_in ifra_addr;
|
|
|
|
struct sockaddr_in ifra_broadaddr;
|
|
|
|
#define ifra_dstaddr ifra_broadaddr
|
|
|
|
struct sockaddr_in ifra_mask;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct in_multi {
|
2002-07-12 13:36:23 +04:00
|
|
|
struct in_addr inm_addr;
|
|
|
|
struct ifnet *inm_ifp;
|
2002-07-09 16:24:59 +04:00
|
|
|
struct in_ifaddr *inm_ia;
|
2002-07-12 13:36:23 +04:00
|
|
|
uint inm_refcount;
|
|
|
|
uint inm_timer;
|
|
|
|
struct in_multi *next;
|
2002-07-09 16:24:59 +04:00
|
|
|
struct in_multi **prev;
|
2002-07-12 13:36:23 +04:00
|
|
|
uint inm_state;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Given a pointer to an in_ifaddr (ifaddr),
|
|
|
|
* return a pointer to the addr as a sockaddr_in.
|
|
|
|
*/
|
|
|
|
|
2002-07-12 13:36:23 +04:00
|
|
|
#ifdef _KERNEL_MODE
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-07-12 13:36:23 +04:00
|
|
|
#define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
|
|
|
|
|
2002-10-30 04:21:54 +03:00
|
|
|
// extern struct in_ifaddr *in_ifaddr;
|
2002-07-12 13:36:23 +04:00
|
|
|
|
|
|
|
int in_control(struct socket *so, int cmd, char *data, struct ifnet *ifp);
|
|
|
|
int in_ifinit(struct ifnet *dev, struct in_ifaddr *ia, struct sockaddr_in *sin,
|
2002-07-09 16:24:59 +04:00
|
|
|
int scrub);
|
2002-07-12 13:36:23 +04:00
|
|
|
int inetctlerr(int cmd);
|
|
|
|
struct in_ifaddr *get_primary_addr(void);
|
|
|
|
#endif
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#endif /* NETINET_IN_VAR_H */
|