chickadee » address-info

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

address-info

Description

getaddrinfo(3) binding for CHICKEN

Author

Thomas Chust

Requirements

Documentation

Address Info Record

address-info? Vprocedure

Checks whether V is an address information record.

make-address-info FAMILY TYPE HOST PORTprocedure

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.

address-info-family INFOprocedure

Extracts the address family from an address information record.

address-info-type INFOprocedure

Extracts the socket type from an address information record.

address-info-host INFOprocedure

Extracts the numeric host address from an address information record.

address-info-port INFOprocedure

Extracts the port from an address information record.

Address Info Lookup

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

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.

Contents »