📄 regctl.h
字号:
/*
* SIP Register Controller
* Save the register information
*/
#ifndef _REGCTL_H
#define _REGCTL_H
#define REGCTL_DEBUG 0 /* Print debug information */
#define REGNUM_SIZE 100
struct sip_reg_ctl_t {
int active;
int expires; /* register informaiton expire */
struct in_addr nat_ip; /* ip address after nat translation */
int nat_port; /* port after nat translation */
char reg_host[HOSTNAME_SIZE]; /* client real name */
char reg_port[PORT_SIZE]; /* client real port */
char reg_username[USERNAME_SIZE]; /* client real username */
};
/* Register Information Table */
struct sip_reg_ctl_t sip_reg_ctl[REGNUM_SIZE];
/* Allocates and initialises new queue structure */
int regctl_newq(struct sip_reg_ctl_t **regctl_queue);
/* Deallocates queue structure */
int regctl_freeq(struct sip_reg_ctl_t *regctl_queue);
/* Find element based on ip address after nat translation */
int regctl_find(const struct sip_reg_ctl_t regctl_queue[], struct in_addr true_ip,
int true_port, int num);
/* New Client Register Information */
int regctl_new(struct sip_reg_ctl_t regctl_queue[], int expires, struct in_addr true_ip,
int true_port, char *rhost, char *ruser, char *rport, int num);
/* Release Client Register Informaiton */
int regctl_free(struct sip_reg_ctl_t regctl_queue[], struct in_addr true_ip,
int true_port, int num);
/* Update client register informaiton */
int regctl_update(struct sip_reg_ctl_t regctl_queue[], int expires, char *rhost, char *rport,
char *ruser, int num);
/* Find the nat ip address and port of internal client */
int regctl_findaddr(const struct sip_reg_ctl_t regctl_queue[], char *username,
struct in_addr *destip, int *destport, int num);
/* Find user by username */
int regctl_finduser(const struct sip_reg_ctl_t regctl_queue[], char *req_user, int num);
/* Ageing the regctl table */
void register_agemap(void);
#endif /* !_REGCTL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -