Bring this up to date.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@118 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
David Reid
2002-07-12 09:27:23 +00:00
parent 81f518cf5f
commit bd3bb49923
3 changed files with 48 additions and 33 deletions
+11 -8
View File
@@ -2,14 +2,14 @@
/* A domain is just a container for like minded protocols! */ /* A domain is just a container for like minded protocols! */
#ifndef DOMAIN_H #ifndef _SYS_DOMAIN_H
#define DOMAIN_H #define _SYS_DOMAIN_H
struct domain { struct domain {
int dom_family; /* AF_INET and so on */ int dom_family; /* AF_INET and so on */
char *dom_name; char *dom_name;
void (*dom_init)(void); /* initialise */ void (*dom_init)(void); /* initialise */
struct protosw *dom_protosw; /* the protocols we have */ struct protosw *dom_protosw; /* the protocols we have */
struct domain *dom_next; struct domain *dom_next;
@@ -19,8 +19,11 @@ struct domain {
int dom_maxrtkey; int dom_maxrtkey;
}; };
struct domain *domains; #ifdef _KERNEL_MODE
void add_domain(struct domain *dom, int fam); struct domain *domains;
void remove_domain(int fam);
#endif /* DOMAIN_H */ void add_domain (struct domain *dom, int fam);
void remove_domain (int fam);
#endif /* _KERNEL_MODE */
#endif /* _SYS_DOMAIN_H */
+19 -9
View File
@@ -1,10 +1,10 @@
/* protosw.h */ /* protosw.h */
#ifndef PROTOSW_H #ifndef _SYS_PROTOSW_H
#define PROTOSW_H #define _SYS_PROTOSW_H
#include "sys/socketvar.h" /* for struct socket */ #include <sys/socketvar.h> /* for struct socket */
#include "net/route.h" #include <net/route.h>
#define PRCO_SETOPT 0 #define PRCO_SETOPT 0
#define PRCO_GETOPT 1 #define PRCO_GETOPT 1
@@ -136,12 +136,22 @@ struct protosw {
/* Network stack defines... */ /* Network stack defines... */
#ifdef _NETWORK_STACK #ifdef _KERNEL_MODE
struct protosw *protocols; struct protosw *protocols;
void add_protocol(struct protosw *pr, int fam);
void remove_protocol(struct protosw *pr); enum {
NET_LAYER1 = 1,
NET_LAYER2,
NET_LAYER3,
NET_LAYER4
};
void add_protosw (struct protosw *prt[], int);
void add_protocol (struct protosw *, int);
void remove_protocol (struct protosw *);
#endif #endif
struct protosw *pffindproto(int domain, int protocol, int type); struct protosw *pffindproto(int domain, int protocol, int type);
struct protosw *pffindtype(int domain, int type); struct protosw *pffindtype(int domain, int type);
#endif /* PROTOSW_H */ #endif /* _SYS_PROTOSW_H */
+18 -16
View File
@@ -1,13 +1,13 @@
/* socketvar.h */ /* socketvar.h */
#ifndef SYS_SOCKETVAR_H #ifndef _SYS_SOCKETVAR_H
#define SYS_SOCKETVAR_H #define _SYS_SOCKETVAR_H
#include <kernel/OS.h> #include <OS.h>
#include "sys/mbuf.h" #include <mbuf.h>
#include "sys/net_uio.h" #include <sys/uio.h>
#include "sys/socket.h" #include <sys/socket.h>
struct sockbuf { struct sockbuf {
uint32 sb_cc; /* actual chars in buffer */ uint32 sb_cc; /* actual chars in buffer */
@@ -39,8 +39,8 @@ struct socket {
uint16 so_options; /* socket options */ uint16 so_options; /* socket options */
int16 so_linger; /* dreaded linger value */ int16 so_linger; /* dreaded linger value */
int16 so_state; /* socket state */ int16 so_state; /* socket state */
caddr_t so_pcb; /* pointer to the control block */ char *so_pcb; /* pointer to the control block */
sem_id so_lock; /* socket lock */ sem_id so_lock; /* socket lock */
sem_id so_timeo; /* our wait channel */ sem_id so_timeo; /* our wait channel */
struct protosw *so_proto; /* pointer to protocol module */ struct protosw *so_proto; /* pointer to protocol module */
@@ -151,7 +151,7 @@ struct socket {
/* we don't handle upcall for sockets */ /* we don't handle upcall for sockets */
#define sowwakeup(so) sowakeup((so), &(so)->so_snd) #define sowwakeup(so) sowakeup((so), &(so)->so_snd)
#ifdef _NETWORK_STACK #ifdef _KERNEL_MODE
uint32 sb_max; uint32 sb_max;
@@ -160,21 +160,21 @@ uint32 sb_max;
/* These are the ones we export to libnet.so */ /* These are the ones we export to libnet.so */
int initsocket(void **); int initsocket(void **);
int socreate (int, void *, int, int); int socreate (int, struct socket **, int, int);
int soshutdown(void *, int); int soshutdown(void *, int);
int soclose (void *); int soclose (void *);
int sobind (void *, caddr_t, int); int sobind (void *, char *, int);
int solisten (void *, int); int solisten (void *, int);
int soconnect (void *, caddr_t, int); int soconnect (void *, char *, int);
int soaccept (void *, void **, void *, int *); int soaccept (void *, void **, void *, int *);
int writeit (void *, struct iovec *, int); int writeit (void *, struct iovec *, int);
int readit (void *, struct iovec *, int *); int readit (void *, struct iovec *, int *);
int sendit (void *, struct msghdr *, int, int *); int sendit (void *, struct msghdr *, int, int *);
int recvit (void *, struct msghdr *, caddr_t, int *); int recvit (void *, struct msghdr *, char *, int *);
int soo_ioctl (void *, int, caddr_t); //int so_ioctl (void *, int, void *, size_t);
int sosysctl (int *, uint, void *, size_t *, void *, size_t); int sosysctl (int *, uint, void *, size_t *, void *, size_t);
int sosetopt (void *, int, int, const void *, size_t); int sosetopt (void *, int, int, const void *, size_t);
int sogetopt (void *, int, int, void *, size_t *); int sogetopt (void *, int, int, void *, size_t *);
@@ -208,6 +208,8 @@ int sbappendcontrol (struct sockbuf *sb, struct mbuf *m0,
void sbappendrecord (struct sockbuf *sb, struct mbuf *m0); void sbappendrecord (struct sockbuf *sb, struct mbuf *m0);
void sbcheck (struct sockbuf *sb); void sbcheck (struct sockbuf *sb);
void sbcompress (struct sockbuf *sb, struct mbuf *m, struct mbuf *n); void sbcompress (struct sockbuf *sb, struct mbuf *m, struct mbuf *n);
void sbinsertoob(struct sockbuf *, struct mbuf *);
int soreceive (struct socket *so, struct mbuf **paddr, struct uio *uio, int soreceive (struct socket *so, struct mbuf **paddr, struct uio *uio,
struct mbuf **mp0, struct mbuf **controlp, int *flagsp); struct mbuf **mp0, struct mbuf **controlp, int *flagsp);
void sowakeup(struct socket *so, struct sockbuf *sb); void sowakeup(struct socket *so, struct sockbuf *sb);
@@ -231,6 +233,6 @@ int sb_lock(struct sockbuf *sb);
int nsleep(sem_id chan, char *msg, int timeo); int nsleep(sem_id chan, char *msg, int timeo);
void wakeup(sem_id chan); void wakeup(sem_id chan);
#endif /* _NETWORK_STACK */ #endif /* _KERNEL_MODE */
#endif /* SYS_SOCKETVAR_H */ #endif /* _SYS_SOCKETVAR_H */