Files
gb28181/GB28181Device/sip/sip_util.h
2024-12-15 20:42:32 +08:00

78 lines
2.2 KiB
C

/***************************************************************************************
*
* IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
* Copyright (C) 2014-2022, Happytimesoft Corporation, all rights reserved.
*
* Redistribution and use in binary forms, with or without modification, are permitted.
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
****************************************************************************************/
#ifndef SIP_UTIL_H
#define SIP_UTIL_H
/*******************************************************\
消息类型到字符串的转换
\*******************************************************/
typedef struct msg_type_string_struct
{
SIP_MT mt;
char string[64];
} MSGTSTR;
/*******************************************************\
事件类型到字符串的转换
\*******************************************************/
typedef struct event_type_string_struct
{
CSEVT event;
char string[64];
} EVENTSTR;
/*******************************************************\
向上通知消息 value -> string
\*******************************************************/
struct evt2name
{
PUAEVT evt;
char name[24];
};
/*******************************************************\
下传命令消息 value -> string
\*******************************************************/
struct cmd2name
{
PUACMD cmd;
char name[24];
};
#ifdef __cplusplus
extern "C" {
#endif
char * sip_get_msg_type_string(SIP_MT mt);
char * sip_get_event_string(CSEVT event);
char * sip_get_puaevt_name(PUAEVT evt);
char * sip_get_puacmd_name(PUACMD cmd);
void sip_rx_msg_log(char * msg_buf, uint32 rx_ip, uint16 rx_port);
void sip_tx_msg_log(char * msg_buf, uint32 tx_ip, uint16 tx_port);
#ifdef __cplusplus
}
#endif
#endif