address-info

  1. address-info
    1. Description
    2. Author
    3. Requirements
    4. Documentation
      1. Address Info Record
      2. Address Info Lookup
    5. License

Description

getaddrinfo(3) binding for CHICKEN

Author

Thomas Chust

Requirements

Documentation

Address Info Record

[procedure] (address-info? V)

Checks whether V is an address information record.

[procedure] (make-address-info FAMILY TYPE HOST PORT)

Constructs a new address information record from the given FAMILY ('ipv4 or 'ipv6), a socket TYPE ('tcp, 'udp or 'raw), a numeric HOST address encoded as a string and a PORT that is a either a positive integer or #f.

[procedure] (address-info-family INFO)

Extracts the address family from an address information record.

[procedure] (address-info-type INFO)

Extracts the socket type from an address information record.

[procedure] (address-info-host INFO)

Extracts the numeric host address from an address information record.

[procedure] (address-info-port INFO)

Extracts the port from an address information record.

Address Info Lookup

[procedure] (address-infos HOST [#:port PORT] [#:family FAMILY] [#:type TYPE] [#:server? SERVER] [#:numeric? NUMERIC])

Tries to lookup socket addresses for the given HOST and/or PORT. If the lookup is successful, the procedure returns a list of address information records. Otherwise it returns #f.

For a successful lookup you must at least specify a HOST or a PORT. If no HOST is specified, the function defaults to server mode lookup and will return wildcard addresses. This behaviour can be changed using the SERVER flag.

By default, the procedure will return address information records for all suitable supported protocol families and socket types. The FAMILY argument may be used to filter for 'ipv4 or 'ipv6 addresses. The TYPE argument may be used to filter for 'tcp / 'stream, 'udp / 'datagram or 'raw socket types.

Unless the NUMERIC flag is set to a true value, the procedure will convert hostnames into numeric network addresses.

License

 Copyright (C) 2017 Thomas Chust <chust@web.de>.  All rights reserved.
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the Software),
 to deal in the Software without restriction, including without limitation
 the rights to use, copy, modify, merge, publish, distribute, sublicense,
 and/or sell copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.