2 * common functions of ECHLD
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * Copyright (c) 2013 by Luis Ontanon <luis@ontanon.org>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include "echld-int.h"
31 static int dbg_level
= DEBUG_BASE
;
33 static const char* dbg_prefix
;
35 static void common_dbg(int level
, const char* fmt
, ...) {
39 if (level
> dbg_level
) return;
42 g_vsnprintf(str
,1024,fmt
,ap
);
46 fprintf(dbg_fp
,"%s: level=%d msg='%s'\n",dbg_prefix
,level
,str
);
51 extern void echld_common_set_dbg(int level
, FILE* fp
, const char* prefix
) {
56 #define DBG(attrs) ( common_dbg attrs )
68 static struct _st_map st_map
[] = {
70 { CREATING
, "CREATING"},
73 { READING
, "READING"},
74 { CAPTURING
, "CAPTURING"},
76 { CLOSING
, "CLOSING"},
78 { ERRORED
, "ERRORED"},
82 const char* echld_state_str(child_state_t id
) {
85 for (;st_map
[i
].str
;i
++) {
86 if (id
== st_map
[i
].id
) return st_map
[i
].str
;
95 echld_msg_type_t type
;
99 static struct _t_map t_map
[] = {
100 {ECHLD_ERROR
,"ERROR"},
101 {ECHLD_TIMED_OUT
,"TIMED_OUT"},
102 {ECHLD_NEW_CHILD
,"NEW_CHILD"},
103 {ECHLD_HELLO
,"HELLO"},
104 {ECHLD_CHILD_DEAD
,"CHILD_DEAD"},
105 {ECHLD_CLOSE_CHILD
,"CLOSE_CHILD"},
106 {ECHLD_CLOSING
,"CLOSING"},
107 {ECHLD_SET_PARAM
,"SET_PARAM"},
108 {ECHLD_GET_PARAM
,"GET_PARAM"},
109 {ECHLD_PARAM
,"PARAM"},
112 {ECHLD_OPEN_FILE
,"OPEN_FILE"},
113 {ECHLD_FILE_OPENED
,"FILE_OPENED"},
114 {ECHLD_OPEN_INTERFACE
,"OPEN_INTERFACE"},
115 {ECHLD_INTERFACE_OPENED
,"INTERFACE_OPENED"},
116 {ECHLD_START_CAPTURE
,"START_CAPTURE"},
117 {ECHLD_CAPTURE_STARTED
,"CAPTURE_STARTED"},
118 {ECHLD_NOTIFY
,"NOTIFY"},
119 {ECHLD_GET_SUM
,"GET_SUM"},
120 {ECHLD_PACKET_SUM
,"PACKET_SUM"},
121 {ECHLD_GET_TREE
,"GET_TREE"},
123 {ECHLD_GET_BUFFER
,"GET_BUFFER"},
124 {ECHLD_BUFFER
,"BUFFER"},
126 {ECHLD_STOP_CAPTURE
,"STOP_CAPTURE"},
127 {ECHLD_CAPTURE_STOPPED
,"CAPTURE_STOPPED"},
128 {ECHLD_ADD_NOTE
,"ADD_NOTE"},
129 {ECHLD_NOTE_ADDED
,"NOTE_ADDED"},
130 {ECHLD_APPLY_FILTER
,"APPLY_FILTER"},
131 {ECHLD_PACKET_LIST
,"PACKET_LIST"},
132 {ECHLD_SAVE_FILE
,"SAVE_FILE"},
133 {ECHLD_FILE_SAVED
,"FILE_SAVED"},
137 const char* echld_msg_type_str(echld_msg_type_t id
) {
140 for (;t_map
[i
].str
;i
++) {
141 if (id
== t_map
[i
].type
) return t_map
[i
].str
;
149 the "epan pipe" protocol
152 typedef void (*reader_realloc_t
)(echld_reader_t
*, size_t);
154 static void child_realloc_buff(echld_reader_t
* r
, size_t needed
) {
155 size_t a
= r
->actual_len
;
157 long rp_off
= r
->rp
- r
->data
;
159 DBG((2,"REALLOC BUFF needed=%d",needed
));
161 if ( a
< (s
+ needed
) ) {
162 guint8
* data
= r
->data
;
166 } while( a
< (s
+ needed
) );
168 data
= (guint8
*)g_realloc(data
,a
);
174 r
->rp
= data
+ rp_off
;
178 static reader_realloc_t reader_realloc_buff
= child_realloc_buff
;
180 #ifdef PARENT_THREADS
181 static void parent_realloc_buff(echld_reader_t
* b
, size_t needed
) {
182 // parent thread: obtain malloc mutex
183 child_realloc_buff(b
,needed
);
184 // parent thread: release malloc mutex
190 void echld_reset_reader(echld_reader_t
* r
, int fd
, size_t initial
) {
192 fcntl(fd
, F_SETFL
, O_NONBLOCK
);
194 if (r
->data
== NULL
) {
195 r
->actual_len
= initial
;
196 r
->data
=(guint8
*) g_malloc0(initial
);
207 void echld_init_reader(echld_reader_t
* r
, int fd
, size_t initial
) {
208 echld_reset_reader(r
,fd
,initial
);
213 void free_reader(echld_reader_t
* r
) {
217 static long reader_readv(echld_reader_t
* r
, size_t len
) {
221 DBG((2,"READV needed=%d",len
));
223 if ( (r
->actual_len
- r
->len
) < len
)
224 reader_realloc_buff(r
, len
);
226 iov
.iov_base
= r
->wp
;
229 nread
= readv(r
->fd
, &iov
, 1);
231 DBG((2,"READV nread=%d msg='%s'",nread
, (nread
<0) ? strerror(errno
) : "-" ));
238 if (errno
== EAGAIN
) return 0;
244 long echld_read_frame(echld_reader_t
* r
, read_cb_t cb
, void* cb_data
) {
245 DBG((4,"READ = echld_read_frame fd=%d",r
->fd
));
247 // it will use shared memory instead of inband communication
249 hdr_t
* h
= (hdr_t
*)r
->rp
;
254 DBG((5,"READ reader_len=%d",r
->len
));
256 if ( r
->len
< ECHLD_HDR_LEN
) {
257 /* read the header */
258 goto incomplete_header
;
259 } else if ( ! reader_has_frame(r
) ) {
260 /* read the (rest of) the frame */
261 goto incomplete_frame
;
264 DBG((5,"READ we've got a frame! fr_len=%d ch=%d t='%c' rh=%d",fr_len
, h
->h
.chld_id
, HDR_TYPE(h
), h
->h
.reqh_id
));
267 cb( &(r
->rp
[sizeof(hdr_t
)]), HDR_LEN(h
), h
->h
.chld_id
, HDR_TYPE(h
), h
->h
.reqh_id
, cb_data
);
273 DBG((5,"READ consumed frame!"));
278 missing
= ECHLD_HDR_LEN
- (r
->len
);
279 DBG((5,"READ incomplete_header missing=%d",missing
));
281 nread
= reader_readv(r
,missing
);
284 if (nread
< 0 && errno
!= EAGAIN
) {
286 } else if (nread
< (long)missing
) {
289 goto incomplete_frame
;
293 fr_len
= HDR_LEN(h
) + ECHLD_HDR_LEN
;
294 missing
= fr_len
- r
->len
;
296 DBG((5,"READ incomplete_frame fr_len=%d missing=%d",fr_len
,missing
));
299 nread
= reader_readv(r
,missing
);
301 if (nread
< 0 && errno
!= EAGAIN
) {
303 } else if (nread
< (long)missing
) {
310 DBG((1,"READ incomplete_frame Cannot happen"));
317 long echld_write_frame(int fd
, GByteArray
* ba
, guint16 chld_id
, echld_msg_type_t type
, guint16 reqh_id
, void* data _U_
) {
323 h
.h
.type_len
= (type
<<24) | ((ba
?ba
->len
:0) & 0x00ffffff) ;
324 h
.h
.chld_id
= chld_id
;
325 h
.h
.reqh_id
= reqh_id
;
327 iov
[0].iov_base
= &h
;
330 if ( ba
&& ba
->len
> 0 ) {
331 iov
[1].iov_base
= ba
->data
;
332 iov
[1].iov_len
= ba
->len
;
336 return (long) writev(fd
, iov
, iov_cnt
);
339 /* paramset management */
341 param_t
* paramset_find (param_t
* paramsets
, char* name
, char** err
) {
343 for (i
= 0; paramsets
[i
].name
!= NULL
;i
++) {
344 if (strcmp(name
,paramsets
[i
].name
) == 0 ) return &(paramsets
[i
]);
347 *err
= g_strdup_printf("Could not find param='%s'",name
);
351 echld_bool_t
paramset_apply_set (param_t
* paramsets
, char* name
, char* val
, char** err
) {
352 param_t
* p
= paramset_find(paramsets
,name
,err
);
354 if ( !p
) return FALSE
;
356 *err
= g_strdup_printf("Cannot set RO param='%s'",name
);
360 return p
->set(val
,err
);
363 char* paramset_apply_get (param_t
* paramsets
, char* name
, char** err
) {
364 param_t
* p
= paramset_find(paramsets
,name
,err
);
366 if ( !p
) return NULL
;
369 *err
= g_strdup_printf("Cannot get WO param='%s'",name
);
376 echld_bool_t
paramset_apply_em(param_t
* paramset
, enc_msg_t
* em
, char** err
) {
377 GByteArray
* ba
= (GByteArray
*)em
;
378 char* p
= (char*) ba
->data
;
379 int tot_len
= ba
->len
;
381 p
[rem
-1] = '\0'; /* make sure last char is null */
385 long param_len
= strlen(param
)+1;
386 char* value
= p
+ param_len
;
392 *err
= g_strdup_printf("Malformed msg param len invalid");
396 value_len
= strlen(value
)+1;
399 p
= value
+ value_len
;
402 *err
= g_strdup_printf("Malformed msg value len invalid");
406 if (! paramset_apply_set(paramset
,param
,value
,err
))
413 char* paramset_get_params_list(param_t
* paramsets
,const char* fmt
) {
414 param_t
* p
= paramsets
;
415 GString
* str
= g_string_new("");
419 g_string_append_printf(str
,fmt
,
421 ((p
->get
&& p
->set
)?"rw":(p
->get
?"ro":"wo")),
426 g_string_free(str
,FALSE
);
433 /* encoders and decoders */
439 /* binary encoders and decoders used for parent->child communication */
441 static enc_msg_t
* str_enc(const char* s
) {
442 GByteArray
* ba
= g_byte_array_new();
443 g_byte_array_append(ba
,s
,(guint
)(strlen(s
)+1));
444 return (enc_msg_t
*)ba
;
447 static gboolean
str_dec(guint8
* b
, size_t bs
, char** text
) {
449 b
[bs
-1] = '\0'; /* null terminate the buffer to avoid strlen running */
451 if (b
+(strlen(b
)+1) > end
) return FALSE
;
455 static gboolean
str_deca(enc_msg_t
* ba
, char** text
) {
456 return str_dec(ba
->data
,ba
->len
,text
);
459 static enc_msg_t
* int_str_enc(int i
, const char* s
) {
460 GByteArray
* ba
= g_byte_array_new();
461 g_byte_array_append(ba
,(guint8
*)&i
,sizeof(int));
462 g_byte_array_append(ba
,s
,(guint
)(strlen(s
)+1));
463 return (enc_msg_t
*)ba
;
466 static gboolean
int_str_dec(guint8
* b
, size_t bs
, int* ip
, char** text
) {
468 b
[bs
-1] = '\0'; /* null terminate the buffer to avoid strlen running */
470 if ((sizeof(int)) > bs
) return FALSE
;
474 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
479 static gboolean
int_str_deca(enc_msg_t
* ba
, int* ip
, char** text
) {
480 return int_str_dec(ba
->data
,ba
->len
,ip
,text
);
483 static enc_msg_t
* int_enc(int i
) {
484 GByteArray
* ba
= g_byte_array_new();
485 g_byte_array_append(ba
,(guint8
*)&i
,sizeof(int));
486 return (enc_msg_t
*)ba
;
489 static gboolean
int_dec(guint8
* b
, size_t bs
, int* ip
) {
490 if ((sizeof(int)) > bs
) return FALSE
;
495 static gboolean
int_deca(enc_msg_t
* ba
, int* ip
) {
496 return int_dec(ba
->data
,ba
->len
,ip
);
499 static enc_msg_t
* x2str_enc(const char* s1
, const char* s2
) {
500 GByteArray
* ba
= g_byte_array_new();
501 g_byte_array_append(ba
,s1
,(guint
)(strlen(s1
)+1));
502 g_byte_array_append(ba
,s2
,(guint
)(strlen(s2
)+1));
503 return (enc_msg_t
*)ba
;
506 static gboolean
x2str_dec(guint8
* b
, size_t blen
, char** str1
, char** str2
) {
507 guint8
* end
= b
+blen
;
508 b
[blen
-1] = '\0'; /* null terminate the buffer to avoid strlen running */
511 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
513 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
517 static gboolean
x2str_deca(enc_msg_t
* ba
, char** str1
, char** str2
) {
518 return x2str_dec(ba
->data
,ba
->len
,str1
,str2
);
521 static gboolean
int_3str_dec (guint8
* b
, size_t len
, int* i
, char** s1
, char** s2
, char** s3
) {
525 if ((sizeof(int)) > len
) return FALSE
;
530 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
532 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
534 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
538 static enc_msg_t
* int_3str_enc(int i
, const char* s1
, const char* s2
, const char* s3
) {
539 GByteArray
* ba
= g_byte_array_new();
540 g_byte_array_append(ba
,(guint8
*)&i
,sizeof(int));
541 g_byte_array_append(ba
,s1
,(guint
)(strlen(s1
)+1));
542 g_byte_array_append(ba
,s2
,(guint
)(strlen(s2
)+1));
543 g_byte_array_append(ba
,s3
,(guint
)(strlen(s3
)+1));
544 return (enc_msg_t
*)ba
;
547 static gboolean
int_3str_deca (enc_msg_t
* e
, int* i
, char** s1
, char** s2
, char** s3
) {
548 return int_3str_dec(e
->data
,e
->len
,i
,s1
,s2
,s3
);
551 static gboolean
x3str_dec (guint8
* b
, size_t len
, char** s1
, char** s2
, char** s3
) {
557 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
559 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
561 if ((b
+= (strlen(b
)+1)) > end
) return FALSE
;
565 static gboolean
x3str_deca (enc_msg_t
* e
, char** s1
, char** s2
, char** s3
) {
566 return x3str_dec(e
->data
,e
->len
,s1
,s2
,s3
);
570 static enc_msg_t
* x3str_enc(const char* s1
, const char* s2
, const char* s3
) {
571 GByteArray
* ba
= g_byte_array_new();
572 g_byte_array_append(ba
,s1
,(guint
)(strlen(s1
)+1));
573 g_byte_array_append(ba
,s2
,(guint
)(strlen(s2
)+1));
574 g_byte_array_append(ba
,s3
,(guint
)(strlen(s3
)+1));
575 return (enc_msg_t
*)ba
;
578 static echld_parent_encoder_t parent_encoder
= {
593 echld_parent_encoder_t
* echld_get_encoder(void) {
594 return &parent_encoder
;
597 static child_decoder_t child_decoder
= {
612 static child_encoder_t child_encoder
= {
623 static parent_decoder_t parent_decoder
= {
634 void echld_get_all_codecs( child_encoder_t
**e
, child_decoder_t
**d
, echld_parent_encoder_t
**pe
, parent_decoder_t
** pd
) {
635 e
&& (*e
= &child_encoder
);
636 d
&& (*d
= &child_decoder
);
637 pe
&& (*pe
= &parent_encoder
);
638 pd
&& (*pd
= &parent_decoder
);
643 /* output encoders, used in the switch */
646 static char* packet_summary_json(GByteArray
* ba _U_
) {
648 return g_strdup("{type='packet_summary', packet_summary={}");
651 static char* tree_json(GByteArray
* ba _U_
) {
653 return g_strdup("{type='tree', tree={}");
656 char* tvb_json(GByteArray
* ba _U_
, tvb_t
* tvb _U_
, const char* name
) {
658 return g_strdup_printf("{type='buffer', buffer={name='%s', range='0-2', data=[0x12,0xff] }",name
);
661 static char* error_json(GByteArray
* ba
) {
662 char* s
= (char*)(ba
->data
+ sizeof(int));
665 s
= g_strdup_printf("{type='error', error={errnum=%d, message='%s'}}",i
,s
);
670 static char* child_dead_json(GByteArray
* ba
) {
671 char* s
= (char*)(ba
->data
+ sizeof(int));
674 s
= g_strdup_printf("{type='child_dead', child_dead={childnum=%d, message='%s'}}",i
,s
);
679 static char* closing_json(GByteArray
* ba
) {
680 char* s
= (char*)(ba
->data
);
681 s
= g_strdup_printf("{type='closing', closing={reason='%s'}}",s
);
688 static char* note_added_json(GByteArray
* ba
) {
689 char* s
= (char*)(ba
->data
);
690 s
= g_strdup_printf("{ type='note_added', note_added={msg='%s'}}",s
);
695 static char* packet_list_json(GByteArray
* ba _U_
) {
696 return g_strdup("{}");
699 static char* file_saved_json(GByteArray
* ba
) {
700 char* s
= (char*)(ba
->data
);
702 s
= g_strdup_printf("{ type='file_saved', file_saved={msg='%s'}}",s
);
709 static char* param_set_json(GByteArray
* ba
) {
710 char* s1
= (char*)(ba
->data
);
711 char* s2
= ((char*)(ba
->data
)) + strlen(s1
);
713 s1
= g_strdup_printf("{type='param_set', param_set={param='%s' value='%s'}}",s1
,s2
);
719 static char* set_param_json(GByteArray
* ba
) {
720 char* s1
= (char*)(ba
->data
);
721 char* s2
= ((char*)(ba
->data
)) + strlen(s1
);
723 s1
= g_strdup_printf("{type='set_param', set_param={param='%s' value='%s'}}",s1
,s2
);
729 static char* get_param_json(GByteArray
* ba
) {
730 char* s1
= (char*)(ba
->data
);
732 s1
= g_strdup_printf("{type='get_param', get_param={param='%s'}}",s1
);
738 static char* file_opened_json(GByteArray
* ba _U_
) {
742 static char* open_file_json(GByteArray
* ba _U_
) {
746 static char* open_interface_json(GByteArray
* ba _U_
) {
751 static char* interface_opened_json(GByteArray
* ba _U_
) {
755 static char* notify_json(GByteArray
* ba _U_
) {
759 static char* get_tree_json(GByteArray
* ba _U_
) {
763 static char* get_sum_json(GByteArray
* ba _U_
) {
767 static char* get_buffer_json(GByteArray
* ba _U_
) {
771 static char* buffer_json(GByteArray
* ba _U_
) {
775 static char* add_note_json(GByteArray
* ba _U_
) {
779 static char* apply_filter_json(GByteArray
* ba _U_
) {
783 static char* save_file_json(GByteArray
* ba _U_
) {
788 /* this to be used only at the parent */
789 static char* decode_json(echld_msg_type_t type
, enc_msg_t
* m
) {
790 GByteArray
* ba
= (GByteArray
*)m
;
793 case ECHLD_ERROR
: return error_json(ba
);
794 case ECHLD_TIMED_OUT
: return g_strdup("{type='timed_out'}");
795 case ECHLD_NEW_CHILD
: return g_strdup("{type='new_child'}");
796 case ECHLD_HELLO
: return g_strdup("{type='helo'}");
797 case ECHLD_CHILD_DEAD
: return child_dead_json(ba
);
798 case ECHLD_CLOSE_CHILD
: return g_strdup("{type='close_child'}");
799 case ECHLD_CLOSING
: return closing_json(ba
);
800 case ECHLD_SET_PARAM
: return set_param_json(ba
);
801 case ECHLD_GET_PARAM
: return get_param_json(ba
);
802 case ECHLD_PARAM
: return param_set_json(ba
);
803 case ECHLD_PING
: return g_strdup("{type='ping'}");
804 case ECHLD_PONG
: return g_strdup("{type='pong'}");
805 case ECHLD_OPEN_FILE
: return open_file_json(ba
);
806 case ECHLD_FILE_OPENED
: return file_opened_json(ba
);
807 case ECHLD_OPEN_INTERFACE
: return open_interface_json(ba
);
808 case ECHLD_INTERFACE_OPENED
: return interface_opened_json(ba
);
809 case ECHLD_START_CAPTURE
: return g_strdup("{type='start_capture'}");
810 case ECHLD_CAPTURE_STARTED
: return g_strdup("{type='capture_started'}");
811 case ECHLD_NOTIFY
: return notify_json(ba
);
812 case ECHLD_GET_SUM
: return get_sum_json(ba
);
813 case ECHLD_PACKET_SUM
: return packet_summary_json(ba
);
814 case ECHLD_GET_TREE
: return get_tree_json(ba
);
815 case ECHLD_TREE
: return tree_json(ba
);
816 case ECHLD_GET_BUFFER
: return get_buffer_json(ba
);
817 case ECHLD_BUFFER
: return buffer_json(ba
);
818 case ECHLD_EOF
: return g_strdup("{type='eof'}");
819 case ECHLD_STOP_CAPTURE
: return g_strdup("{type='stop_capture'}");
820 case ECHLD_CAPTURE_STOPPED
: return g_strdup("{type='capture_stopped'}");
821 case ECHLD_ADD_NOTE
: return add_note_json(ba
);
822 case ECHLD_NOTE_ADDED
: return note_added_json(ba
);
823 case ECHLD_APPLY_FILTER
: return apply_filter_json(ba
);
824 case ECHLD_PACKET_LIST
: return packet_list_json(ba
);
825 case ECHLD_SAVE_FILE
: return save_file_json(ba
);
826 case ECHLD_FILE_SAVED
: return file_saved_json(ba
);
827 case EC_ACTUAL_ERROR
: return g_strdup("{type='actual_error'}");
833 char* echld_decode(echld_msg_type_t t
, enc_msg_t
* m
) {
834 return decode_json(t
,m
);
839 extern void dummy_switch(echld_msg_type_t type
) {
841 case ECHLD_ERROR
: break; //
842 case ECHLD_TIMED_OUT
: break;
843 case ECHLD_NEW_CHILD
: break;
844 case ECHLD_HELLO
: break;
845 case ECHLD_CHILD_DEAD
: break; //S msg
846 case ECHLD_CLOSE_CHILD
: break;
847 case ECHLD_CLOSING
: break; //
848 case ECHLD_SET_PARAM
: break;
849 case ECHLD_GET_PARAM
: break;
850 case ECHLD_PARAM
: break; //SS param,val
851 case ECHLD_PING
: break;
852 case ECHLD_PONG
: break; //
853 case ECHLD_OPEN_FILE
: break;
854 case ECHLD_FILE_OPENED
: break; //
855 case ECHLD_OPEN_INTERFACE
: break;
856 case ECHLD_INTERFACE_OPENED
: break; //
857 case ECHLD_START_CAPTURE
: break;
858 case ECHLD_CAPTURE_STARTED
: break; //
859 case ECHLD_NOTIFY
: break; //S notification (pre-encoded)
860 case ECHLD_GET_SUM
: break;
861 case ECHLD_PACKET_SUM
: break; //S (pre-encoded)
862 case ECHLD_GET_TREE
: break;
863 case ECHLD_TREE
: break; //IS framenum,tree (pre-encoded)
864 case ECHLD_GET_BUFFER
: break;
865 case ECHLD_BUFFER
: break; //SSIS name,range,totlen,data
866 case ECHLD_EOF
: break; //
867 case ECHLD_STOP_CAPTURE
: break;
868 case ECHLD_CAPTURE_STOPPED
: break; //
869 case ECHLD_ADD_NOTE
: break;
870 case ECHLD_NOTE_ADDED
: break; //IS
871 case ECHLD_APPLY_FILTER
: break;
872 case ECHLD_PACKET_LIST
: break; //SS name,range
873 case ECHLD_SAVE_FILE
: break;
874 case ECHLD_FILE_SAVED
: break;
875 case EC_ACTUAL_ERROR
: break;
879 case ECHLD_NEW_CHILD
: break;
880 case ECHLD_CLOSE_CHILD
: break;
881 case ECHLD_SET_PARAM
: break; // set_param(p,v)
882 case ECHLD_GET_PARAM
: break; // get_param(p)
883 case ECHLD_PING
: break;
884 case ECHLD_OPEN_FILE
: break; // open_file(f,mode)
885 case ECHLD_OPEN_INTERFACE
: break; // open_interface(if,param)
886 case ECHLD_START_CAPTURE
: break;
887 case ECHLD_GET_SUM
: break; // get_sum(rng)
888 case ECHLD_GET_TREE
: break; // get_tree(rng)
889 case ECHLD_GET_BUFFER
: break; // get_buffer(rng)
890 case ECHLD_STOP_CAPTURE
: break;
891 case ECHLD_ADD_NOTE
: break; // add_note(framenum,note)
892 case ECHLD_APPLY_FILTER
: break; // apply_filter(df)
893 case ECHLD_SAVE_FILE
: break; // save_file(f,mode)
896 case ECHLD_ERROR
: break; // error(err,reason)
897 case ECHLD_TIMED_OUT
: break;
898 case ECHLD_HELLO
: break;
899 case ECHLD_CHILD_DEAD
: break; // child_dead(msg)
900 case ECHLD_CLOSING
: break;
901 case ECHLD_PARAM
: break;
902 case ECHLD_PONG
: break;
903 case ECHLD_FILE_OPENED
: break;
904 case ECHLD_INTERFACE_OPENED
: break;
905 case ECHLD_CAPTURE_STARTED
: break;
906 case ECHLD_NOTIFY
: break; // notify(pre-encoded)
907 case ECHLD_PACKET_SUM
: break; // packet_sum(pre-encoded)
908 case ECHLD_TREE
: break; //tree(framenum, tree(pre-encoded) )
909 case ECHLD_BUFFER
: break; // buffer (name,range,totlen,data)
910 case ECHLD_EOF
: break;
911 case ECHLD_CAPTURE_STOPPED
: break;
912 case ECHLD_NOTE_ADDED
: break;
913 case ECHLD_PACKET_LIST
: break; // packet_list(name,filter,range);
914 case ECHLD_FILE_SAVED
: break;
916 case EC_ACTUAL_ERROR
: break;
920 static void* unused
= int_deca
;
922 extern void unused_things(void) {