@@ -78,7 +78,7 @@ enum params_xml_nodes {
7878/** Definition of the \<params\> node */
7979static const struct fds_xml_args args_params [] = {
8080 FDS_OPTS_ROOT ("params" ),
81- FDS_OPTS_ELEM (NODE_TRAP_IFC_TYPE , "trapIfcType" , FDS_OPTS_T_INT , 0 ),
81+ FDS_OPTS_ELEM (NODE_TRAP_IFC_TYPE , "trapIfcType" , FDS_OPTS_T_STRING , 0 ),
8282 FDS_OPTS_ELEM (NODE_TRAP_IFC_SOCKET , "trapIfcSocket" , FDS_OPTS_T_STRING , 0 ),
8383 FDS_OPTS_ELEM (NODE_TRAP_IFC_TIMEOUT , "trapIfcTimeout" , FDS_OPTS_T_STRING , 0 ),
8484 FDS_OPTS_ELEM (NODE_TRAP_IFC_FLUSH_TIMEOUT , "trapIfcFlushTimeout" , FDS_OPTS_T_STRING , 0 ),
@@ -129,8 +129,20 @@ configuration_parse_root(ipx_ctx_t *ctx, fds_xml_ctx_t *root, struct conf_params
129129 while (fds_xml_next (root , & content ) != FDS_EOC ) {
130130 switch (content -> id ) {
131131 case NODE_TRAP_IFC_TYPE :
132- assert (content -> type == FDS_OPTS_T_INT );
133- cnf -> trap_ifc_type = content -> val_int ;
132+ assert (content -> type == FDS_OPTS_T_STRING );
133+ if (strcmp (content -> ptr_string , "UNIXSOCKET" ) == 0 ) {
134+ cnf -> trap_ifc_type = 'u' ;
135+ } else if (strcmp (content -> ptr_string , "TCP" ) == 0 ) {
136+ cnf -> trap_ifc_type = 't' ;
137+ } else if (strcmp (content -> ptr_string , "TLS" ) == 0 ) {
138+ cnf -> trap_ifc_type = 'T' ;
139+ } else if (strcmp (content -> ptr_string , "FILE" ) == 0 ) {
140+ cnf -> trap_ifc_type = 'f' ;
141+ } else if (strcmp (content -> ptr_string , "BLACKHOLE" ) == 0 ) {
142+ cnf -> trap_ifc_type = 'b' ;
143+ } else {
144+ IPX_CTX_ERROR (ctx , "Unsupported trapIfcType." );
145+ }
134146 break ;
135147 case NODE_TRAP_IFC_SOCKET :
136148 assert (content -> type == FDS_OPTS_T_STRING );
0 commit comments