Code Comments
Programming Forum and web based access to our favorite programming groups.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 .
Post Follow-up to this messageIn 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 ***
Post Follow-up to this messagemanu 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
Post Follow-up to this messageIn 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 ***
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.