reenabled stun probe
[transsip.git] / src / transsip.c
blob58622ffb333e802183edddfadbc4d4e6e288ba0f
1 #include <pthread.h>
3 #include "die.h"
4 #include "xutils.h"
6 extern void enter_shell_loop(int tsocki, int tsocko);
7 extern void *engine_main(void *arg);
9 static pthread_t tid;
10 static struct pipepair pp;
12 static void start_server(int usocki, int usocko)
14 pp.i = usocki;
15 pp.o = usocko;
16 int ret = pthread_create(&tid, NULL, engine_main, &pp);
17 if (ret)
18 panic("Cannot create server thread!\n");
21 int main(void)
23 int ret;
24 int efd[2], refd[2];
26 ret = pipe(efd);
27 if (ret < 0)
28 panic("Cannot create event fd!\n");
29 ret = pipe(refd);
30 if (ret < 0)
31 panic("Cannot create event fd!\n");
33 start_server(efd[0], refd[1]);
34 enter_shell_loop(refd[0], efd[1]);
36 close(efd[0]);
37 close(efd[1]);
38 close(refd[0]);
39 close(refd[1]);
41 return 0;