summaryrefslogtreecommitdiff
path: root/Bustle
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2012-01-13 12:42:44 +0000
committerWill Thompson <will@willthompson.co.uk>2012-01-13 13:03:27 +0000
commit12c196ee9d3006ead821ef578bf428a67fd9b3fb (patch)
treec9e8a14fc29fdb75abc2ce19dd745639210c2584 /Bustle
parentdee8f62fd9a2da738e32ac49f3b833deee782a18 (diff)
pcap-monitor: include details in message-logged signal.
This lets us move verbose output for the command line tool into the command line tool, and also lays the foundation for actual live logging.
Diffstat (limited to 'Bustle')
-rw-r--r--Bustle/Monitor.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/Bustle/Monitor.hs b/Bustle/Monitor.hs
index 294f905..4c73648 100644
--- a/Bustle/Monitor.hs
+++ b/Bustle/Monitor.hs
@@ -79,8 +79,17 @@ monitorStop :: Monitor
monitorStop monitor = do
withForeignPtr (unMonitor monitor) bustle_pcap_monitor_stop
+messageLoggedHandler :: IO ()
+ -> a
+ -> Ptr ()
+ -> CInt
+ -> Ptr CChar
+ -> CUInt
+ -> IO ()
+messageLoggedHandler user _obj _messageObject _isIncoming _blob _blobLength = do
+ failOnGError user
+
monitorMessageLogged :: Signal Monitor (IO ())
monitorMessageLogged =
Signal $ \after_ obj user ->
- connectGeneric "message-logged" after_ obj $ \_obj ->
- failOnGError user
+ connectGeneric "message-logged" after_ obj $ messageLoggedHandler user