Programming :: How To Access Packet Timestamp

Jan 8, 2011

I want to access the timestamp field of the packet being sent or received. I am not getting clear idea as to which ioctl I should use, and how it should be used in the program. Anyone explain rough flow of the program for accessing the timestamp.

View 5 Replies


ADVERTISEMENT

Programming :: Modifying Timestamp Variable In Python?

Oct 29, 2010

I've implemented a python script in conky that shows my stock portfolio.But, in the output of last updated timestamp, I get a time several hours in the past. The url for fetching stock data is: [URL]This is a norwegian stock, and I also live in norway. So the timestamp is not translated to the stock market of where it came. I can't find any 'localizing' stuff in the url either.Now my question is this: The script puts the time into a variable, the varable now contains ex 11:23 Is there any way I can add 6 hours or so to this variable

View 3 Replies View Related

Programming :: Updating Timestamp In Files In Directory?

Aug 20, 2010

I got a directory with files in it like: 2006-07-01.foo2007-08-04.foo I need to update the timestamps on these files using "touch -t 200607010000 2006-07-01.foo" on each file in the directory so I came up with the following one liner:

for i in `ls -1`; do touch -t `ls -1 | sed -n 's%([0-9]{4})-([0-9]{2})-([0-9]{2})(.*)%1230000%p'` $i; done

My goal was to use sed and get the timestamp for touch and then loop through each file and touch with the timestamp.However the script, not giving me the results I intended. Can anyone chime in on what I am doing wrong?I have been banging away at this for a couple of hours now and am clueless on what it could be. I also tried another variant such as:

for z in $(ls -1 *.foo); do echo $z $(for i in `ls -1 *.foo | sed 's%([0-9]{4})-([0-9]{2})-([0-9]{2})(.*)%1230000%p'`; do echo "$i"; done); done

View 5 Replies View Related

General :: Gcc Compiler Is Not Compiling Old C Programming Files Because Of Timestamp?

Nov 20, 2010

I am using makefile to complile all C Programming files. But certain files are not getting compiled and hence its object file is not getting generated. This is happening due to files haven't been modified for a long time. It seems that compiler knows that its object file is there hence no need to complie it actually it is not.

View 14 Replies View Related

Programming :: Bash Output With Timestamp Removing Duplicates

Nov 20, 2010

I'm writing a bash script to auto run on boot in Tinycore.

This is a watered down version.

Code:

I need it to either not add the time stamp if the awk finds a duplicate or write over the time with the new time if awk finds a duplicate.

BTW this is all pretty much cut-and-paste scripting so please feel free to comment if you know a more elegant way.

View 3 Replies View Related

Programming :: Sort Oldest 5 Files In A Directory Tree Recursively Based On Timestamp?

Jun 3, 2010

I have a directory listing with many subdirectories having many files. I want to recursively search for the oldest 5 files starting from the base directory and not 5 from each subdirectory. I am writing a shell script which sorts them using ls -lRtur|egrep "txt|jpg" > /tmp/file1 Now from this /tmp/file1 file I want to sort the files same as what the ls -ltr command does that is oldest file time to newest file time first. How do I sort based on Linux time stamp? The files itself also have Linux timestamps embedded in them So I can sort based after extracting them as well if it is easier.
My /tmp/file1 has entries like below.

-rw-rw-r--. 1 usr1 usr1 705 2010-01-22 17:25 sample20100603173659.jpg

I want to get the 5 oldest files and then delete them.

View 1 Replies View Related

Programming :: Build Ip Packet With C,socket Programming?

Jan 30, 2011

How can we build a packet using C?we have a structure called sockaddr_in which is use to for IPv4,so that we can define address,port and etc in this way:

Code:
struct sockaddr_in sock;
sock.sin_family=AF_INET;

[code]...

View 5 Replies View Related

Programming :: Create Own Packet In NS2?

Apr 14, 2011

I want to create my own packet for aodv so how can i do? from where i should start?

View 2 Replies View Related

Programming :: How To Tunnel Packet

Apr 19, 2011

I want to develop program to put (tunnel) sniffed packets into another packet, i already have sniffer code to capture packet, can some one give me use full site or simple code to do that.

View 3 Replies View Related

Ubuntu Networking :: Send The Keys Or Value As The Packet Data (content Of The Packet) In Ns-2 (for Wireless Environment)

Jul 12, 2010

I am the new user to ns-2. I would like to know is it possible to send the keys or some value as the packet data (content of the packet) in ns-2 (for wireless environment).

View 1 Replies View Related

CentOS 5 Server :: Authenticate/Decrypt Packet Error: Packet HMAC Authentication Failed

Sep 17, 2009

I got a problem with my CentOS server. Somebody told me OpenVPN Requires different changes inside my firewall settings. That could be the problem why openvpn wont load..I receive this error on my CentOS panel when im trying to connect into the centos openvpn (with my winxp pc):

Thu Sep 17 20:31:36 2009 TLS Error: incoming packet authentication failed from 84.xx.62.122:2622
Thu Sep 17 20:31:38 2009 Authenticate/Decrypt packet error: packet HMAC authentication failed
Thu Sep 17 20:31:38 2009 TLS Error: incoming packet authentication failed from 84.xx.62.122:2622

[code]....

View 5 Replies View Related

Programming :: Perl Disassembling DNS Packet?

May 11, 2010

I'm a newbie trying to modify a DNS-formatted UDP packet. I am piping DNS replies through a firewall queue where I get the packet with $udp_obj->data provided by NetPacket::UDP. Is there a command line application that will break down the udp packet for me so I can extract an answer? Cpan doesn't have a module to do this. One can *create* udp packets programmatically or get them off of libpcap, but I don't need either.

View 7 Replies View Related

Programming :: Save A Packet In The Memory

Feb 7, 2011

i'm sniffing network packets with pcap in ubuntu, i need to save these packets somewhere in the memory and after a while read ans send them. how can i do this?

View 1 Replies View Related

Programming :: Send A Packet Through Sockets C++

Feb 1, 2011

Can someone help me with this problem,trying to send a packet,using tcp/ip,the packet should look like this:

Code:
field 1: SOCKS protocol version, 1 byte (0x05 for this version)
field 2: status, 1 byte:
0x00 = request granted
0x01 = general failure
0x02 = connection not allowed by ruleset
0x03 = network unreachable
0x04 = host unreachable
0x05 = connection refused by destination host
0x06 = TTL expired
0x07 = command not supported / protocol error
0x08 = address type not supported
field 3: reserved, must be 0x00
field 4: address type, 1 byte:
0x01 = IPv4 address
0x03 = Domain name
0x04 = IPv6 address
field 5: destination address of
4 bytes for IPv4 address
1 byte of name length followed by the name for Domain name
16 bytes for IPv6 address
field 6: network byte order port number, 2 bytes
and this is my code:

Code:
int domainLen = strlen(domain);
char reply[domainLen + 7];
reply[0] = 5; // version
reply[1] = 0; // succed
reply[2] = 0; // reserved
reply[3] = 3; // its a domain
reply[4] = domainLen;; // lenght of domain
for(int j = 0; j < domainLen; ++j)
{
reply[j + 5] = domain[j];
}
reply[5 + domainLen] = 80; // port
reply[20] = '�';
Send(reply, sizeof(reply));
domain is "www.google.com". Am I doing it right ? I dont know much about bits.

View 6 Replies View Related

Programming :: Store A Packet In Buffer?

May 19, 2010

writing a code in C program for debugging error and sendingror messagein routingprotocols. please answer with code

View 2 Replies View Related

Programming :: Capture Packet From DMA Ring Buffer?

Jul 21, 2010

I wanna capture network packets from DMA ring buffer, just like netfilter. i wanna capture it from DMA, because i wanna get MAC address of I/O packets, so netfilter not included MAC address of out going packets because its on IP level and Ebtables is like that too. how i can capture network packets from DMA ring buffer.

View 9 Replies View Related

Programming :: ICMP Packet Recieving Using Hook Function

Oct 7, 2010

I want to receive an icmp packet using net filter hook function. A string will be printed if an icmp packet is received.I am able to print the string. but the packet loss in the log message shows 100%packet loss.So i changer hooknum = NF_IP_FORWARD.but still its not working.I want to get log message as received 100%

View 1 Replies View Related

Programming :: Send A UDP Syslog Packet With Source Port Set To 514

Jan 25, 2010

I am trying to generate a UDP syslog packet from my C application. But I am facing a problem with a Cisco Router ACE that does not like the Source Port being '0' and thus drops the packet.How can I specify the Source Port in the UDP header to '514' as stated in RFC3164 (Section 2: Transport Layer Protocol)? "It is RECOMMENDED that the source port also be 514 to indicate that the message is from the syslog process of the sender"

View 1 Replies View Related

Programming :: UDP Packet Loss - Out Of Sequence - Duplication Simulator ?

Oct 13, 2010

I'm beginning to write a custom RTP implementation and want to test its resilience to UDP traffic. I've searched on the web and all the links I can find are for analysing actual traffic, not generating it or messing it up.

Does anyone know of any software (preferably free software) that will, for example, take actual UDP traffic and drop packets, duplicate some and make some arrive late/out of sequence?

View 1 Replies View Related

Programming :: Perl - UDP Server Receive / Send Packet To Host

Apr 1, 2010

I have found many examples out on the www for creating udp servers with sockets. The problem I am running into is after I receive the packet from a host I need to be able to send a custom made packet(I'm using RawIP / NetPacket to make my packet) back to this host. The only way to do this is seemingly through the send() function. This function however doesn't appear to allow me to specify which host to send my packet to.

View 2 Replies View Related

Programming :: Php/HttpRequest/https: A TLS Packet With Unexpected Length Was Received?

May 29, 2010

I'm working on an application that makes http requests using HttpRequest and it's been doing what I need so far without a problem. Now I need to make https requests as well and when I try to make the request, i get this error message:

Code:
Fatal error: Uncaught exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message: ''' in /home/antoranz/waneesia/html/index.php:0 inner exception 'HttpRequestException' with message 'SSL connect error; gnutls_handshake() failed: A TLS packet with unexpected length was received. (https://www.paypal.com/)' in /home/antoranz/waneesia/html/index.php:104 Stack trace: #0 /home/antoranz/waneesia/html/index.php(0): HttpRequest->send() #1 {main} thrown in /home/antoranz/waneesia/html/index.php on line 0
What's going on?

The project: url

View 1 Replies View Related

General :: Mplayer Timestamp Not Disappearing?

Apr 13, 2010

I'm using Linux Mint 8 64bit with Google Chrome Unstable (same problem with beta).When a video is playing, the time elapsed and total time stay on the screen:Is there a way to make this disappear

View 1 Replies View Related

Networking :: How To Log Network Connections With Timestamp

Mar 17, 2010

Is there a way to log specific type of network connection with timestamp? I mean, if someone sends a mail through mail server, is there a way the server logs that connection with timestamp?

Example:
2010-03-17 14:10:12 <server>:25 <client1>:<port1>
2010-03-17 14:10:26 <server>:25 <client2>:<port2>
2010-03-17 14:13:09 <server>:25 <client3>:<port3>
2010-03-17 14:15:43 <server>:25 <client4>:<port4>
...
...
...

View 1 Replies View Related

General :: Ubuntu Timestamp Too Far In Future

Apr 23, 2010

Cannot sudo and gets this message: timestamp too far in the future. I don't have gui interface.

View 1 Replies View Related

Software :: How To Change Timestamp Of Symlink

Feb 10, 2010

I have a directory containing files and symlinks to files elswhere. I make a copy of the directory like this:
cp -rp dir/* new_dir

The files in new_dir have their original timestamps, but the symlinks have the current time. touch -t does not operate on the symblink but on the files they reference. Is there a way to set the timestamp of the symlink to a time in the past?

View 1 Replies View Related

General :: Compare File Timestamp In Bash?

May 6, 2010

How do I compare the timestamp of two files? I tried this but it doesn't work:

file1time=`stat -c %Y fil1.txt`
file2time=`stat -c %Y file2.txt`

[code]....

I printed both the time stamps, in order and it gives me

1273143480
1254144394
./script.sh: line 13: [1273143480: command not found

So basically if comparision is not working, I guess. Or if there is any other nice way than what I am doing, please let me know.

Edit: There was no space in between if, so changing it to this works:

if [ $file1time -gt $file2time ]

View 3 Replies View Related

Ubuntu Servers :: Any Way To See Running Commands With Timestamp?

Jul 26, 2010

I recently hired a new tech guy to start managing our servers. In doing this I went ahead and upgraded all the servers. It has been awhile now since I sent him the details of the new server and the last time I talked to him he was joking around with one of the other clients not realizing how long it took.

I know on other server moves, my old guy could have everything setup and running in a couple days as a good amount of time is waiting for the data to copy over. I am starting to wonder if this guy is going to try and throw a huge bill at me, so I would like to know what hes doing on the server with time stamps just so I can get a idea of how much time he has been logged into the server. Does this server OS have anything like this built in?

View 1 Replies View Related

Ubuntu :: Change Folder Timestamp Recursively?

Sep 2, 2010

I was wondering if anyone knows how to change the timestamps of folders recursively based on the latest timestamp found of the files in that folder.

So for example:

Code:
jon@UbuntuPanther:/media/media/MP3s/Foo Fighters/(1997-05-20) The Colour and The Shape$ ls -alF
total 55220
drwxr-xr-x 2 jon jon 4096 2010-08-30 12:34 ./

[Code]....

View 1 Replies View Related

General :: Egrep In Squid Log File On Timestamp

Oct 19, 2010

I want to egrep or a grep in the squid log file .. from this time 1287483952.440 to '1287483452.440, how can I do it.

View 3 Replies View Related

General :: Normal For /etc/shadow To Change It's Timestamp?

Aug 1, 2010

I noticed that file /etc/shadow changed it's timestamp.Why it is changed? Is it "normal"?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved