Deleted Added
sdiff udiff text old ( 153881 ) new ( 161357 )
full compact
1/* $FreeBSD: head/contrib/ipfilter/tools/ipsyncm.c 153881 2005-12-30 11:52:26Z 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";
10static const char rcsid[] = "@(#)$Id: ipsyncm.c,v 1.4.2.2 2005/01/08 14:31: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>
25#include <strings.h>
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 *[]));
37
38int terminate = 0;
39
40void usage(const char *progname) {
41 fprintf(stderr, "Usage: %s <destination IP> <destination port>\n", progname);
42}
43
44static void handleterm(int sig)
45{
46 terminate = sig;
47}
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
120 syslog(LOG_INFO, "Established connection 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 ---