Fix for bug 1178. Allow FT_?INT24 BASE_DEC VALs in the expression selection dialog.
[obnox/wireshark/wip.git] / sync_pipe.h
1 /* sync_pipe.h
2  * Low-level synchronization pipe routines for use by Wireshark and dumpcap
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25
26 /** @file
27  *  
28  *  Low-level sync pipe interfaces.
29  */
30
31 #ifndef __SYNC_PIPE_H__
32 #define __SYNC_PIPE_H__
33
34
35 /*
36  * Maximum length of sync pipe message data.  Must be < 2^24, as the
37  * message length is 3 bytes.
38  * XXX - this must be large enough to handle a Really Big Filter
39  * Expression, as the error message for an incorrect filter expression
40  * is a bit larger than the filter expression.
41  */
42 #define SP_MAX_MSG_LEN  4096
43
44
45 /* Size of buffer to hold decimal representation of
46    signed/unsigned 64-bit int */
47 #define SP_DECISIZE 20
48
49 /*
50  * Indications sent out on the sync pipe (from child to parent).
51  */
52 #define SP_FILE         'F'     /* the name of the recently opened file */
53 #define SP_ERROR_MSG    'E'     /* error message */
54 #define SP_BAD_FILTER   'B'     /* error message for bad capture filter */
55 #define SP_PACKET_COUNT 'P'     /* count of packets captured since last message */
56 #define SP_DROPS        'D'     /* count of packets dropped in capture */
57 /*
58  * Win32 only: Indications sent out on the signal pipe (from parent to child)
59  * (UNIX-like sends signals for this)
60  */
61 #define SP_QUIT         'Q'     /* "gracefully" capture quit message (SIGUSR1) */
62
63 /* write a single message header to the recipient pipe */
64 extern int
65 pipe_write_header(int pipe, char indicator, int length);
66
67 /* write a message to the recipient pipe in the standard format 
68    (3 digit message length (excluding length and indicator field), 
69    1 byte message indicator and the rest is the message).
70    If msg is NULL, the message has only a length and indicator. */
71 extern void
72 pipe_write_block(int pipe, char indicator, const char *msg);
73
74 /** the child encountered an error, notify the parent */
75 extern void 
76 sync_pipe_errmsg_to_parent(const char *error_msg,
77                            const char *secondary_error_msg);
78
79 #endif /* sync_pipe.h */