-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
rtpp_command_private.h
113 lines (96 loc) · 3.39 KB
/
rtpp_command_private.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* Copyright (c) 2004-2006 Maxim Sobolev <sobomax@FreeBSD.org>
* Copyright (c) 2006-2014 Sippy Software, Inc., http://www.sippysoft.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include "rtpp_str.h"
#ifndef _RTPP_COMMAND_PRIVATE_H_
#define _RTPP_COMMAND_PRIVATE_H_
struct rtpp_timestamp;
struct rtpp_command_stat {
uint64_t cnt;
int cnt_idx;
};
struct rtpp_command_stats {
struct rtpp_command_stat ncmds_rcvd;
struct rtpp_command_stat ncmds_rcvd_ndups;
struct rtpp_command_stat ncmds_succd;
struct rtpp_command_stat ncmds_errs;
struct rtpp_command_stat ncmds_repld;
struct rtpp_command_stat nsess_complete;
struct rtpp_command_stat nsess_created;
struct rtpp_command_stat nplrs_created;
struct rtpp_command_stat nplrs_destroyed;
};
enum rtpp_cmd_op {DELETE, RECORD, PLAY, NOPLAY, COPY, UPDATE, LOOKUP, INFO,
QUERY, VER_FEATURE, GET_VER, DELETE_ALL, GET_STATS, NORECORD};
struct common_cmd_args {
enum rtpp_cmd_op op;
const char *rname;
const char *hint;
const rtpp_str_t *call_id;
const rtpp_str_t *from_tag;
const rtpp_str_t *to_tag;
union {
struct ul_opts *ul;
struct play_opts *play;
struct delete_opts *delete;
void *ptr;
} opts;
};
#define MAX_SUBC_NUM 4
struct after_success_h_args;
struct rtpp_subc_ctx;
DEFINE_RAW_METHOD(after_success, int, const struct after_success_h_args *,
const struct rtpp_subc_ctx *);
struct after_success_h_args {
void *stat;
void *dyn;
};
struct after_success_h {
after_success_t handler;
struct after_success_h_args args;
};
struct rtpp_command {
char buf[RTPP_CMD_BUFLEN];
char buf_t[1024];
struct rtpp_command_args args;
struct {
struct rtpp_command_args args[MAX_SUBC_NUM];
struct rtpp_subc_resp res[MAX_SUBC_NUM];
int n;
} subc;
struct sockaddr_storage raddr;
struct sockaddr *laddr;
socklen_t rlen;
const struct rtpp_timestamp *dtime;
struct rtpp_command_stats *csp;
struct common_cmd_args cca;
int no_glock;
struct rtpp_session *sp;
struct rtpp_log *glog;
struct after_success_h after_success[MAX_SUBC_NUM];
};
#endif