Commits on May 24, 2011
  1. @msantos
  2. @msantos

    Merge branch 'dev'

    msantos committed May 24, 2011
  3. @msantos
  4. @msantos

    Re-add support for binding to a specific IP

    Accidentally removed support for binding to an IP while trying to clean
    up the switch mangling.
    msantos committed May 24, 2011
Commits on May 21, 2011
  1. @msantos

    And fix the pasto too

    msantos committed May 21, 2011
  2. @msantos

    Invalid NULL check

    Fix check that device has been specified.
    msantos committed May 21, 2011
  3. @msantos

    Keep port number as a char pointer

    Instead of converting to an integer, keep the port as a string. This
    avoids converting the integer back to a string for getaddrinfo.
    
    Check the lengths of string arguments and return ENAMETOOLONG where it
    is exceeded. ERANGE might be more appropriate, ENAMETOOLONG is usually
    for paths.
    msantos committed May 21, 2011
Commits on May 20, 2011
  1. @msantos

    Add arity to examples

    msantos committed May 20, 2011
  2. @msantos

    Merge branch 'dev'

    msantos committed May 20, 2011
  3. @msantos

    Update the README

    msantos committed May 20, 2011
  4. @msantos

    Only look up addresses for TCP and UDP sockets

    Unbreak support for other socket types such as raw sockets and ICMP by
    skipping getaddrinfo() for non-TCP/UDP sockets. Specifically, we should
    skip lookups for anything where the family is not PF_INET, PF_INET6 and
    PF_UNSPEC and the type is not SOCK_STREAM and SOCK_DGRAM.
    msantos committed May 20, 2011
  5. @msantos

    Remove IPv6 hints flags

    Caused a failure when an IPv6 interface wasn't configured:
    
        {error, einval} = procket:open(5354, [
                {protocol, udp},
                {type, dgram},
                {family, inet6}
                ]).
    msantos committed May 20, 2011
  6. @msantos

    Use defined constant for sizing service buffer

    Use the defined constant for sizing the service buffer passed to
    getaddrinfo, just in case we decide to accept /etc/service descriptions
    in the future.
    msantos committed May 20, 2011
  7. @msantos

    Convert EAI_* errors to errno values

    Fake errno values for the EAI_* errors returned by getaddrinfo() since
    the only way for procket_cmd to return errors to Erlang is using its 1
    byte exit value (which may also conflict with the values generated by
    a signal).
    msantos committed May 20, 2011
  8. @msantos

    Underscore numbered function

    msantos committed May 19, 2011
  9. @msantos

    Support IPv6 sockets

    Add support for IPv6 sockets. By default, the protocol family PF_UNSPEC
    is used. Which family is chosen (PF_INET or PF_INET6) depends on the
    configuration of the OS (for example, on Ubuntu, this can be set in
    /etc/gai.conf). The first protocol family that returns a socket is used.
    
    To explicitly use a a family, pass the {family, Family} option to open/2.
    For IPv4, the option is inet; for IPv6, use inet6.
    msantos committed May 19, 2011
Commits on May 17, 2011
  1. @msantos

    Add inet6 family

    msantos committed May 17, 2011
Commits on May 16, 2011
  1. @msantos

    Ensure binaries are zero'ed

    The binaries returned by some functions are grown to indicate to the
    caller the size required, e.g., recvfrom/2 will return the number of
    bytes needed for the address parameter if the provided address structure
    is too small.
    
    enif_realloc_binary() does not zero allocated bytes, so internal VM data
    may be leaked out to the caller.
    
    Create a macro to resize binaries that zero's any trailing data.
    msantos committed May 16, 2011
  2. @msantos

    Initialize var

    msantos committed May 16, 2011
  3. @msantos
Commits on May 15, 2011
  1. @msantos
  2. @msantos

    Move examples out of source directory

    Examples are no longer built by default.
    msantos committed May 15, 2011
  3. @msantos

    Rename the mktmp utility module

    To avoid future module name conflicts, put the mktmp utility module into
    a procket namespace.
    msantos committed May 15, 2011
  4. @msantos
  5. @msantos

    sh printf is portable

    msantos committed May 15, 2011
  6. @msantos

    Adjust exit values

    Return -1 (unknown error) for usage errors. Fake an "invalid" errno
    value for invalid addresses.
    msantos committed May 14, 2011
  7. @msantos
Commits on May 14, 2011
  1. @msantos

    Fix libancillary arch

    msantos committed May 14, 2011
  2. @msantos

    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).
    msantos committed May 14, 2011
  3. @msantos

    Consistent return values from procket executable

    Remove macros and consistently return error codes.
    msantos committed May 14, 2011
  4. @msantos

    Consistently return errors from functions

    Do not exit from functions. Check the return values of operations.
    msantos committed May 14, 2011
  5. @msantos
Commits on May 13, 2011
  1. @msantos
  2. @msantos

    Add constant for max device name

    msantos committed May 13, 2011
  3. @msantos

    Simplify pad calculation

    msantos committed May 13, 2011