RPKI Engine  1.0
Classes | Functions | Variables
rpki::http Namespace Reference

Classes

class  caller
class  http_client
class  http_listener
class  http_message
class  http_queue
class  http_request
class  http_response
class  http_server
class  http_stream

Functions

def addr_to_string
def client
def localhost_addrinfo
def log_method
def server
def supported_address_families

Variables

dictionary client_queues = {}
 Map of (host, port) tuples to http_queue objects.
 debug_http = False
 Verbose chatter about HTTP streams.
tuple default_client_timeout = rpki.sundial.timedelta(minutes = 5)
 Default HTTP client connection timeout.
tuple default_http_version = (1, 0)
 Preferred HTTP version.
tuple default_server_timeout = rpki.sundial.timedelta(minutes = 10)
 Default HTTP server connection timeouts.
int default_tcp_port = 80
 Default port for clients and servers that don't specify one.
 enable_ipv6_clients = False
 Whether to consider IPv6 addresses when making connections.
 enable_ipv6_servers = True
 Whether to enable IPv6 listeners.
 have_ipv6 = False
 Whether the current machine claims to support IPv6.
string rpki_content_type = "application/x-rpki"
 HTTP content type used for all RPKI messages.
 use_adns = False
 Whether to use rpki.adns code.
 want_persistent_client = False
 Whether we want persistent HTTP client streams, when server also supports them.
 want_persistent_server = False
 Whether we want persistent HTTP server streams, when client also supports them.

Detailed Description

HTTP utilities, both client and server.

$Id: http.py 4026 2011-10-07 21:43:47Z sra $

Copyright (C) 2009-2011  Internet Systems Consortium ("ISC")

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

Portions copyright (C) 2007--2008  American Registry for Internet Numbers ("ARIN")

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS.  IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

Function Documentation

def rpki::http::addr_to_string (   addr)
Convert socket addr tuple to printable string.  Assumes 2-element
tuple is IPv4, 4-element tuple is IPv6, throws TypeError for
anything else.

Definition at line 285 of file http.py.

Referenced by rpki::http::http_stream::__repr__(), rpki::http::http_listener::__repr__(), rpki::http::http_queue::__repr__(), client(), and rpki::http::http_listener::handle_accept().

Here is the caller graph for this function:

def rpki::http::client (   msg,
  url,
  callback,
  errback 
)
Open client HTTP connection, send a message, set up callbacks to
handle response.

Definition at line 940 of file http.py.

References addr_to_string().

Referenced by rpki::http::caller::__call__().

Here is the call graph for this function:

Here is the caller graph for this function:

def rpki::http::localhost_addrinfo ( )
Return pseudo-getaddrinfo results for localhost.

Definition at line 116 of file http.py.

Referenced by rpki::http::http_client::start().

Here is the caller graph for this function:

def rpki::http::log_method (   self,
  msg,
  logger = rpki.log.debug 
)
Logging method used in several different classes.

Definition at line 277 of file http.py.

def rpki::http::server (   handlers,
  port,
  host = "" 
)
Run an HTTP server and wait (forever) for connections.

Definition at line 983 of file http.py.

References supported_address_families().

Here is the call graph for this function:

def rpki::http::supported_address_families (   enable_ipv6)
IP address families on which servers should listen, and to consider
when selecting addresses for client connections.

Definition at line 106 of file http.py.

Referenced by server(), and rpki::http::http_client::start().

Here is the caller graph for this function:


Variable Documentation

Map of (host, port) tuples to http_queue objects.

Definition at line 938 of file http.py.

Verbose chatter about HTTP streams.

Definition at line 45 of file http.py.

Default HTTP client connection timeout.

Definition at line 57 of file http.py.

Preferred HTTP version.

Definition at line 68 of file http.py.

Default HTTP server connection timeouts.

Given our druthers, we'd prefer that the client close the connection, as this avoids the problem of client starting to reuse connection just as server closes it, so this should be longer than the client timeout.

Definition at line 64 of file http.py.

Default port for clients and servers that don't specify one.

Definition at line 72 of file http.py.

Whether to consider IPv6 addresses when making connections.

Disabled by default, as IPv6 connectivity is still a bad joke in far too much of the world.

Definition at line 83 of file http.py.

Whether to enable IPv6 listeners.

Enabled by default, as it should be harmless. Has no effect if kernel doesn't support IPv6.

Definition at line 77 of file http.py.

Whether the current machine claims to support IPv6.

Note that just because the kernel supports it doesn't mean that the machine has usable IPv6 connectivity. I don't know of a simple portable way to probe for connectivity at runtime (the old test of "can you ping SRI-NIC.ARPA?" seems a bit dated...). Don't set this, it's set automatically by probing using the socket() system call at runtime.

Definition at line 102 of file http.py.

rpki::http::rpki_content_type = "application/x-rpki"

HTTP content type used for all RPKI messages.

Definition at line 41 of file http.py.

Whether to use rpki.adns code.

This is still experimental, so it's not (yet) enabled by default.

Definition at line 88 of file http.py.

Whether we want persistent HTTP client streams, when server also supports them.

Definition at line 49 of file http.py.

Whether we want persistent HTTP server streams, when client also supports them.

Definition at line 53 of file http.py.

 All Classes Namespaces Files Functions Variables Properties