RAW socket prgmming

From: neha agrawal
Date: Wed Jan 05 2005 - 22:56:52 EST


hello!

i want to implement smtp protocol on the same
machine.i have a libpcap trace file..in which i have
captured mail traffic..(single session).and i want to
develop a program which can read this trace file..and
communicate with the smtp server...
first packet is Sync packet in trace file..so i
want to send it to smtp server...and then i want my
progrem to handle the reply sent by server..(say it
sent Syn-Ack) anf then my prgm should reply
accordingly..
for doing this i am using PF_PACKET , SOCK_RAW
and using sendto function...i am sending the
packet..im able to see it through tcpdump...but
theserver is not replying...why??i am wrking with
linux Redhat 9 kernel 2.4.20-8

(...if u r familiar with flowreplay tool..i
want to do something similar ...but mine is single
session..so less complicated...)

attching source code...

do let me know..if i am on correct track...
thnks
Neha

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

Attachment: tcp1.c
Description: tcp1.c

Attachment: tcp.h
Description: tcp.h