[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libnet
Subject:    libnet 1.1 interface ball-rolling...
From:       "Mike D. Schiffman" <route () RESENTMENT ! INFONEXUS ! COM>
Date:       1999-12-19 17:56:25
[Download RAW message or body]


    Ok.  Time to get this going again (this IS probably a bad time since many
    people are doing family stuff, but I'm motivated so screw them).  Libnet's
    second birthday iz coming up and I'd like to have *something* in place,
    interface-wise.  So if anyone's alive, let's see what we can hammer out.

    These are just my general concerns rambled down.  Please comment..
    I'm especially looking forward to hearing from Dug.

    - First of all, I abhor typedefs.  I've never used them in my code and
      I never want to.  That being said, I think that they're probably
      necessary to promote a clean interface hiding.  I concede this one
      time.

    - I do like the idea of using a generic libnetblob_t or libnet_t
      datatype that is amorphous until cast into a particular datatype.  ie:

        struct libnet_blob
        {
            u_char flags;
            u_char *ll;     /* link layer header */
            u_char *ip;     /* ip header */
            u_char *blob;
        };
        typedef libnet_blob libnet_t;

      Maybe we could do this interface without even having explicit pointers
      for the link and IP layers...  We could incorporate them into the
      blob and let the casting work it out....?

      My rationale for having pointers inside the blob rather than an array
      of size LIBNET_MAX_BLOB_SIZE, is because they're less expensive to
      pass around.  During packet casting or initilization we can do an
      implicit malloc (which gives us more flexibility in choosing a maximum
      blob size also).  If this malloc fails, we can raise an exception.

    - The `do-everything` paradigm of a function to fill in all header
      values for a packet is what we're going to use.  It's just too unweildy,
      given that you have all the information for the packet at hand, to
      have do:

        libnet_tcp_set_seq(blah);
        libnet_tcp_set_ack(blah);
        libnet_tcp_set_control(blah);

      It's much easier, still, to call:

        libnet_tcp_set(blah, blah, ... blahn);

      It IS probably useful, however, to have macros that will change or
      set common values quickly and easily, also, probably necessary will
      a way (when a blob is typed) to assign default values to a packet.


--
It is that which none in the whole army are more intimate relations to be
maintained than with spies.  None should be more liberally rewarded.  In no
other business should greater secrecy be preserved.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic