1c5d00b0c1ea11039afa06ca1ea9fa4903605170
2 * dvconnection.h -- DV Connection Handler
3 * Copyright (C) 2002-2003 Ushodaya Enterprises Limited
4 * Author: Charles Yates <charles.yates@pandora.be>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef _DV_CONNECTION_H_
22 #define _DV_CONNECTION_H_
24 #include <sys/types.h>
25 #include <sys/socket.h>
26 #include <netinet/in.h>
29 #include <dvtokeniser.h>
36 /** Connection structure
42 struct sockaddr_in sin
;
47 /** Enumeration for responses.
52 RESPONSE_SUCCESS
= 200,
53 RESPONSE_SUCCESS_N
= 201,
54 RESPONSE_SUCCESS_1
= 202,
55 RESPONSE_UNKNOWN_COMMAND
= 400,
56 RESPONSE_TIMEOUT
= 401,
57 RESPONSE_MISSING_ARG
= 402,
58 RESPONSE_INVALID_UNIT
= 403,
59 RESPONSE_BAD_FILE
= 404,
60 RESPONSE_OUT_OF_RANGE
= 405,
61 RESPONSE_TOO_MANY_FILES
= 406,
66 /* the following struct is passed as the single argument
67 to all command callback functions */
73 dv_tokeniser tokeniser
;
79 command_argument_t
, *command_argument
;
81 /* A handler is defined as follows. */
82 typedef int (*command_handler_t
) ( command_argument
);
85 extern void *parser_thread( void *arg
);