diff --git a/headers/posix/net/if.h b/headers/posix/net/if.h index 4e033b1193..f9d40be25b 100644 --- a/headers/posix/net/if.h +++ b/headers/posix/net/if.h @@ -2,16 +2,20 @@ * Interface definitions for beos */ -#ifndef OBOS_IF_H -#define OBOS_IF_H +#ifndef _NET_IF_H +#define _NET_IF_H -#include -#include -#include "sys/socketvar.h" -#include "net/if_types.h" -#include "netinet/in.h" -#include "net/route.h" - +#include +//#include +#include +#include +#include +#include + +/* XXX - hack to get this file building + * taken from be/drivers/Drivers.h + */ +#define B_DEVICE_OP_CODES_END 9999 enum { IF_GETADDR = B_DEVICE_OP_CODES_END, IF_INIT, @@ -146,7 +150,7 @@ struct ifnet { void (*input) (struct mbuf*); int (*output)(struct ifnet *, struct mbuf*, struct sockaddr*, struct rtentry *); - int (*ioctl) (struct ifnet *, int, caddr_t); + int (*ioctl) (struct ifnet *, ulong, char *); }; #define if_mtu ifd.ifi_mtu #define if_type ifd.ifi_type @@ -177,7 +181,7 @@ struct ifreq { struct sockaddr ifru_broadaddr; uint16 ifru_flags; int ifru_metric; - caddr_t ifru_data; + char * ifru_data; } ifr_ifru; }; #define ifr_addr ifr_ifru.ifru_addr @@ -191,7 +195,7 @@ struct ifreq { struct ifconf { int ifc_len; /* length of associated buffer */ union { - caddr_t ifcu_buf; + char * ifcu_buf; struct ifreq *ifcu_req; } ifc_ifcu; }; @@ -246,30 +250,28 @@ struct ifa_msghdr { int ifam_metric; /* value of ifa_metric */ }; -#ifdef _NETWORK_STACK - -/* function declaration */ -struct ifq *start_ifq(void); -void stop_ifq(struct ifq *); -struct ifnet *get_interfaces(void); -struct ifnet *ifunit(char *name); -struct ifaddr *ifa_ifwithaddr(struct sockaddr *); -struct ifaddr *ifa_ifwithaf(int); -struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); -struct ifaddr *ifa_ifwithnet(struct sockaddr *); -struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, +#ifdef _KERNEL_MODE + /* function declaration */ + struct ifq *start_ifq(void); + void stop_ifq(struct ifq *); + struct ifnet *get_interfaces(void); + struct ifnet *ifunit(char *name); + struct ifaddr *ifa_ifwithaddr(struct sockaddr *); + struct ifaddr *ifa_ifwithaf(int); + struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); + struct ifaddr *ifa_ifwithnet(struct sockaddr *); + struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); -struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); -void ifafree(struct ifaddr *); + struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); + void ifafree(struct ifaddr *); -void if_attach(struct ifnet *ifp); -void if_detach(struct ifnet *ifp); - -int ifioctl(struct socket *so, int cmd, caddr_t data); -int ifconf(int cmd, caddr_t data); -void if_init(void); + void if_attach(struct ifnet *ifp); + void if_detach(struct ifnet *ifp); + int ifioctl(struct socket *so, ulong cmd, char *data); + int ifconf(int cmd, char *data); + void if_init(void); #endif -#endif /* OBOS_IF_H */ +#endif /* _NET_IF_H */ diff --git a/headers/posix/net/if_ppp.h b/headers/posix/net/if_ppp.h index a06ca8bbca..b331efa0d4 100644 --- a/headers/posix/net/if_ppp.h +++ b/headers/posix/net/if_ppp.h @@ -120,7 +120,7 @@ struct ifpppcstatsreq { #define SIOCGPPPSTATS _IOWR('i', 123, struct ifpppstatsreq) #define SIOCGPPPCSTATS _IOWR('i', 122, struct ifpppcstatsreq) -#ifdef _KERNEL_ +#ifdef _KERNEL_MODE int pppoutput (struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); void pppinput (struct mbuf *); diff --git a/headers/posix/net/ppp_ctrl.h b/headers/posix/net/ppp_ctrl.h deleted file mode 100644 index 870c688c0b..0000000000 --- a/headers/posix/net/ppp_ctrl.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * ppp_ctrl.h - * - * Definitions required to control PPP from userland - */ - -#ifndef _NET_PPP_CTRL_H_ -#define _NET_PPP_CTRL_H_ - -#define PPPCTRL_THREADNAME "PPP_Control_Thread" -#define PPPCTRL_MAXSIZE 100 /* biggest lump of data we accept */ - -enum { - PPPCTRL_OK = 0, /* Operation completed OK */ - PPPCTRL_FAIL, /* Operation failed */ - PPPCTRL_CREATE, /* create a new PPP device */ - PPPCTRL_DELETE, /* delete a PPP device */ - PPPCTRL_UP, /* start a ppp connection */ - PPPCTRL_OPEN, /* Open a device */ - PPPCTRL_DOWN, /* stop a ppp connection */ - -}; - -#endif /* _NET_PPP_CTRL_H_ */ diff --git a/headers/posix/net/ppp_defs.h b/headers/posix/net/ppp_defs.h deleted file mode 100644 index 0d9fc4a204..0000000000 --- a/headers/posix/net/ppp_defs.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * ppp_defs.h - PPP definitions. - * - * Copyright (c) 1994 The Australian National University. - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation is hereby granted, provided that the above copyright - * notice appears in all copies. This software is provided without any - * warranty, express or implied. The Australian National University - * makes no representations about the suitability of this software for - * any purpose. - * - * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY - * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF - * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO - * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, - * OR MODIFICATIONS. - */ - -#ifndef _PPP_DEFS_H_ -#define _PPP_DEFS_H_ - -/* - * The basic PPP frame. - */ - -/* pppoe header = 6 bytes - * hdlc frame header is 3 bytes - * PPP protocol is 2 bytes, - * so PPP_HDRLEN set to 8 to try and get us enough storage - * for any of these. If we have to allocate a new mbuf then so be it. - */ -#define PPP_HDRLEN 8 /* octets for standard ppp header */ -#define PPP_PROTHDRLEN 2 -#define PPP_PROTOFF PPP_HDRLEN - PPP_PROTHDRLEN - -#define PPP_FCSLEN 2 /* octets for FCS */ -#define PPP_MRU 1500 /* default MRU = max length of info field */ - -#define PPP_PROTOCOL(p) ((((u_char *)(p))[0] << 8) + ((u_char *)(p))[1]) - -/* - * Significant octet values. - */ -#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ -#define PPP_UI 0x03 /* Unnumbered Information */ -#define PPP_FLAG 0x7e /* Flag Sequence */ -#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ -#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ - -/* - * Protocol field values. - */ -#define PPP_IP 0x21 /* Internet Protocol */ -#define PPP_XNS 0x25 /* Xerox NS */ -#define PPP_AT 0x29 /* AppleTalk Protocol */ -#define PPP_IPX 0x2b /* Internetwork Packet Exchange */ -#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ -#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ -#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ -#define PPP_COMP 0xfd /* compressed packet */ -#define PPP_IPCP 0x8021 /* IP Control Protocol */ -#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ -#define PPP_IPXCP 0x802b /* IPX Control Protocol */ -#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ -#define PPP_CCP 0x80fd /* Compression Control Protocol */ -#define PPP_LCP 0xc021 /* Link Control Protocol */ -#define PPP_PAP 0xc023 /* Password Authentication Protocol */ -#define PPP_LQR 0xc025 /* Link Quality Report protocol */ -#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ -#define PPP_CBCP 0xc029 /* Callback Control Protocol */ - -/* - * Values for FCS calculations. - */ -#define PPP_INITFCS 0xffff /* Initial FCS value */ -#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ - -/* - * Extended asyncmap - allows any character to be escaped. - */ -typedef uint32 ext_accm[8]; - -/* - * What to do with network protocol (NP) packets. - */ -enum NPmode { - NPMODE_PASS, /* pass the packet through */ - NPMODE_DROP, /* silently drop the packet */ - NPMODE_ERROR, /* return an error */ - NPMODE_QUEUE /* save it up for later. */ -}; - -/* - * Statistics. - */ -struct pppstat { - uint ppp_ibytes; /* bytes received */ - uint ppp_ipackets; /* packets received */ - uint ppp_ierrors; /* receive errors */ - uint ppp_obytes; /* bytes sent */ - uint ppp_opackets; /* packets sent */ - uint ppp_oerrors; /* transmit errors */ -}; - -struct vjstat { - uint vjs_packets; /* outbound packets */ - uint vjs_compressed; /* outbound compressed packets */ - uint vjs_searches; /* searches for connection state */ - uint vjs_misses; /* times couldn't find conn. state */ - uint vjs_uncompressedin; /* inbound uncompressed packets */ - uint vjs_compressedin; /* inbound compressed packets */ - uint vjs_errorin; /* inbound unknown type packets */ - uint vjs_tossed; /* inbound packets tossed because of error */ -}; - -struct ppp_stats { - struct pppstat p; /* basic PPP statistics */ - struct vjstat vj; /* VJ header compression statistics */ -}; - -struct compstat { - uint unc_bytes; /* total uncompressed bytes */ - uint unc_packets; /* total uncompressed packets */ - uint comp_bytes; /* compressed bytes */ - uint comp_packets; /* compressed packets */ - uint inc_bytes; /* incompressible bytes */ - uint inc_packets; /* incompressible packets */ - uint ratio; /* recent compression ratio << 8 */ -}; - -struct ppp_comp_stats { - struct compstat c; /* packet compression statistics */ - struct compstat d; /* packet decompression statistics */ -}; - -/* - * The following structure records the time in seconds since - * the last NP packet was sent or received. - */ -struct ppp_idle { - time_t xmit_idle; /* time since last NP packet sent */ - time_t recv_idle; /* time since last NP packet received */ -}; - -#ifdef _NETWORK_STACK -uint16 pppfcs16(uint16 fcs, u_char *cp, int len); -#endif - -#endif /* _PPP_DEFS_H_ */ diff --git a/headers/posix/net/ppp_stats.h b/headers/posix/net/ppp_stats.h deleted file mode 100644 index b5357c3429..0000000000 --- a/headers/posix/net/ppp_stats.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _PPP_STATS_H_ -#define _PPP_STATS_H_ - -/* - * Statistics. - */ -struct pppstat { - uint ppp_ibytes; /* bytes received */ - uint ppp_ipackets; /* packets received */ - uint ppp_ierrors; /* receive errors */ - uint ppp_obytes; /* bytes sent */ - uint ppp_opackets; /* packets sent */ - uint ppp_oerrors; /* transmit errors */ -}; - -struct vjstat { - uint vjs_packets; /* outbound packets */ - uint vjs_compressed; /* outbound compressed packets */ - uint vjs_searches; /* searches for connection state */ - uint vjs_misses; /* times couldn't find conn. state */ - uint vjs_uncompressedin; /* inbound uncompressed packets */ - uint vjs_compressedin; /* inbound compressed packets */ - uint vjs_errorin; /* inbound unknown type packets */ - uint vjs_tossed; /* inbound packets tossed because of error */ -}; - -struct ppp_stats { - struct pppstat p; /* basic PPP statistics */ - struct vjstat vj; /* VJ header compression statistics */ -}; - -struct compstat { - uint unc_bytes; /* total uncompressed bytes */ - uint unc_packets; /* total uncompressed packets */ - uint comp_bytes; /* compressed bytes */ - uint comp_packets; /* compressed packets */ - uint inc_bytes; /* incompressible bytes */ - uint inc_packets; /* incompressible packets */ - uint ratio; /* recent compression ratio << 8 */ -}; - -struct ppp_comp_stats { - struct compstat c; /* packet compression statistics */ - struct compstat d; /* packet decompression statistics */ -}; - -#endif /* _PPP_STATS_H_ */ diff --git a/headers/posix/net/radix.h b/headers/posix/net/radix.h index 3fbe46bbee..93080679a0 100644 --- a/headers/posix/net/radix.h +++ b/headers/posix/net/radix.h @@ -34,10 +34,10 @@ * $FreeBSD: src/sys/net/radix.h,v 1.16.2.1 2000/05/03 19:17:11 wollman Exp $ */ -#ifndef _RADIX_H_ -#define _RADIX_H_ +#ifndef _NET_RADIX_H_ +#define _NET_RADIX_H_ -#include +#include /* * Radix search tree node layout. @@ -54,8 +54,8 @@ struct radix_node { #define RNF_ACTIVE 4 /* This node is alive (for rtfree) */ union { struct { /* leaf only data: */ - caddr_t rn_Key; /* object of search */ - caddr_t rn_Mask; /* netmask, if present */ + char * rn_Key; /* object of search */ + char * rn_Mask; /* netmask, if present */ struct radix_node *rn_Dupedkey; } rn_leaf; struct { /* node only data: */ @@ -88,7 +88,7 @@ struct radix_mask { u_char rm_flags; /* cf. rn_flags */ struct radix_mask *rm_mklist; /* more masks to try */ union { - caddr_t rmu_mask; /* the mask */ + char * rmu_mask; /* the mask */ struct radix_node *rmu_leaf; /* for normal routes */ } rm_rmu; int rm_refs; /* # of references to this struct */ @@ -142,10 +142,10 @@ struct radix_node_head { #define Bcopy(a, b, n) memcpy(((char *)(b)), ((char *)(a)), (unsigned)(n)) #define Bzero(p, n) memset((char *)(p),0, (int)(n)); #define R_Malloc(p, t, n) do { \ - (p = (t) malloc((unsigned int)(n))); \ + (p = (t) kmalloc((unsigned int)(n))); \ memset(p, 0, sizeof(*p)); \ } while (0) -#define Free(p) free((char *)p); +#define Free(p) kfree((char *)p); void rn_init (void); int rn_inithead (void **, int); @@ -153,13 +153,13 @@ int rn_refines (void *, void *); struct radix_node *rn_addmask (void *, int, int), *rn_addroute (void *, void *, struct radix_node_head *, - struct radix_node [2]), + struct radix_node [2]), *rn_delete (void *, void *, struct radix_node_head *), *rn_lookup (void *v_arg, void *m_arg, - struct radix_node_head *head), + struct radix_node_head *head), *rn_match (void *, struct radix_node_head *); /* extra fucntion so we don't have to export the mask_rnhead */ struct radix_node *rn_head_search(void *argv_v); -#endif /* _RADIX_H_ */ +#endif /* _NET_RADIX_H_ */ diff --git a/headers/posix/net/route.h b/headers/posix/net/route.h index 07b6c2b770..b76f1d4a89 100644 --- a/headers/posix/net/route.h +++ b/headers/posix/net/route.h @@ -1,10 +1,10 @@ /* route.h */ -#ifndef NET_ROUTE_H -#define NET_ROUTE_H +#ifndef _NET_ROUTE_H +#define _NET_ROUTE_H -#include "net/radix.h" -#include "sys/socket.h" /* for AF_MAX */ +#include +#include /* for AF_MAX */ /* * A route consists of a destination address and a reference * to a routing entry. These are often held by protocols @@ -49,7 +49,7 @@ struct rtentry { struct ifnet *rt_ifp; /* the answer: interface to use */ struct ifaddr *rt_ifa; /* the answer: interface to use */ struct sockaddr *rt_genmask; /* for generation of cloned routes */ - caddr_t rt_llinfo; /* pointer to link level info cache */ + char * rt_llinfo; /* pointer to link level info cache */ struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */ struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */ struct rtentry *rt_parent; /* If cloned, parent of this route. */ @@ -163,8 +163,8 @@ struct walkarg { int w_given; int w_needed; int w_tmemsize; - caddr_t w_where; - caddr_t w_tmem; + char * w_where; + char * w_tmem; }; /*