aboutsummaryrefslogtreecommitdiffstats
path: root/doc/README.epan_child
blob: b77ae79c6e1aae1c791fdec1b4114af23a8446d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
EPAN CHILDREN

  This document is a work in progress.

  This document describes a potential interface between a master process and one or more working children.
  The goal is to have along-running epan process without the troubles of epan reinit (leaks, mis-reinits, ...).
  Working children are spawn to capture or read files, then terminated.
  The long running parent process initializes epan and forks children that require no further initialization to run.

  epan_child.h in the root directory describes the C interface.


Appendix A
ECHLD PROTOCOL INTERACTION DIAGRAMS

        parent            child            dumpcap
          |                 |                 | 


A.1. creation
     new_child() ---------->|
          |<-----HELLO------|
                          IDLE


A.2. keepalive
A.2.1 p->c
                        ANY_STATE
          |-------PING----->|
          |<------PONG------|
                        SAME_STATE
A.2.2 c->p
                        ANY_STATE
          |<------PING------|
          |-------PONG----->|
                        SAME_STATE


A.3. destruction
A.3.1 normal
                        ANY_STATE
          |---CLOSE_CHILD-->|
          |<----CLOSING-----|
                          DYING
          |<-- SIG_CHLD
     delete_child()

A.3.2 fatal error
                        ANY_STATE
          |<-----ERROR------| (fatal_err,"reason")
          |<---SIG_CHLD
     delete_child()

A.3.3 crash
                        ANY_STATE
          |<---SIG_CHLD
     delete_child()



A.4. getting current dir
                        ANY_STATE
          |-------PWD------>|
          |<------CWD-------| (dirname)
                        SAME_STATE


A.5. changing current dir
A.5.1 dir changed ok
                        ANY_STATE
          |------CHDIR----->| (dirname)
          |<------CWD-------| (dirname)
                        SAME_STATE
A.5.2 dir changed ko
                        ANY_STATE
          |------CHDIR----->| (dirname)
          |<-----ERROR------| (cannot_cd, "reason")
                        SAME_STATE

A.6. listing current directory
A.6.1 file list ok
                        ANY_STATE
          |----LIST_FILES-->| ("*.*"")
          |<---FILE_INFO----| (filename, format,  encap, num_pkts, ...);
          |<---FILE_INFO----| (filename, format,  encap, num_pkts, ...);
          .....
          |<---FILE_INFO----| (filename, format,  encap, num_pkts, ...);
                        SAME_STATE
A.6.2 file list ko
                        ANY_STATE
          |----LIST_FILES-->| ("*.*"")
          |<-----ERROR------| (no_files, "reason")
                        SAME_STATE


A.7. opening a file
A.7.1 opened ok
                            IDLE
          |----OPEN_FILE---->| (filename, ...)
          |<---FILE_OPENED---| (dirname)
                          READING
A.7.2 not opened
                            IDLE
          |----OPEN_FILE---->| (filename, ...)
          |<-----ERROR-------| (cannot_open, "reason")
                            IDLE


A.8. saving a file
A.8.1 save ok
                    READING/CAPTURING/DONE
          |-----SAVE_FILE---->| ("new_filename",opts,...)
          |<----FILE_SAVED----| (24, tree)
                          SAME_STATE

A.8.1 save ko
                    READING/CAPTURING/DONE
          |-----SAVE_FILE---->| ("new_filename",opts,...)
          |<------ERROR-------| (cannot_save, "reason")
                          SAME_STATE


A.9. listing interfaces
A.9.1 intf list ok
                              IDLE
          |--LIST_INTERFACES-->| ("*.*"")
          |                    |-------????------>|
          |                    |<------????-------|
          |<--INTERFACE_INFO---| (name, param1=val1, ...)
          |<--INTERFACE_INFO---| (name, param1=val1, ...)
          .....
          |<--INTERFACE_INFO---| (name, param1=val1, ...)
                              IDLE
A.9.2 intf list ko
          |--LIST_INTERFACES-->| ("*.*"")
          |                    |-------????------>|
          |                    |<------????-------|
          |<------ERROR-------| (list_intf, "reason")


A.10. opening an interface
A.10.1 interface opened ok
                              IDLE
          |---OPEN_INTERFACE-->|
          |                    |-------????------>|
          |                    |<------????-------|
          |<--INTERFACE_OPENED-|
                              READY

A.10.2 interface open failure
                              IDLE
          |--OPEN_INTERFACE--->|
          |                    |-------????------>|
          |                    |<------????-------|
          |<-------ERROR-------| (intf, "reason")
                              IDLE


A.11. starting capture
A.11.1 started capture ok
                             READY
          |---START_CAPTURE--->|
          |                    |-------????------>|
          |                    |<------????-------|
          |<-CAPTURE_STARTED---|
                             IN_CAPTURE
A.11.2 capture start failure
                             READY
          |----START_CAPTURE-->|
          |                    |-------????------>|
          |                    |<------????-------|
          |<-------ERROR-------| (cannot_start, "reason")
                             READY

A.12. capturing or reading
                       IN_CAPTURE/READING
          |                    |<------????-------|
          |<----PACKET_SUM-----| (framenum, columns)
                          IN_CAPTURE

A.13 getting packet details
A.13.1 just frame
                       IN_CAPTURE/READING
          |----GET_PACKETS--->| (framelist)
          |<-----PACKET-------| (1, tree)
          |<-----BUFFER-------| ("1", tvb)
          |<-----PACKET-------| (2, tree)
          |<-----BUFFER-------| ("2", tvb)
                          SAME_STATE

A.13.2 frame with reassembled buffer
                       IN_CAPTURE/READING/DONE
          |----GET_PACKETS--->| (framelist)
          |<-----PACKET-------| (framenum, tree)
          |<-----BUFFER-------| ("framenum", tvb)
          |<-----BUFFER-------| ("reas_num", tvb)
                          SAME_STATE


A.13.3 frame with known reassembled buffer
                       IN_CAPTURE/READING/DONE
          |<-----PACKET-------| (framenum+N, tree)
          |<-----BUFFER-------| ("framenum+N", tvb)
          |<-----BUFFER-------| ("reas_num", NULL)
                          SAME_STATE

A.13.4 buffer request (e.g. un-cached buffer)
                       IN_CAPTURE/READING/DONE
          |------GET_BUF----->| (bufname)
          |<-----BUFFER-------| (bufname, NULL)
                          SAME_STATE

A.14 stpping capture
                          IN_CAPTURE
          |---STOP_CAPTURE--->|
          |<-CAPTURE_STOPPED--|
                             DONE


A.15. done reading
                            READING
                               |<-- EOF
          |<--------EOF--------|
                             DONE

A.16 setting a note
A.16.1 note set ok
                       IN_CAPTURE/READING/DONE
          |----ADD_NOTE------>| (framenum,note)
          |<----NOTE_ADDED----|
                          SAME_STATE
A.16.2 note set failure
                       IN_CAPTURE/READING/DONE
          |----ADD_NOTE------>| (framenum,note)
          |<----NOTE_ADDED----|
                          SAME_STATE

A.17 applying a filter
                       IN_CAPTURE/READING/DONE
          |---APPLY_FILTER--->| (dfilter_str)
          |<---PACKET_LIST----| (Packet-Range)
          |<---PACKET_LIST----| (Packet-Range)
                          SAME_STATE


A.18 setting a filter
                             IDLE
          |-----SET_FILTER---->| (dfilter_str)
          |<---FILTER_SET------|
                             IDLE