Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Dec 01, 2013

  1. Michael Santos

    Allow setting the backlog on privileged sockets

    authored

Nov 30, 2013

  1. Michael Santos

    procket_cmd: increase backlog to SOMAXCONN

    authored

May 03, 2013

  1. Michael Santos

    Whitespace cleanup

    authored
  2. Michael Santos

    Copyright heartbeat, adjust version to semver

    authored

Jul 29, 2012

  1. Michael Santos

    Figure out how to run procket setuid helper

    Modify the way the procket external setuid helper binary is called based
    on:
    
    * whether a progname has explicitly been passed in (run the command
      immediately)
    
    * if the procket helper is setuid/setgid (run the command immediately)
    
    * if a device is requested to be opened, check the access rights of the
      process (if read/write, run command immediately)
    
    * otherwise, use sudo
    authored

Jun 17, 2011

  1. Michael Santos

    Mac OS X: ensure tun/tap device is non-blocking

    On OS X, reads from a tun dev block even with the O_NONBLOCK flag set
    on open. Work around this by setting non-blocking mode after open.
    authored

May 24, 2011

  1. Michael Santos

    Avoid service lookup for port number

    authored

May 21, 2011

  1. Michael Santos

    And fix the pasto too

    authored
  2. Michael Santos

    Invalid NULL check

    Fix check that device has been specified.
    authored
  3. Michael Santos

    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.
    authored

May 20, 2011

  1. Michael Santos

    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.
    authored
  2. Michael Santos

    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}
                ]).
    authored
  3. Michael Santos

    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.
    authored
  4. Michael Santos

    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).
    authored
  5. Michael Santos

    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.
    authored

May 15, 2011

  1. Michael Santos

    Adjust exit values

    Return -1 (unknown error) for usage errors. Fake an "invalid" errno
    value for invalid addresses.
    authored
  2. Michael Santos

    Correct error check for inet_aton

    authored

May 14, 2011

  1. Michael Santos

    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).
    authored
  2. Michael Santos

    Consistent return values from procket executable

    Remove macros and consistently return error codes.
    authored
  3. Michael Santos

    Consistently return errors from functions

    Do not exit from functions. Check the return values of operations.
    authored
  4. Michael Santos

    cleanup: move some checks to separate functions

    authored

May 03, 2011

  1. Michael Santos

    Allow '/' in character device name

    Accomodate character devices kept in a directory under /dev, e.g.,
    the tun device in /dev/net/tun.
    authored

Apr 18, 2011

  1. Michael Santos

    Attempt to open the device in non-blocking mode

    authored
  2. Michael Santos

    Allow setuid open of any character device

    Make the bpf device code generic so that the spawned setuid procket
    executable is able to open any character device.
    
    The code first checks the multiplex device (e.g., /dev/bpf). If it exists
    and no error occurs, the fd is returned to the Erlang side.
    
    If the muliplexing device does not exist or is not a character device,
    the code will fall back to trying numbered devices.
    authored

Apr 17, 2011

  1. Michael Santos

    Initial support for BPF on BSDs

    Add support for sending and receiving raw frames on BSD systems.
    Only tested on Mac OS X. The bpf module calls the C interface with
    the appropriate parameters.
    authored

Mar 20, 2011

  1. Michael Santos

    Unnecessary cast

    authored

Oct 30, 2010

  1. Michael Santos

    Fix b0rken macro

    Return an error rather than exit'ing immediately
    authored
  2. Michael Santos

    Support the interface option only under Linux

    Ignore the interface option on OS'es that do not support SO_BINDTODEVICE.
    authored
  3. Michael Santos

    Ensure the interace name is null terminated

    authored

Oct 06, 2010

  1. Added option to bind a socket to a specific interface

    klaar authored

May 29, 2010

  1. Michael Santos

    Add NIF versions of recvfrom/sendto

    sendto is untested and disabled. Make sockets non-blocking for NIF
    sendto/recvfrom. Cache atoms and clean up corresponding error functions.
    authored

May 26, 2010

  1. Michael Santos

    Allow arbitrary socket family, type and protocol

    Simplify the procket external command by allowing the user to set
    any protocol, type and family for the socket.
    authored

May 25, 2010

  1. Michael Santos

    Remove use of setsockopt() from external command

    "Unsupported" socket options can be set from Erlang using the
    inet:setopts/2 raw option.
    authored

Jan 12, 2010

  1. Michael Santos

    Clarify help.

    authored

Jan 11, 2010

  1. Michael Santos

    Nit squashing.

    authored
Something went wrong with that request. Please try again.