00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef SOCKET_H_
00012 #define SOCKET_H_
00013
00014 #define MAX_SOCKET_FILENAME 11
00015
00016 typedef struct s_socket {
00017 LIST_ENTRY(s_socket) so_next_os;
00018
00019 int so_fd;
00020 int64_t so_holders;
00021
00022 void *so_pcb;
00023 const struct s_protosw *so_protosw;
00024
00025 off_t so_offset;
00026 int64_t so_ar;
00027 } t_socket;
00028
00029 LIST_HEAD(s_os_list, s_socket);
00030
00031
00032 #ifdef __INET__
00033
00034 int sysinet_poll_os(struct s_socket *os, t_pollrec *pollrec);
00035 t_socket *socket_find_os(u_int32_t fd);
00036 void socket_report(struct s_async_report *ar);
00037 void sysinet_socket(t_tcb *caller);
00038 void sysinet_bind(t_tcb *caller);
00039 void sysinet_listen(t_tcb *caller);
00040 void sysinet_connect(t_tcb *caller);
00041 void sysinet_recvfrom(t_tcb *caller);
00042 void socket_read(t_tcb *caller, struct s_socket *os, pid_t pid, char *ubuf, size_t usize);
00043 void sysinet_sendto(t_tcb *caller);
00044 void sysinet_getsockname(t_tcb *caller);
00045 void sysinet_getpeername(t_tcb *caller);
00046 void socket_write(t_tcb *caller, struct s_socket *os, pid_t pid, char *ubuf, size_t usize);
00047 void sysinet_close(t_tcb *caller, t_socket *os, pid_t pid);
00048 void sysinet_accept(t_tcb *caller);
00049 void sysinet_geterr(t_tcb *caller);
00050 void sysinet_ioctl(t_tcb *caller, struct s_socket *os, u_long op, char *uparam, pid_t pid);
00051 #endif
00052 #endif