parser/sdp: more suggestive debug message
[sip-router] / events.c
index fccfd1c..d26ae9b 100644 (file)
--- a/events.c
+++ b/events.c
@@ -81,6 +81,31 @@ int sr_event_register_cb(int type, sr_event_cb_f f)
                                        _sr_events_list.pkg_set_real_used = f;
                                else return -1;
                        break;
+               case SREV_NET_DGRAM_IN:
+                               if(_sr_events_list.net_dgram_in==0)
+                                       _sr_events_list.net_dgram_in = f;
+                               else return -1;
+                       break;
+               case SREV_TCP_HTTP_100C:
+                               if(_sr_events_list.tcp_http_100c==0)
+                                       _sr_events_list.tcp_http_100c = f;
+                               else return -1;
+                       break;
+               case SREV_TCP_MSRP_FRAME:
+                               if(_sr_events_list.tcp_msrp_frame==0)
+                                       _sr_events_list.tcp_msrp_frame = f;
+                               else return -1;
+                       break;
+               case SREV_TCP_WS_FRAME_IN:
+                               if(_sr_events_list.tcp_ws_frame_in==0)
+                                       _sr_events_list.tcp_ws_frame_in = f;
+                               else return -1;
+                       break;
+               case SREV_TCP_WS_FRAME_OUT:
+                               if(_sr_events_list.tcp_ws_frame_out==0)
+                                       _sr_events_list.tcp_ws_frame_out = f;
+                               else return -1;
+                       break;
                default:
                        return -1;
        }
@@ -154,6 +179,36 @@ int sr_event_exec(int type, void *data)
                                        ret = _sr_events_list.pkg_set_real_used(data);
                                        return ret;
                                } else return 1;
+               case SREV_NET_DGRAM_IN:
+                               if(unlikely(_sr_events_list.net_dgram_in!=0))
+                               {
+                                       ret = _sr_events_list.net_dgram_in(data);
+                                       return ret;
+                               } else return 1;
+               case SREV_TCP_HTTP_100C:
+                               if(unlikely(_sr_events_list.tcp_http_100c!=0))
+                               {
+                                       ret = _sr_events_list.tcp_http_100c(data);
+                                       return ret;
+                               } else return 1;
+               case SREV_TCP_MSRP_FRAME:
+                               if(unlikely(_sr_events_list.tcp_msrp_frame!=0))
+                               {
+                                       ret = _sr_events_list.tcp_msrp_frame(data);
+                                       return ret;
+                               } else return 1;
+               case SREV_TCP_WS_FRAME_IN:
+                               if(unlikely(_sr_events_list.tcp_ws_frame_in!=0))
+                               {
+                                       ret = _sr_events_list.tcp_ws_frame_in(data);
+                                       return ret;
+                               } else return 1;
+               case SREV_TCP_WS_FRAME_OUT:
+                               if(unlikely(_sr_events_list.tcp_ws_frame_out!=0))
+                               {
+                                       ret = _sr_events_list.tcp_ws_frame_out(data);
+                                       return ret;
+                               } else return 1;
                default:
                        return -1;
        }
@@ -177,6 +232,16 @@ int sr_event_enabled(int type)
                                return (_sr_events_list.pkg_set_used!=0)?1:0;
                case SREV_PKG_SET_REAL_USED:
                                return (_sr_events_list.pkg_set_real_used!=0)?1:0;
+               case SREV_NET_DGRAM_IN:
+                               return (_sr_events_list.net_dgram_in!=0)?1:0;
+               case SREV_TCP_HTTP_100C:
+                               return (_sr_events_list.tcp_http_100c!=0)?1:0;
+               case SREV_TCP_MSRP_FRAME:
+                               return (_sr_events_list.tcp_msrp_frame!=0)?1:0;
+               case SREV_TCP_WS_FRAME_IN:
+                               return (_sr_events_list.tcp_ws_frame_in!=0)?1:0;
+               case SREV_TCP_WS_FRAME_OUT:
+                               return (_sr_events_list.tcp_ws_frame_out!=0)?1:0;
        }
        return 0;
 }