alias_smedia.c (ed01a5821550bf9859165f24c95b30c5f1b69f22) alias_smedia.c (9fa0fd268273d90e765d9ebfe0be87ea4d64e138)
1/*
2 * alias_smedia.c
3 *
4 * Copyright (c) 2000 Whistle Communications, Inc.
5 * All rights reserved.
6 *
7 * Subject to the following obligations and disclaimer of warranty, use and
8 * redistribution of this software, in source or object code forms, with or

--- 141 unchanged lines hidden (view full) ---

150 u_short salias = 0, ealias = 0, base_alias = 0;
151 const char *transport_str = "transport:";
152 char newdata[2048], *port_data, *port_newdata, stemp[80];
153 int links_created = 0, pkt_updated = 0;
154 struct alias_link *rtsp_lnk = NULL;
155 struct in_addr null_addr;
156
157 /* Calculate data length of TCP packet */
1/*
2 * alias_smedia.c
3 *
4 * Copyright (c) 2000 Whistle Communications, Inc.
5 * All rights reserved.
6 *
7 * Subject to the following obligations and disclaimer of warranty, use and
8 * redistribution of this software, in source or object code forms, with or

--- 141 unchanged lines hidden (view full) ---

150 u_short salias = 0, ealias = 0, base_alias = 0;
151 const char *transport_str = "transport:";
152 char newdata[2048], *port_data, *port_newdata, stemp[80];
153 int links_created = 0, pkt_updated = 0;
154 struct alias_link *rtsp_lnk = NULL;
155 struct in_addr null_addr;
156
157 /* Calculate data length of TCP packet */
158 tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2));
158 tc = (struct tcphdr *)ip_next(pip);
159 hlen = (pip->ip_hl + tc->th_off) << 2;
160 tlen = ntohs(pip->ip_len);
161 dlen = tlen - hlen;
162
163 /* Find keyword, "Transport: " */
164 pos = search_string(data, dlen, transport_str);
165 if (pos < 0) {
166 return (-1);

--- 187 unchanged lines hidden (view full) ---

354 memcpy(&port, work, 2);
355 pna_links = FindUdpTcpOut(la, pip->ip_src, GetDestAddress(lnk),
356 port, 0, IPPROTO_UDP, 1);
357 if (pna_links != NULL) {
358#ifndef NO_FW_PUNCH
359 /* Punch hole in firewall */
360 PunchFWHole(pna_links);
361#endif
159 hlen = (pip->ip_hl + tc->th_off) << 2;
160 tlen = ntohs(pip->ip_len);
161 dlen = tlen - hlen;
162
163 /* Find keyword, "Transport: " */
164 pos = search_string(data, dlen, transport_str);
165 if (pos < 0) {
166 return (-1);

--- 187 unchanged lines hidden (view full) ---

354 memcpy(&port, work, 2);
355 pna_links = FindUdpTcpOut(la, pip->ip_src, GetDestAddress(lnk),
356 port, 0, IPPROTO_UDP, 1);
357 if (pna_links != NULL) {
358#ifndef NO_FW_PUNCH
359 /* Punch hole in firewall */
360 PunchFWHole(pna_links);
361#endif
362 tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2));
362 tc = (struct tcphdr *)ip_next(pip);
363 alias_port = GetAliasPort(pna_links);
364 memcpy(work, &alias_port, 2);
365
366 /* Compute TCP checksum for revised packet */
367 tc->th_sum = 0;
368 tc->th_sum = TcpChecksum(pip);
369 }
370 }

--- 11 unchanged lines hidden (view full) ---

382 char *data;
383 const char *setup = "SETUP", *pna = "PNA", *str200 = "200";
384 const char *okstr = "OK", *client_port_str = "client_port";
385 const char *server_port_str = "server_port";
386 int i, parseOk;
387
388 (void)maxpacketsize;
389
363 alias_port = GetAliasPort(pna_links);
364 memcpy(work, &alias_port, 2);
365
366 /* Compute TCP checksum for revised packet */
367 tc->th_sum = 0;
368 tc->th_sum = TcpChecksum(pip);
369 }
370 }

--- 11 unchanged lines hidden (view full) ---

382 char *data;
383 const char *setup = "SETUP", *pna = "PNA", *str200 = "200";
384 const char *okstr = "OK", *client_port_str = "client_port";
385 const char *server_port_str = "server_port";
386 int i, parseOk;
387
388 (void)maxpacketsize;
389
390 tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2));
390 tc = (struct tcphdr *)ip_next(pip);
391 hlen = (pip->ip_hl + tc->th_off) << 2;
392 tlen = ntohs(pip->ip_len);
393 dlen = tlen - hlen;
394
395 data = (char *)pip;
396 data += hlen;
397
398 /* When aliasing a client, check for the SETUP request */

--- 47 unchanged lines hidden ---
391 hlen = (pip->ip_hl + tc->th_off) << 2;
392 tlen = ntohs(pip->ip_len);
393 dlen = tlen - hlen;
394
395 data = (char *)pip;
396 data += hlen;
397
398 /* When aliasing a client, check for the SETUP request */

--- 47 unchanged lines hidden ---