Deleted Added
full compact
ipsyncm.c (153881) ipsyncm.c (161357)
1/* $FreeBSD: head/contrib/ipfilter/tools/ipsyncm.c 153881 2005-12-30 11:52:26Z guido $ */
1/* $FreeBSD: head/contrib/ipfilter/tools/ipsyncm.c 161357 2006-08-16 12:23:02Z guido $ */
2
3/*
4 * Copyright (C) 1993-2001 by Darren Reed.
5 *
6 * See the IPFILTER.LICENCE file for details on licencing.
7 */
8#if !defined(lint)
9static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
2
3/*
4 * Copyright (C) 1993-2001 by Darren Reed.
5 *
6 * See the IPFILTER.LICENCE file for details on licencing.
7 */
8#if !defined(lint)
9static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
10static const char rcsid[] = "@(#)$Id: ipsyncm.c,v 1.4.2.2 2005/01/08 14:31:46 darrenr Exp $";
10static const char rcsid[] = "@(#)$Id: ipsyncm.c,v 1.4.2.4 2006/03/27 02:09:46 darrenr Exp $";
11#endif
12#include <sys/types.h>
13#include <sys/time.h>
14#include <sys/socket.h>
15
16#include <netinet/in.h>
17#include <net/if.h>
18
19#include <arpa/inet.h>
20
21#include <stdio.h>
22#include <stdlib.h>
23#include <fcntl.h>
24#include <unistd.h>
11#endif
12#include <sys/types.h>
13#include <sys/time.h>
14#include <sys/socket.h>
15
16#include <netinet/in.h>
17#include <net/if.h>
18
19#include <arpa/inet.h>
20
21#include <stdio.h>
22#include <stdlib.h>
23#include <fcntl.h>
24#include <unistd.h>
25#include <strings.h>
25#include
26#include <syslog.h>
27#include <signal.h>
28
29#include "netinet/ip_compat.h"
30#include "netinet/ip_fil.h"
31#include "netinet/ip_nat.h"
32#include "netinet/ip_state.h"
33#include "netinet/ip_sync.h"
34
35
36int main __P((int, char *[]));
26#include <syslog.h>
27#include <signal.h>
28
29#include "netinet/ip_compat.h"
30#include "netinet/ip_fil.h"
31#include "netinet/ip_nat.h"
32#include "netinet/ip_state.h"
33#include "netinet/ip_sync.h"
34
35
36int main __P((int, char *[]));
37void usage __P((const char *));
37
38int terminate = 0;
39
40void usage(const char *progname) {
41 fprintf(stderr, "Usage: %s <destination IP> <destination port>\n", progname);
42}
43
38
39int terminate = 0;
40
41void usage(const char *progname) {
42 fprintf(stderr, "Usage: %s <destination IP> <destination port>\n", progname);
43}
44
45#if 0
44static void handleterm(int sig)
45{
46 terminate = sig;
47}
46static void handleterm(int sig)
47{
48 terminate = sig;
49}
50#endif
48
49
50/* should be large enough to hold header + any datatype */
51#define BUFFERLEN 1400
52
53int main(argc, argv)
54int argc;
55char *argv[];

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

112 goto tryagain;
113 }
114
115 if (connect(nfd, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
116 syslog(LOG_ERR, "Connect: %m");
117 goto tryagain;
118 }
119
51
52
53/* should be large enough to hold header + any datatype */
54#define BUFFERLEN 1400
55
56int main(argc, argv)
57int argc;
58char *argv[];

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

115 goto tryagain;
116 }
117
118 if (connect(nfd, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
119 syslog(LOG_ERR, "Connect: %m");
120 goto tryagain;
121 }
122
120 syslog(LOG_INFO, "Established connection to %s",
123 syslog(LOG_INFO, "Sending data to %s",
121 inet_ntoa(sin.sin_addr));
122
123 inbuf = 0;
124 while (1) {
125
126 n1 = read(lfd, buff+inbuf, BUFFERLEN-inbuf);
127
128 printf("header : %d bytes read (header = %d bytes)\n",

--- 125 unchanged lines hidden ---
124 inet_ntoa(sin.sin_addr));
125
126 inbuf = 0;
127 while (1) {
128
129 n1 = read(lfd, buff+inbuf, BUFFERLEN-inbuf);
130
131 printf("header : %d bytes read (header = %d bytes)\n",

--- 125 unchanged lines hidden ---