Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: sending a packet using raw socket
First thanks for letting me know that structure can be sent over
network .

reason for using following sequence
| 2 - strcpy(data , "");
| 3- strcat(data , "data u want to send");

if structure u want to send has n members then u have to use 'strcat' n
times .


Report this thread to moderator Post Follow-up to this message
Old Post
mangesh sawant
03-25-06 03:00 AM


Re: sending a packet using raw socket
In article <1143249617.678691.134040@z34g2000cwc.googlegroups.com>,
"mangesh sawant" <mangesh@interinfosystems.com> wrote:

> First thanks for letting me know that structure can be sent over
> network .
>
> reason for using following sequence
> | 2 - strcpy(data , "");
> | 3- strcat(data , "data u want to send");
>
> if structure u want to send has n members then u have to use 'strcat' n
> times .

strcat() is only for strings, not structure members.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Report this thread to moderator Post Follow-up to this message
Old Post
Barry Margolin
03-25-06 03:00 AM


Re: sending a packet using raw socket
manu wrote:

> now i am trying to write various structures and convert it to strings
> for sendto..

No, you don't do this!
You convert your "program-internal" data to exactly that
data-representation that is required by the standard of
the protocol that you're implementing.

If you develop your own protocol, write the required
standard first.

> My question is..
> for handling ICMP packets, the structure is defined in ip_icmp.h, but
> for OSPF no header file is defined.

You certainly should get a copy of RFC-2328
(see http://www.faqs.org/rfcs/rfc2328.html )
and read it and try to undersdtand it. (This RFC describes OSPF)

Rainer

Report this thread to moderator Post Follow-up to this message
Old Post
Rainer Temme
03-27-06 09:00 AM


Re: sending a packet using raw socket
In article <1143428013.144932.8460@u72g2000cwu.googlegroups.com>,
"manu" <manoharyes@gmail.com> wrote:

> thank u guys...
> thank u soo much for the info.
>
> Now i am confirmed tat I can build my own structure and hand it to IP
> layer using raw sockets.
> now i am trying to write various structures and convert it to strings
> for sendto..
>
> My question is..
> for handling ICMP packets, the structure is defined in ip_icmp.h, but
> for OSPF no header file is defined.

Naturally, since Unix doesn't have any built-in OSPF support.  Why would
it need a header file for something it doesn't use?

> so we need to define our own structure and fill in the header..
> so , are we allowed to build any structure with any members on it?
> how does the IP layer know if the structure is valid?
> is there any specific headers(OSPF)  which has to be mandatorily
> filled?

You need to fill in all the headers that IP and OSPF require.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Report this thread to moderator Post Follow-up to this message
Old Post
Barry Margolin
03-27-06 01:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:15 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.