00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef IN_PCB_H_
00012 #define IN_PCB_H_
00013
00014 struct s_in_pcb
00015 {
00016 LIST_ENTRY(s_in_pcb) inp_next;
00017 struct sockaddr_in inp_laddr;
00018 struct sockaddr_in inp_raddr;
00019
00020 int inp_flags;
00021 };
00022
00023
00024
00025
00026
00027 #define INP_BOUND (1<<0)
00028 #define INP_CONNECTED (1<<1)
00029 #define INP_ANONPORT (1<<2)
00030
00031 LIST_HEAD(s_in_pcb_list, s_in_pcb);
00032
00033
00034 #ifdef __INET__
00035
00036 void in_pcb_free(struct s_in_pcb_list *in_pcb_list, struct s_in_pcb *in_pcb);
00037 struct s_in_pcb *in_pcb_alloc(void);
00038 int in_pcb_bind(struct s_in_pcb_list *in_pcb_list, struct s_in_pcb *in_pcb, struct sockaddr_in *sin);
00039 int in_pcb_connect(struct s_in_pcb_list *in_pcb_list, struct s_in_pcb *in_pcb, struct sockaddr_in *sin);
00040 int in_pcb_match(struct s_in_pcb *in_pcb, struct sockaddr_in *laddr, struct sockaddr_in *raddr);
00041 struct s_in_pcb *in_pcb_lookup_port(struct s_in_pcb_list *in_pcb_list, struct in_addr in_addr, u_int16_t in_port);
00042 int in_pcb_getsockname(struct s_in_pcb *in_pcb, struct sockaddr_in *sin);
00043 int in_pcb_getpeername(struct s_in_pcb *in_pcb, struct sockaddr_in *sin);
00044 #endif
00045 #endif