annotate net-traffic/rtp-stream-gen.c @ 10:e686bc92c7d8

revamp for new subdir structure and configure script
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 15 May 2024 01:44:46 +0000
parents rtp-stream-gen.c@d180987db615
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This program generates a dummy RTP stream, sending RTP packets with
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * a dummy payload to the specified destination IP:port, paced in time
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * every 20 ms. The purpose is to test the behaviour of affordably-available
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * Internet connections when presented with such traffic: the intent is
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * to capture this packet stream on the receiving end with tcpdump and then
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 * analyze the pcap for problem signs of packet loss, jitter and reordering.
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 */
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include <sys/types.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include <sys/socket.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #include <sys/time.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 #include <netinet/in.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 #include <arpa/inet.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 #include <stdio.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #include <stdint.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 #include <stdlib.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 #include <string.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 #include <strings.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 #include <unistd.h>
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #define RTP_PACKET_HDR_SIZE 12
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #define RTP_MAX_PAYLOAD 160
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #define GSM_FR_BYTES 33
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 struct rtp_packet {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 uint8_t v_p_x_cc;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 uint8_t m_pt;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 uint16_t seq;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 uint32_t tstamp;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 uint32_t ssrc;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 uint8_t payload[RTP_MAX_PAYLOAD];
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 };
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 static const uint8_t gsmfr_silence_frame[GSM_FR_BYTES] = {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 0xDA, 0xA7, 0xAA, 0xA5, 0x1A,
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 0x50, 0x20, 0x38, 0xE4, 0x6D, 0xB9, 0x1B,
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 0x50, 0x20, 0x38, 0xE4, 0x6D, 0xB9, 0x1B,
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 0x50, 0x20, 0x38, 0xE4, 0x6D, 0xB9, 0x1B,
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 0x50, 0x20, 0x38, 0xE4, 0x6D, 0xB9, 0x1B,
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 };
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 static struct sockaddr_in sin_src, sin_dest;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 static struct rtp_packet rtp_pkt;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 static unsigned rtp_pkt_len, req_packet_count;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 static int udp_fd;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 static void
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 parse_ip_port(arg, sin)
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 char *arg;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 struct sockaddr_in *sin;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 char *cp;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 int rc;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 cp = index(arg, ':');
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 if (!cp) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 fprintf(stderr, "error: missing ':' in IP:port argument\n");
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 exit(1);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 *cp++ = '\0';
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 sin->sin_family = AF_INET;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 rc = inet_aton(arg, &sin->sin_addr);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 if (!rc) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 fprintf(stderr, "error: invalid IP address argument\n");
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 exit(1);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 sin->sin_port = htons(atoi(cp));
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 static void
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 prepare_rtp_payload(type_arg)
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 char *type_arg;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 unsigned pl_len;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 if (!strcmp(type_arg, "pcmu")) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 rtp_pkt.m_pt = 0;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 memset(rtp_pkt.payload, 0xFF, RTP_MAX_PAYLOAD);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 pl_len = RTP_MAX_PAYLOAD;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 } else if (!strcmp(type_arg, "pcma")) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 rtp_pkt.m_pt = 8;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 memset(rtp_pkt.payload, 0xD5, RTP_MAX_PAYLOAD);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 pl_len = RTP_MAX_PAYLOAD;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 } else if (!strcmp(type_arg, "gsm")) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 rtp_pkt.m_pt = 3;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 memcpy(rtp_pkt.payload, gsmfr_silence_frame, GSM_FR_BYTES);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 pl_len = GSM_FR_BYTES;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 } else {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 fprintf(stderr, "error: invalid PL type argument \"%s\"\n",
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 type_arg);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 exit(1);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 rtp_pkt_len = RTP_PACKET_HDR_SIZE + pl_len;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 static void
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 assign_rtpout_ssrc()
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 struct timeval curtime;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 gettimeofday(&curtime, 0);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 rtp_pkt.ssrc = curtime.tv_sec ^ curtime.tv_usec ^ getpid();
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 static void
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 prepare_udp_socket()
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 int rc;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 udp_fd = socket(AF_INET, SOCK_DGRAM, 0);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 if (udp_fd < 0) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 perror("socket(AF_INET, SOCK_DGRAM, 0)");
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 exit(1);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 rc = bind(udp_fd, (struct sockaddr *) &sin_src, sizeof sin_src);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 if (rc < 0) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 perror("bind");
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 exit(1);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 rc = connect(udp_fd, (struct sockaddr *) &sin_dest, sizeof sin_dest);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 if (rc < 0) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 perror("connect");
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 exit(1);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 static void
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 send_out_packets()
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 unsigned n, seq, ts;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 seq = 0;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 ts = 0;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 for (n = 0; n < req_packet_count; n++) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 rtp_pkt.seq = htons(seq);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 rtp_pkt.tstamp = htonl(ts);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 send(udp_fd, &rtp_pkt, rtp_pkt_len, 0);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 seq++;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 ts += 160;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 usleep(20000);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 main(argc, argv)
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 char **argv;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 if (argc != 5) {
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 fprintf(stderr, "usage: %s src-IP:port dest-IP:port type num\n",
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 argv[0]);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 exit(1);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 }
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 parse_ip_port(argv[1], &sin_src);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 parse_ip_port(argv[2], &sin_dest);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 prepare_rtp_payload(argv[3]);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 rtp_pkt.v_p_x_cc = 0x80;
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 assign_rtpout_ssrc();
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 req_packet_count = atoi(argv[4]);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 prepare_udp_socket();
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 send_out_packets();
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 exit(0);
d180987db615 new program rtp-stream-gen
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 }