@@ -11,6 +11,11 @@ exports.TCPTracker = tcp_tracker.TCPTracker;
1111exports . TCPSession = tcp_tracker . TCPSession ;
1212exports . DNSCache = DNSCache ;
1313
14+ // This may be overriden by the user
15+ exports . warningHandler = function warningHandler ( x ) {
16+ console . warn ( 'warning: %s - this may not actually work' , x ) ;
17+ } ;
18+
1419function PcapSession ( is_live , device_name , filter , buffer_size , snap_length , outfile , is_monitor , buffer_timeout ) {
1520this . is_live = is_live ;
1621this . device_name = device_name ;
@@ -51,9 +56,9 @@ function PcapSession(is_live, device_name, filter, buffer_size, snap_length, out
5156const packet_ready = this . on_packet_ready . bind ( this ) ;
5257if ( this . is_live ) {
5358this . device_name = this . device_name || binding . default_device ( ) ;
54- this . link_type = this . session . open_live ( this . device_name , this . filter , this . buffer_size , this . snap_length , this . outfile , packet_ready , this . is_monitor , this . buffer_timeout ) ;
59+ this . link_type = this . session . open_live ( this . device_name , this . filter , this . buffer_size , this . snap_length , this . outfile , packet_ready , this . is_monitor , this . buffer_timeout , exports . warningHandler ) ;
5560} else {
56- this . link_type = this . session . open_offline ( this . device_name , this . filter , this . buffer_size , this . snap_length , this . outfile , packet_ready , this . is_monitor , this . buffer_timeout ) ;
61+ this . link_type = this . session . open_offline ( this . device_name , this . filter , this . buffer_size , this . snap_length , this . outfile , packet_ready , this . is_monitor , this . buffer_timeout , exports . warningHandler ) ;
5762}
5863
5964this . opened = true ;