home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / lan / soss.arj / SRC / SOCK.H < prev    next >
C/C++ Source or Header  |  1991-02-22  |  1KB  |  47 lines

  1. /*
  2.  *  sock.h --
  3.  *      High level socket interface for PC NFS file server.
  4.  *
  5.  *  Author:
  6.  *      See-Mong Tan
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include <types.h>
  11. #include <task.h>
  12. #include <q.h>
  13. #include <netq.h>
  14. #include <net.h>
  15. #include <custom.h>
  16. #include <netbuf.h>
  17. #include <icmp.h>
  18. #include <ip.h>
  19. #include <udp.h>
  20. #include <tftp.h>
  21. #include <timer.h>
  22. #include <em.h>
  23. #define       SOCK_STREAM     1               /* stream socket */
  24. #define       SOCK_DGRAM      2               /* datagram socket */
  25. #define  AF_INET         2               /* internetwork: UDP, TCP, etc. */
  26. #define       IPPROTO_UDP             17          /* user datagram protocol */
  27. #define       IPPROTO_TCP             6               /* tcp */
  28.  
  29.  
  30.  
  31. /* exported functions */
  32.  
  33.   /* creates socket - combination of 4 BSD "socket" and "bind" calls */
  34. extern int sock_create(int, int, struct sockaddr_in *);
  35.   /* closes socket - 4 BSD "close" */
  36. extern void sock_close(int);
  37.   /* receive - 4 BSD "recvfom" */
  38. extern int sock_recv(int, char far *, int, struct sockaddr_in *);
  39.   /* synchronous I/O multiplexing - 4 BSD "select" */
  40. extern int sock_select(long *, long *);
  41.   /* UDP message send */
  42. extern int sock_send(int, struct sockaddr_in *, char far *, int);
  43.   /* returns host name given internet address */
  44. extern char *sock_gethostbyaddr(struct sockaddr_in);
  45.   /* returns host address given host name */
  46. extern long sock_gethostbyname(char *);
  47.