What's the most raw networking library?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?=

    What's the most raw networking library?


    (I have posted this separately to comp.lang.c++ and comp.lang.c,
    reason being that I'd like a response from both communities, but I
    haven't cross-posted it because I think it's best not to mix C and C++
    discussion)

    I want to get into doing some network programming. I'd like to find a
    good cross-platform networking library, but failing that, I'd settle
    for something that'll work on Linux. I don't mind whether the libary
    is C or whether it's C++, I'll work with either.

    I don't want the library to be so raw as that I have to calculate my
    own Frame Check Sequence for the frames I send, but I would like a
    great deal of control, e.g. I'd like to be able to model a frame that
    has a particular destination, a particular source, a particular
    protocol value. And within the actual frame data, I'd like to be able
    to specify whatever I want, any stream of 1's and 0's. For instance,
    I'd like to model my own ARP request frame.

    The machines I'll be working with will all satisfy the following
    criteria:
    1) CHAR_BIT == 8
    2) I can specify to the compiler not to put padding between
    structure members

    OK so let's say I want to send an ARP request. I'd like to put
    together an ARP header as follows:

    typedef struct ARPHeader {
    uint8 hardware_type[2],
    proto_type[2],
    hardware_len,
    proto_len,
    op[2],
    src_MAC[6],
    src_IP[4],
    dest_MAC[6],
    dest_IP[4]
    } ARPHeader;


    I'd then make an ARPHeader object and populate it:

    ARPHeader arph = { /* blah blah blah */ };

    And then I'd like to send the data out as a frame, e.g. something
    like:

    void LibraryFunction ForSendingFrame (uint8 dest[6],
    uint8 src[6],
    unsigned data_len,
    uint8 const *data);

    LibraryFunction ForSendingFrame (broadcast_addr ,my_mac,sizeof
    arph,arph);

    Is there any kind of networking library that gives me this kind of
    maticulous control? Also, I want to be able to listen to the NIC to
    see if I get an ARP response.

    And just for kicks, is there any kind of networking library that will
    give you even *greater* control than this, e.g. one that will let you
    specify a dodgy frame length and a dodgy Frame Check Sequence?
  • Kenny McCormack

    #2
    Re: What's the most raw networking library?

    In article <31189eab-e092-47dc-8251-1cf08fb0981c@e6 g2000prf.google groups.com>,
    Tomás Ó hÉilidhe <toe@lavabit.co mwrote:
    >
    >(I have posted this separately to comp.lang.c++ and comp.lang.c,
    >reason being that I'd like a response from both communities, but I
    >haven't cross-posted it because I think it's best not to mix C and C++
    >discussion)
    >
    >I want to get into doing some network programming.
    To quote the great CBF, "Stop right there!"

    To quote the not-so great Kenny McC:

    Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

    --
    Useful clc-related links:





    Comment

    • Ian Collins

      #3
      Re: What's the most raw networking library?

      Tomás Ó hÉilidhe wrote:
      >
      I want to get into doing some network programming. I'd like to find a
      good cross-platform networking library, but failing that, I'd settle
      for something that'll work on Linux. I don't mind whether the libary
      is C or whether it's C++, I'll work with either.
      >
      Just use the BSD socket API, which is ported to just about every
      platform that supports networking. comp.unix.progr ammer would be a
      better place to ask about raw mode.

      --
      Ian Collins.

      Comment

      Working...