summaryrefslogtreecommitdiff
path: root/res/res_hep.c
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-03-21 07:59:12 -0400
committerSean Bright <sean.bright@gmail.com>2017-03-21 13:40:29 -0600
commitd4fcf196a20b3141a10c0cd5b84f09b367e8f7e3 (patch)
tree1954a3c6d921d3c1c1eb9146bcd719c9d4c7fc74 /res/res_hep.c
parentf5603cb1ece5001d1288004c9bc6ed51448deb81 (diff)
res_hep: Capture actual transport type in use
Rather than hard-coding UDP, allow consumers of the HEP API to specify which protocol is in use. Update the PJSIP provider to pass in the current protocol type. ASTERISK-26850 #close Change-Id: I54bbb0a001cfe4c6a87ad4b6f2014af233349978
Diffstat (limited to 'res/res_hep.c')
-rw-r--r--res/res_hep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_hep.c b/res/res_hep.c
index 3bbf4c51e..41a558141 100644
--- a/res/res_hep.c
+++ b/res/res_hep.c
@@ -439,6 +439,9 @@ struct hepv3_capture_info *hepv3_create_capture_info(const void *payload, size_t
memcpy(info->payload, payload, len);
info->len = len;
+ /* Set a reasonable default */
+ info->protocol_id = IPPROTO_UDP;
+
return info;
}
@@ -470,7 +473,7 @@ static int hep_queue_cb(void *data)
/* Build HEPv3 header, capture info, and calculate the total packet size */
memcpy(hg_pkt.header.id, "\x48\x45\x50\x33", 4);
- INITIALIZE_GENERIC_HEP_CHUNK_DATA(&hg_pkt.ip_proto, CHUNK_TYPE_IP_PROTOCOL_ID, 0x11);
+ INITIALIZE_GENERIC_HEP_CHUNK_DATA(&hg_pkt.ip_proto, CHUNK_TYPE_IP_PROTOCOL_ID, capture_info->protocol_id);
INITIALIZE_GENERIC_HEP_CHUNK_DATA(&hg_pkt.src_port, CHUNK_TYPE_SRC_PORT, htons(ast_sockaddr_port(&capture_info->src_addr)));
INITIALIZE_GENERIC_HEP_CHUNK_DATA(&hg_pkt.dst_port, CHUNK_TYPE_DST_PORT, htons(ast_sockaddr_port(&capture_info->dst_addr)));
INITIALIZE_GENERIC_HEP_CHUNK_DATA(&hg_pkt.time_sec, CHUNK_TYPE_TIMESTAMP_SEC, htonl(capture_info->capture_time.tv_sec));