From a8c6a0c1b32b4b5a856f0ecfa6d9cbe4598d7dd6 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Thu, 6 Aug 2020 02:41:13 +0200 Subject: [PATCH] Cedar/Proto: rename "ProtoNewSession()" to "ProtoSessionNew()" and "ProtoDeleteSession()" to "ProtoSessionDelete()" For consistency. Also, the "proto" argument is now marked as const. --- src/Cedar/Proto.c | 10 +++++----- src/Cedar/Proto.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cedar/Proto.c b/src/Cedar/Proto.c index 35cb494f..c4b63e33 100644 --- a/src/Cedar/Proto.c +++ b/src/Cedar/Proto.c @@ -196,7 +196,7 @@ void ProtoDelete(PROTO *proto) for (i = 0; i < HASH_LIST_NUM(proto->Sessions); ++i) { - ProtoDeleteSession(LIST_DATA(proto->Sessions->AllList, i)); + ProtoSessionDelete(LIST_DATA(proto->Sessions->AllList, i)); } ReleaseHashList(proto->Sessions); @@ -325,7 +325,7 @@ const PROTO_CONTAINER *ProtoDetect(const PROTO *proto, const PROTO_MODE mode, co return NULL; } -PROTO_SESSION *ProtoNewSession(PROTO *proto, const PROTO_CONTAINER *container, const IP *src_ip, const USHORT src_port, const IP *dst_ip, const USHORT dst_port) +PROTO_SESSION *ProtoSessionNew(const PROTO *proto, const PROTO_CONTAINER *container, const IP *src_ip, const USHORT src_port, const IP *dst_ip, const USHORT dst_port) { LIST *options; PROTO_SESSION *session; @@ -376,7 +376,7 @@ PROTO_SESSION *ProtoNewSession(PROTO *proto, const PROTO_CONTAINER *container, c return session; } -void ProtoDeleteSession(PROTO_SESSION *session) +void ProtoSessionDelete(PROTO_SESSION *session) { if (session == NULL) { @@ -632,7 +632,7 @@ void ProtoHandleDatagrams(UDPLISTENER *listener, LIST *datagrams) continue; } - session = ProtoNewSession(proto, container, &tmp.SrcIp, tmp.SrcPort, &tmp.DstIp, tmp.DstPort); + session = ProtoSessionNew(proto, container, &tmp.SrcIp, tmp.SrcPort, &tmp.DstIp, tmp.DstPort); if (session == NULL) { continue; @@ -659,7 +659,7 @@ void ProtoHandleDatagrams(UDPLISTENER *listener, LIST *datagrams) if (session->Halt) { DeleteHash(sessions, session); - ProtoDeleteSession(session); + ProtoSessionDelete(session); continue; } diff --git a/src/Cedar/Proto.h b/src/Cedar/Proto.h index 29397d06..92bf641a 100644 --- a/src/Cedar/Proto.h +++ b/src/Cedar/Proto.h @@ -94,8 +94,8 @@ void ProtoContainerDelete(PROTO_CONTAINER *container); const PROTO_CONTAINER *ProtoDetect(const PROTO *proto, const PROTO_MODE mode, const UCHAR *data, const UINT size); -PROTO_SESSION *ProtoNewSession(PROTO *proto, const PROTO_CONTAINER *container, const IP *src_ip, const USHORT src_port, const IP *dst_ip, const USHORT dst_port); -void ProtoDeleteSession(PROTO_SESSION *session); +PROTO_SESSION *ProtoSessionNew(const PROTO *proto, const PROTO_CONTAINER *container, const IP *src_ip, const USHORT src_port, const IP *dst_ip, const USHORT dst_port); +void ProtoSessionDelete(PROTO_SESSION *session); bool ProtoSetListenIP(PROTO *proto, const IP *ip); bool ProtoSetUdpPorts(PROTO *proto, const LIST *ports);