aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorlsalzman <[email protected]>2012-10-02 13:33:07 +0300
committerlsalzman <[email protected]>2012-10-02 13:33:07 +0300
commit2d979ceb5111faafd2bc78dbaa8893ac36931875 (patch)
tree11bc36efd1de9041388ed3d7baeb701e54ad3ddd /include
parent9dff8f72cfaae437a2e208338dd14544dbc20d02 (diff)
downloadenet-2d979ceb5111faafd2bc78dbaa8893ac36931875.tar.gz
enet-2d979ceb5111faafd2bc78dbaa8893ac36931875.zip
intercept callback support
Diffstat (limited to 'include')
-rw-r--r--include/enet/enet.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/enet/enet.h b/include/enet/enet.h
index b3ad438..90fdbfd 100644
--- a/include/enet/enet.h
+++ b/include/enet/enet.h
@@ -319,6 +319,9 @@ typedef struct _ENetCompressor
/** Callback that computes the checksum of the data held in buffers[0:bufferCount-1] */
typedef enet_uint32 (ENET_CALLBACK * ENetChecksumCallback) (const ENetBuffer * buffers, size_t bufferCount);
+
+/** Callback for intercepting received raw UDP packets. Should return 1 to intercept, 0 to ignore, or -1 to propagate an error. */
+typedef int (ENET_CALLBACK * ENetInterceptCallback) (ENetHost * host, ENetEvent * event);
/** An ENet host for communicating with peers.
*
@@ -368,6 +371,7 @@ typedef struct _ENetHost
enet_uint32 totalSentPackets; /**< total UDP packets sent, user should reset to 0 as needed to prevent overflow */
enet_uint32 totalReceivedData; /**< total data received, user should reset to 0 as needed to prevent overflow */
enet_uint32 totalReceivedPackets; /**< total UDP packets received, user should reset to 0 as needed to prevent overflow */
+ ENetInterceptCallback intercept; /**< callback the user can set to intercept received raw UDP packets */
} ENetHost;
/**