8
8
#include < map>
9
9
#include < list>
10
10
#include < time.h>
11
+ #include < functional>
11
12
12
13
// / @file
13
14
// / This is an implementation of TCP reassembly logic, which means reassembly of TCP messages spanning multiple TCP
@@ -316,14 +317,14 @@ namespace pcpp
316
317
// / @param[in] tcpData The TCP data itself + connection information
317
318
// / @param[in] userCookie A pointer to the cookie provided by the user in TcpReassembly c'tor (or nullptr if no
318
319
// / cookie provided)
319
- typedef void (*OnTcpMessageReady)( int8_t side, const TcpStreamData& tcpData, void * userCookie);
320
+ using OnTcpMessageReady = std::function< void ( int8_t side, const TcpStreamData& tcpData, void * userCookie)> ;
320
321
321
322
// / @typedef OnTcpConnectionStart
322
323
// / A callback invoked when a new TCP connection is identified (whether it begins with a SYN packet or not)
323
324
// / @param[in] connectionData Connection information
324
325
// / @param[in] userCookie A pointer to the cookie provided by the user in TcpReassembly c'tor (or nullptr if no
325
326
// / cookie provided)
326
- typedef void (*OnTcpConnectionStart)( const ConnectionData& connectionData, void * userCookie);
327
+ using OnTcpConnectionStart = std::function< void ( const ConnectionData& connectionData, void * userCookie)> ;
327
328
328
329
// / @typedef OnTcpConnectionEnd
329
330
// / A callback invoked when a TCP connection is terminated, either by a FIN or RST packet or manually by the
@@ -332,8 +333,8 @@ namespace pcpp
332
333
// / @param[in] reason The reason for connection termination: FIN/RST packet or manually by the user
333
334
// / @param[in] userCookie A pointer to the cookie provided by the user in TcpReassembly c'tor (or nullptr if no
334
335
// / cookie provided)
335
- typedef void (* OnTcpConnectionEnd)( const ConnectionData& connectionData, ConnectionEndReason reason,
336
- void * userCookie);
336
+ using OnTcpConnectionEnd =
337
+ std::function< void ( const ConnectionData& connectionData, ConnectionEndReason reason, void * userCookie)> ;
337
338
338
339
// / A c'tor for this class
339
340
// / @param[in] onMessageReadyCallback The callback to be invoked when new data arrives
0 commit comments