12-20-2010
If the problem does not related with the listen(), it may be an interesting thing.
I sent 1024 packets to the server (a PC has both sender and receiver, that means, it send packets to itself).
When I Ctrl+C to close and reopen the program few times, the receiver may receive extra package and garbage; and some packets are missing.
If I send 65535 packets at a time, this problem happens more frequency.
10 More Discussions You Might Find Interesting
1. Programming
How can I store and/or print() a number that is larger than 4 294 967 295 in C? is int64_t or u_int64_t what I need ? if, so how can I printf it to stdout? (2 Replies)
Discussion started by: nimnod
2 Replies
2. UNIX for Dummies Questions & Answers
I am working on a re-engineering project. Original Code is written in C. In the C code some "forms" are being called. Each form is in a separate file and files are tagged "int" or "int.lst" like f00.int, f00.int.lst
Can some body through some light on what are these files and what is the... (2 Replies)
Discussion started by: cxredd4
2 Replies
3. Programming
What is the difference between int** func() and int*& func(). Can you please explain it with suitable example.
Thanks,
Devesh. (1 Reply)
Discussion started by: devesh
1 Replies
4. Programming
Hi,
Is there any way to calculate the size of a built in data type without using 'sizeof' operator? I also don't have the option to read it from std .h file.
regards
Apoorva Kumar (10 Replies)
Discussion started by: apoorvasharma80
10 Replies
5. UNIX for Dummies Questions & Answers
hello everybody!
I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(){
int fileDescriptor;
fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies
6. Shell Programming and Scripting
hello guys i m new to shell scripting and can't find out why this structure is not right
I m guessing this happens because $LINESUM is a string . so how can i do this ?
i want my script to do so many loops as the number of the lines of one custom file.
#!/bin/bash
echo give me path name... (5 Replies)
Discussion started by: xamxam
5 Replies
7. Programming
int air_date='20100103'; //2010 - Jan - 03
/* My goal here is to subtract a day. */
int day = air_date % 100; //?????? Is this right?
//Are there any functions time/date for this type of date format?
:cool: (7 Replies)
Discussion started by: sepoto
7 Replies
8. Programming
Does anyone know how to convert a IP address given as 'string' into a 'u_int32_t'? Are there any build any functions already? (1 Reply)
Discussion started by: Freaky123
1 Replies
9. Programming
A simple arithmetic example: 1680 / 1.12 = 1500
My C code result is 1499, here is the code:
#include <stdio.h>
main(int argc, char *argv)
{
int t = 1680;
double adj = 1.12;
int ires = t / adj;
double fres = t / adj;
... (8 Replies)
Discussion started by: migurus
8 Replies
10. Shell Programming and Scripting
Hello Everyone,
I am new to awk and trying my hand with the diff codes and came across the below code today. It would be great if any of the Guru's help me to understand.
awk '{filename = "sample_file" int((NR-1)/34) ".DAT"; print >> filename}' sample_file.DAT
34 is the no of lines each... (7 Replies)
Discussion started by: saratha14
7 Replies
LEARN ABOUT FREEBSD
ipfwpcap
IPFWPCAP(8) BSD System Manager's Manual IPFWPCAP(8)
NAME
ipfwpcap -- copy diverted packets to a file in tcpdump format
SYNOPSIS
ipfwpcap [-dr] [-b maxbytes] [-p maxpkts] [-P pidfile] portnum dumpfile
DESCRIPTION
The ipfwpcap utility is used to copy diverted packets to a file in tcpdump(1) format. The interesting packets are diverted by ipfw(8) to a
port on which ipfwpcap listens. The packets are then dropped unless -r is used.
The options are as follows:
-d Turns on extra debugging messages.
-r Writes packets back to the divert(4) socket.
-rr Indicates that it is okay to quit if maxbytes or maxpkts are reached. Diverted packets will silently disappear if nothing is listen-
ing on the divert(4) socket.
-b maxbytes
Stop dumping after maxbytes bytes.
-p maxpkts
Stop dumping after maxpkt packets.
-P pidfile
File to store PID number in. Default is /var/run/ipwfpcap.portnr.pid.
The portnum argument specifies which divert(4) socket port to listen on. The dumpfile argument is the path to the file to write captured
packets to. Specify '-' to write to stdout.
EXIT STATUS
The ipfwpcap utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
ipfwpcap -r 8091 divt.log &
Starts ipfwpcap as a background job listening to port 8091 and reflecting the packets back to the socket.
ipfw add 2864 divert 8091 ip from 192.0.2.101
Example ipfw(8) rule to divert all packets from 192.0.2.101 to port 8091. See ipfw(8) for details.
SEE ALSO
tcpdump(1), pcap(3), divert(4), ipfw(8)
HISTORY
The ipfwpcap utility first appeared in FreeBSD 7.0.
AUTHORS
ipfwpcap was written by P. Kern <pkern@cns.utoronto.ca>. This manual page was written by Niclas Zeising <zeising@FreeBSD.org>.
BSD
May 22, 2006 BSD