The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
daemon.h
Go to the documentation of this file.
1 /* This file is part of Netsukuku
2  * (c) Copyright 2004 Andrea Lo Pumo aka AlpT <alpt@freaknet.org>
3  *
4  * This source code is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * This source code is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * Please refer to the GNU Public License for more details.
13  *
14  * You should have received a copy of the GNU Public License along with
15  * this source code; if not, write to:
16  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 
19 #ifndef DAEMON_H
20 #define DAEMON_H
21 
22 #define MAX_LISTENING_SOCKETS MAX_INTERFACES
23 
24 /* These mutexes are used to wait the complete start up of the daemons when
25  * launched. */
26 pthread_mutex_t udp_daemon_lock;
27 pthread_mutex_t tcp_daemon_lock;
28 
29 /* flags for udp_exec_pkt_argv and udp_daemon_argv */
30 #define UDP_THREAD_FOR_EACH_PKT 1 /* For each incoming udp
31  packets use threads */
32 
33 /* Argv passed to udp_exec_pkt() */
36  int acpt_idx;
37  int acpt_sidx;
38  u_char flags;
39 };
40 
41 /* Argv passed to udp_daemon */
43  u_short port;
44  u_char flags;
45 };
46 
47 pthread_mutex_t udp_exec_lock;
48 pthread_mutex_t tcp_exec_lock;
49 
50 int prepare_listen_socket(int family, int socktype, u_short port, interface *dev);
51 void *tcp_recv_loop(void *recv_pkt);
52 void *tcp_daemon(void *null);
53 void *udp_daemon(void *door);
54 
55 #endif /*DAEMON_H*/
pthread_mutex_t udp_exec_lock
Definition: daemon.h:47
PACKET * recv_pkt
Definition: daemon.h:35
u_short port
Definition: daemon.h:43
int acpt_sidx
Definition: daemon.h:37
void * udp_daemon(void *door)
Definition: daemon.c:186
pthread_mutex_t udp_daemon_lock
Definition: daemon.h:26
Definition: if.h:29
void * tcp_recv_loop(void *recv_pkt)
Definition: daemon.c:299
void * tcp_daemon(void *null)
Definition: daemon.c:328
Definition: daemon.h:42
u_char flags
Definition: daemon.h:44
pthread_mutex_t tcp_daemon_lock
Definition: daemon.h:27
int prepare_listen_socket(int family, int socktype, u_short port, interface *dev)
Definition: daemon.c:43
pthread_mutex_t tcp_exec_lock
Definition: daemon.h:48
Definition: daemon.h:34
int acpt_idx
Definition: daemon.h:36
Definition: pkts.h:118
int family
Definition: if.c:34
u_char flags
Definition: daemon.h:38