00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef INET_H_
00012 #define INET_H_
00013
00014 #include <libc.h>
00015 #include <core.h>
00016 #include <libinet.h>
00017 #include <libtimer.h>
00018
00019 #include "iface.h"
00020
00021 #ifdef __INET__
00022
00023 struct s_async_report;
00024 struct s_async_action;
00025
00026 #include "socket.h"
00027
00028 #include "in_pcb.h"
00029 #endif
00030
00031 #include "ethernet.h"
00032 #include "ip.h"
00033 #include "arp.h"
00034 #include "udp.h"
00035 #include "icmp.h"
00036 #include "tcp.h"
00037
00038 #include "inetfs.h"
00039
00040 #include "route.h"
00041
00042
00043 #ifdef __INET__
00044 #include "timer.h"
00045 #include "protosw.h"
00046 #include "loopback.h"
00047 #include "async_action.h"
00048 #include "holder.h"
00049 #include "conf.h"
00050 #define INET_RELEASE "0.2"
00051
00052
00053
00054
00055
00056
00057 #define MAX_PORT_NUMBER 65526
00058 #define PRIVILEGED_PORT_NUMBER 1024
00059
00060 LIST_HEAD(s_of_list, s_of);
00061
00062
00063
00064
00065
00066 typedef struct s_inet
00067 {
00068
00069 char *conf_filename;
00070
00071 struct s_conf_head conf_head;
00072
00073 u_int32_t fd_cnt;
00074 struct s_of_list of_list;
00075 struct s_os_list os_list;
00076
00077 t_entry root_entry;
00078 t_entry *route_entry;
00079 t_entry *socket_entry;
00080
00081
00082 u_int64_t async_report_id;
00083 struct s_ar_tailq async_reports;
00084
00085
00086 int holder_groups_lock;
00087 int holder_groups_id;
00088 struct s_holder_groups_head holder_groups;
00089
00090
00091 struct s_aa_tailq stackq;
00092 int stackq_lock;
00093 pid_t stack_pid;
00094
00095
00096 struct s_route_table route_table;
00097 int route_table_lock;
00098
00099
00100 struct s_iface_list iface_list;
00101 int iface_list_lock;
00102
00103
00104 int timer_list_lock;
00105 int timer_action_id;
00106 struct s_timer_action_head timer_list;
00107 } t_inet;
00108
00109 extern struct s_inet inet;
00110
00111
00112
00113
00114 void inetsrv_entry(void);
00115 void inetstack_entry(void);
00116
00117 #endif
00118
00119
00120 #ifdef __INET__
00121
00122 int inetstack_push(int aa_type, int64_t aa_ar, void *aa_data);
00123 void inetstack_entry(void);
00124 #endif
00125 #endif