Permalink
Commits on May 15, 2011
  1. Move examples out of source directory

    Examples are no longer built by default.
    committed May 15, 2011
  2. Rename the mktmp utility module

    To avoid future module name conflicts, put the mktmp utility module into
    a procket namespace.
    committed May 15, 2011
  3. sh printf is portable

    committed May 15, 2011
  4. Adjust exit values

    Return -1 (unknown error) for usage errors. Fake an "invalid" errno
    value for invalid addresses.
    committed May 15, 2011
Commits on May 14, 2011
  1. Fix libancillary arch

    committed May 14, 2011
  2. Return POSIX atom on error from forked setuid bin

    Add a function to the NIF returning an atom from erl_errno_id().
    
    Do not distinguish between procket_cmd and procket errors. Return the
    same tuple {error, posix()} on errors.
    
    Return the POSIX value in hackish way: by echo'ing the return code
    in os:cmd/1. Otherwise, sudo may return failure (for example, if the
    user has not placed the procket command in sudoers.conf. sudo exits
    with a return value of EPERM in this case).
    committed May 14, 2011
  3. Consistent return values from procket executable

    Remove macros and consistently return error codes.
    committed May 14, 2011
  4. Consistently return errors from functions

    Do not exit from functions. Check the return values of operations.
    committed May 14, 2011
Commits on May 13, 2011
  1. Add constant for max device name

    committed May 13, 2011
  2. Simplify pad calculation

    committed May 13, 2011
Commits on May 9, 2011
  1. Mask the top 3 bits for BSD ioctl requests

    The linux calculation was copied from asm-generic/ioctl.h but looks off
    still. If the size takes >14 bits, the direction will be overwritten.
    committed May 9, 2011
  2. Merge branch 'tuntap' into dev

    committed May 9, 2011
  3. Portability pixie dust for ioctl macros

    First attempt at supporting the ioctl request macros on bsd and linux.
    The result seems to work but doesn't seem to be quite right yet.
    
    On BSD systems, the top 3 bits indicate the direction of the request:
    
    8 : ioctl parameter will be copied from user space into the kernel
    4 : ioctl parameter will be copied into the user supplied buffer from
        the kernel
    2 : no parameters are used
    
    The remaining 13 bits are used to indicate the size of the parameter.
    
    On Linux systems, only the top 2 bits are used. Setting both bits to 0
    indicates a void parameter. The meaning of the bits is reversed:
    
    8 : ioctl parameter will be copied into the user supplied buffer from
        the kernel
    4 : ioctl parameter will be copied from user space into the kernel
    
    The remaining 14 bits is used to hold the length of the parameter.
    committed May 9, 2011
  4. Support tuntap interfaces

    committed May 9, 2011
  5. Move readme

    committed May 9, 2011
Commits on May 8, 2011
  1. Convert readme to markdown

    committed May 8, 2011
Commits on May 6, 2011
  1. Fix build when included as a dep

    I hate makefiles.
    committed May 6, 2011
Commits on May 3, 2011
  1. Allow '/' in character device name

    Accomodate character devices kept in a directory under /dev, e.g.,
    the tun device in /dev/net/tun.
    committed May 3, 2011
Commits on Apr 29, 2011
  1. packet: remove filter program limit

    Instead of throwing an exception when the max program instruction length
    has been reached, return setsockopt's errno value (out of memory).
    committed Apr 29, 2011
Commits on Apr 28, 2011
  1. Remove useless cast

    committed Apr 28, 2011
Commits on Apr 27, 2011
  1. packet: pasto in endian conversion

    2 byte family field was inadvervently made into a 4 byte field and
    byte swapped.
    committed Apr 27, 2011
Commits on Apr 23, 2011
  1. Remove support for decoding datalink types

    Move the support to pkt.
    committed Apr 23, 2011
Commits on Apr 22, 2011
  1. Rename bpf:data/3 to bpf:packet/3

    Rename data -> packet to avoid confusion with the datalen (whole
    packe length) struct field. The term "packet" is used to describe
    the bpf captured content in the man page.
    committed Apr 22, 2011
Commits on Apr 21, 2011
  1. Rename bpf parsing functions

    Clarify the bpf parsing by renaming them to match the bpf_hdr
    structure.
    
    (Should bpf:data/3 really be bpf:cap/3 then?)
    committed Apr 21, 2011
  2. bpf: set immediate mode by default

    In bpf:open/1, set immediate mode. The BIOCIMMEDIATE flags allows
    a read to return immediately after a packet is received by the bpf
    device, rather than waiting for the timeout to be reached (which
    is set to 0/inifinity) or the bpf buffer to fill.
    committed Apr 21, 2011
Commits on Apr 20, 2011
  1. bpf: workaround for missing padding

    Probably due to a bug somewhere, the final 2 byte pad of some packets
    is stripped. If the real size of the data is equal to the sum of
    the capture and header length from the bpf header, set the pad to
    0.
    committed Apr 20, 2011