nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* sync_pipe.h |
2 | * Low-level synchronization pipe routines for use by Wireshark/TShark |
||
3 | * and dumpcap |
||
4 | * |
||
5 | * Wireshark - Network traffic analyzer |
||
6 | * By Gerald Combs <gerald@wireshark.org> |
||
7 | * Copyright 1998 Gerald Combs |
||
8 | * |
||
9 | * This program is free software; you can redistribute it and/or |
||
10 | * modify it under the terms of the GNU General Public License |
||
11 | * as published by the Free Software Foundation; either version 2 |
||
12 | * of the License, or (at your option) any later version. |
||
13 | * |
||
14 | * This program is distributed in the hope that it will be useful, |
||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
17 | * GNU General Public License for more details. |
||
18 | * |
||
19 | * You should have received a copy of the GNU General Public License |
||
20 | * along with this program; if not, write to the Free Software |
||
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
||
22 | */ |
||
23 | |||
24 | |||
25 | /** @file |
||
26 | * |
||
27 | * Low-level sync pipe interfaces. |
||
28 | */ |
||
29 | |||
30 | #ifndef __SYNC_PIPE_H__ |
||
31 | #define __SYNC_PIPE_H__ |
||
32 | |||
33 | |||
34 | /* |
||
35 | * Maximum length of sync pipe message data. Must be < 2^24, as the |
||
36 | * message length is 3 bytes. |
||
37 | * XXX - this must be large enough to handle a Really Big Filter |
||
38 | * Expression, as the error message for an incorrect filter expression |
||
39 | * is a bit larger than the filter expression. |
||
40 | */ |
||
41 | #define SP_MAX_MSG_LEN 4096 |
||
42 | |||
43 | |||
44 | /* Size of buffer to hold decimal representation of |
||
45 | signed/unsigned 64-bit int */ |
||
46 | #define SP_DECISIZE 20 |
||
47 | |||
48 | /* |
||
49 | * Indications sent out on the sync pipe (from child to parent). |
||
50 | * We might want to switch to something like Thrift |
||
51 | * (http://thrift.apache.org/) or Protocol Buffers |
||
52 | * (http://code.google.com/p/protobuf-c/) if we ever need to use more |
||
53 | * complex messages. |
||
54 | */ |
||
55 | #define SP_FILE 'F' /* the name of the recently opened file */ |
||
56 | #define SP_ERROR_MSG 'E' /* error message */ |
||
57 | #define SP_BAD_FILTER 'B' /* error message for bad capture filter */ |
||
58 | #define SP_PACKET_COUNT 'P' /* count of packets captured since last message */ |
||
59 | #define SP_DROPS 'D' /* count of packets dropped in capture */ |
||
60 | #define SP_SUCCESS 'S' /* success indication, no extra data */ |
||
61 | /* |
||
62 | * Win32 only: Indications sent out on the signal pipe (from parent to child) |
||
63 | * (UNIX-like sends signals for this) |
||
64 | */ |
||
65 | #define SP_QUIT 'Q' /* "gracefully" capture quit message (SIGUSR1) */ |
||
66 | |||
67 | /* write a single message header to the recipient pipe */ |
||
68 | extern ssize_t |
||
69 | pipe_write_header(int pipe_fd, char indicator, int length); |
||
70 | |||
71 | /* write a message to the recipient pipe in the standard format |
||
72 | (3 digit message length (excluding length and indicator field), |
||
73 | 1 byte message indicator and the rest is the message). |
||
74 | If msg is NULL, the message has only a length and indicator. */ |
||
75 | extern void |
||
76 | pipe_write_block(int pipe_fd, char indicator, const char *msg); |
||
77 | |||
78 | /** the child encountered an error, notify the parent */ |
||
79 | extern void |
||
80 | sync_pipe_errmsg_to_parent(int pipe_fd, const char *error_msg, |
||
81 | const char *secondary_error_msg); |
||
82 | |||
83 | /** Has the parent signalled the child to stop? */ |
||
84 | #define SIGNAL_PIPE_CTRL_ID_NONE "none" |
||
85 | #ifdef _WIN32 |
||
86 | #define SIGNAL_PIPE_FORMAT "\\\\.\\pipe\\wireshark.%s.signal" |
||
87 | #endif |
||
88 | |||
89 | #endif /* sync_pipe.h */ |
||
90 | |||
91 | /* |
||
92 | * Editor modelines - http://www.wireshark.org/tools/modelines.html |
||
93 | * |
||
94 | * Local variables: |
||
95 | * c-basic-offset: 4 |
||
96 | * tab-width: 8 |
||
97 | * indent-tabs-mode: nil |
||
98 | * End: |
||
99 | * |
||
100 | * vi: set shiftwidth=4 tabstop=8 expandtab: |
||
101 | * :indentSize=4:tabSize=8:noTabs=true: |
||
102 | */ |