| 155 | } |
| 156 | |
| 157 | int main(int argc, char *argv[]) |
| 158 | { |
| 159 | char errbuf[PCAP_ERRBUF_SIZE]; |
| 160 | bpf_u_int32 pcap_net = 0; |
| 161 | pcap_t *pcap_handle; |
| 162 | #if BEW |
| 163 | struct sockaddr_in local; |
| 164 | #endif |
| 165 | srtp_sec_serv_t sec_servs = sec_serv_none; |
| 166 | int c; |
| 167 | struct srtp_crypto_suite scs, *i_scsp; |
| 168 | scs.key_size = 128; |
| 169 | scs.tag_size = 0; |
| 170 | int gcm_on = 0; |
| 171 | char *input_key = NULL; |
| 172 | int b64_input = 0; |
| 173 | char key[MAX_KEY_LEN]; |
| 174 | struct bpf_program fp; |
| 175 | char filter_exp[MAX_FILTER] = ""; |
| 176 | char pcap_file[MAX_FILE] = "-"; |
| 177 | size_t rtp_packet_offset = DEFAULT_RTP_OFFSET; |
| 178 | rtp_decoder_t dec; |
| 179 | srtp_policy_t policy = { 0 }; |
| 180 | rtp_decoder_mode_t mode = mode_rtp; |
| 181 | srtp_ssrc_t ssrc = { ssrc_any_inbound, 0 }; |
| 182 | uint32_t roc = 0; |
| 183 | srtp_err_status_t status; |
| 184 | int len; |
| 185 | int expected_len; |
| 186 | int do_list_mods = 0; |
| 187 | |
| 188 | fprintf(stderr, "Using %s [0x%x]\n", srtp_get_version_string(), |
| 189 | srtp_get_version()); |
| 190 | |
| 191 | /* initialize srtp library */ |
| 192 | status = srtp_init(); |
| 193 | if (status) { |
| 194 | fprintf(stderr, |
| 195 | "error: srtp initialization failed with error code %d\n", |
| 196 | status); |
| 197 | exit(1); |
| 198 | } |
| 199 | |
| 200 | status = srtp_install_log_handler(rtp_decoder_srtp_log_handler, NULL); |
| 201 | if (status) { |
| 202 | fprintf(stderr, "error: install log handler failed\n"); |
| 203 | exit(1); |
| 204 | } |
| 205 | |
| 206 | /* check args */ |
| 207 | while (1) { |
| 208 | c = getopt_s(argc, argv, "b:k:gt:ae:ld:f:c:m:p:o:s:r:"); |
| 209 | if (c == -1) { |
| 210 | break; |
| 211 | } |
| 212 | switch (c) { |
| 213 | case 'b': |
| 214 | b64_input = 1; |
nothing calls this directly
no test coverage detected