PadicoTM

Documentation

« back to PM2 home.
Topology- discover networks and nodes

Files

file  topo-print.c
 Display the known topology.
 
file  topo-vaddr.c
 Virtual address serialization.
 
file  topo-xml.c
 XML parser and serializer for topology objects.
 
file  Topology-internals.h
 internal definitions for module Topology
 
file  topology.c
 Grid topology directory.
 
file  Topology.h
 Topology description API.
 

Data Structures

union  padico_address_kind_t
 
struct  sockaddr_pa
 
struct  padico_vaddr_s
 

Macros

#define PADICO_TOPO_UUID_SIZE   32
 
#define PADICO_TOPO_FILTER_MASK_IN   (PADICO_TOPO_FILTER_BLOCK_IN | PADICO_TOPO_FILTER_ALLOW_IN)
 
#define PADICO_TOPO_FILTER_MASK_OUT   (PADICO_TOPO_FILTER_BLOCK_OUT | PADICO_TOPO_FILTER_ALLOW_OUT)
 
#define PADICO_TOPO_FILTER_MASK_BLOCK   (PADICO_TOPO_FILTER_BLOCK_IN | PADICO_TOPO_FILTER_BLOCK_OUT)
 
#define PADICO_TOPO_FILTER_MASK_ALLOW   (PADICO_TOPO_FILTER_ALLOW_IN | PADICO_TOPO_FILTER_ALLOW_AOUT)
 
#define PORT_ANY   0
 
#define padico_topo_nodename()   padico_topo_node_getname(padico_topo_getlocalnode())
 
#define padico_topo_nodealias()   padico_topo_node_getalias(padico_topo_getlocalnode())
 
#define padico_topo_getlocalhost()   padico_topo_node_gethost(padico_topo_getlocalnode())
 
#define padico_topo_hostname()   padico_topo_host_getname(padico_topo_getlocalhost())
 
#define padico_topo_session()   padico_topo_node_getsession(padico_topo_getlocalnode())
 
#define padico_na_size()   padico_topo_network_size(padico_topo_session_getnetwork(padico_topo_session()))
 
#define padico_na_rank()   padico_topo_session_getrank(padico_topo_session(), padico_topo_getlocalnode())
 
#define AF_PADICO
 
#define PF_PADICO   AF_PADICO
 
#define AF_PADICO_MAGIC(B1, B2, B3, B4)    (((padico_address_kind_t){ .bytes = { B1, B2, B3, B4 } }).integer)
 
#define AF_PADICO_MAKE(I)    ((padico_address_kind_t){ .integer = (I) })
 
#define AF_PADICO_REVERSE(I)    ((AF_PADICO_MAKE(I)).bytes)
 
#define AF_PADICO_INET   AF_PADICO_MAGIC('I', 'N', 'E', 'T')
 
#define AF_PADICO_UNIX   AF_PADICO_MAGIC('U', 'N', 'I', 'X')
 
#define AF_PADICO_AUTO   AF_PADICO_MAGIC('A', 'U', 'T', 'O')
 
#define AF_PADICO_PAYLOAD   64
 
#define padico_sockaddr_payload(TYPE, ADDRESS)
 
#define padico_sockaddr_magic(ADDRESS)
 

Typedefs

typedef const struct topo_uuid_s * padico_topo_uuid_t
 
typedef struct topo_host_s * padico_topo_host_t
 
typedef struct topo_node_s * padico_topo_node_t
 
typedef struct topo_network_s * padico_topo_network_t
 
typedef struct topo_binding_s * padico_topo_binding_t
 
typedef const struct topo_hwaddr_s * padico_topo_hwaddr_t
 
typedef const struct topo_address_s * padico_topo_address_t
 
typedef struct topo_filter_s * padico_topo_filter_t
 
typedef struct topo_service_s * padico_topo_service_t
 
typedef struct padico_vaddr_s * padico_vaddr_t
 

Enumerations

enum  padico_topo_binding_scope_t { PADICO_TOPO_SCOPE_NONE = 0x00 , PADICO_TOPO_SCOPE_NODE = 0x01 , PADICO_TOPO_SCOPE_HOST = 0x02 , PADICO_TOPO_SCOPE_ALL = 0xFF }
 
enum  padico_topo_addr_visibility_t {
  PADICO_TOPO_ADDR_VISIBILITY_NONE = 0 , PADICO_TOPO_ADDR_VISIBILITY_LOOPBACK = 1 , PADICO_TOPO_ADDR_VISIBILITY_LINKLOCAL = 2 , PADICO_TOPO_ADDR_VISIBILITY_PRIVATE = 3 ,
  PADICO_TOPO_ADDR_VISIBILITY_PUBLIC = 4
}
 
enum  padico_topo_filter_policy_t {
  _PADICO_TOPO_FILTER_NONE = 0x00 , PADICO_TOPO_FILTER_BLOCK_IN = 0x01 , PADICO_TOPO_FILTER_BLOCK_OUT = 0x02 , PADICO_TOPO_FILTER_ALLOW_IN = 0x04 ,
  PADICO_TOPO_FILTER_ALLOW_OUT = 0x08 , _PADICO_TOPO_FILTER_MAX
}
 

Functions

padico_topo_host_t padico_topo_host_create (const char *hostname)
 Create new host.
 
void padico_topo_host_add_name (padico_topo_host_t host, const char *name, int resolvable)
 Add a name to a host;.
 
void padico_topo_host_add_service (padico_topo_host_t host, const char *service_name, uint16_t service_port)
 Add a service to a host.
 
void padico_topo_host_add_property (padico_topo_host_t host, const char *label, const char *name)
 Add a property to a host.
 
padico_topo_host_t padico_topo_host_resolve_byinaddr (const struct in_addr *addr)
 Get a host description record from an inet address (create if it didn't exist)
 
padico_topo_host_t padico_topo_host_getbyinaddr (const struct in_addr *addr)
 Get a host from an inet address (return NULL if host doesn't exist).
 
padico_topo_host_t padico_topo_host_resolve_byin6addr (const struct in6_addr *addr)
 Get a host description record from an inet6 address (create if it didn't exist)
 
padico_topo_host_t padico_topo_host_getbyin6addr (const struct in6_addr *addr)
 Get a host from an inet6 address (return NULL if host doesn't exist).
 
padico_topo_host_t padico_topo_host_resolvebyname (const char *hostname)
 Get a host description record (lookup in cache, create if it didn't exist)
 
const char * padico_topo_host_getname (padico_topo_host_t host)
 Get the canonical name of a host.
 
const char * padico_topo_host_getname2 (padico_topo_host_t host, padico_topo_network_t network)
 Get the canonical name of a host on a network.
 
const struct in_addr * padico_topo_host_getaddr (padico_topo_host_t host)
 Get the canonical IP address of a host.
 
const struct in_addr * padico_topo_host_getaddr2 (padico_topo_host_t host, padico_topo_network_t network)
 Get the canonical IP address of a host on a network.
 
padico_topo_binding_vect_t padico_topo_host_getbindings (padico_topo_host_t host, padico_topo_network_t network)
 Get the bindings of a host on a network.
 
padico_topo_node_vect_t padico_topo_host_getnodes (padico_topo_host_t host)
 Get the nodes on a host.
 
void padico_topo_host_getnetworks (padico_topo_host_t host, padico_topo_network_vect_t networks)
 Get the networks a host is connected to.
 
int padico_topo_host_getservice (padico_topo_host_t host, char *service_name)
 Get the service port of the service on a host.
 
const char * padico_topo_host_getproperty (padico_topo_host_t host, const char *label)
 Get property on a host.
 
int padico_topo_host_can_output (padico_topo_host_t host, padico_topo_network_t network, uint16_t port, int protocol)
 Verify if the port is filtered output between host and network.
 
int padico_topo_host_can_input (padico_topo_host_t host, padico_topo_network_t network, uint16_t port, int protocol)
 Verify if the port is filtered input between host and network.
 
int padico_topo_network_can_input (padico_topo_network_t subnet, padico_topo_network_t network, uint16_t port, int protocol)
 
int padico_topo_network_can_output (padico_topo_network_t subnet, padico_topo_network_t network, uint16_t port, int protocol)
 
padico_topo_binding_t padico_topo_host_bind (padico_topo_host_t host, padico_topo_network_t network, const void *address)
 Declare a new binding for a host.
 
padico_topo_host_vect_t padico_topo_gethosts ()
 Get known hosts.
 
static padico_topo_node_t padico_topo_host_getnode (padico_topo_host_t host)
 Get the first node of a host.
 
padico_topo_node_t padico_topo_getnodebyname (const char *nodename)
 node lookup, by node name
 
padico_topo_node_t padico_topo_getnodebyuuid (padico_topo_uuid_t uuid)
 node lookup, by UUID
 
padico_topo_uuid_t padico_topo_node_getuuid (padico_topo_node_t node)
 Get the UUID of a node.
 
const char * padico_topo_node_getname (padico_topo_node_t node)
 Get the canonical name of a node.
 
padico_topo_host_t padico_topo_node_gethost (padico_topo_node_t node)
 Get the host hosting a node.
 
padico_topo_address_t padico_topo_node_getaddress (padico_topo_node_t node, padico_topo_network_t network)
 Get the address of the node in the given network.
 
const char * padico_topo_node_getsession (padico_topo_node_t node)
 Get the boot session ID.
 
void padico_topo_node_getnetworks (padico_topo_node_t node, padico_topo_network_vect_t networks)
 Get the networks a node is connected to.
 
void padico_topo_node_disconnect (padico_topo_node_t node)
 Remove a disconnected node from topology.
 
padico_topo_binding_t padico_topo_node_bind (padico_topo_node_t node, padico_topo_network_t network, const void *address)
 Declare a new binding for a node.
 
padico_topo_network_t padico_topo_network_create (const char *id, padico_topo_binding_scope_t scope, size_t addr_size, int family)
 
padico_topo_network_t padico_topo_network_getbyid (const char *network_id)
 
padico_topo_network_vect_t padico_topo_networks_getbyfamily (int family)
 Get networks of a given address family (e.g.
 
int padico_topo_network_contains_node (padico_topo_network_t network, padico_topo_node_t node)
 tests whether the given node belong to the network
 
const char * padico_topo_network_getname (padico_topo_network_t network)
 
int padico_topo_network_size (padico_topo_network_t network)
 
padico_topo_host_t padico_topo_network_gethostbyaddr (padico_topo_network_t, const void *)
 Get a host description record from an address.
 
padico_topo_node_t padico_topo_network_getnodebyaddr (padico_topo_network_t network, const void *addr)
 Get a node descriptor from an address.
 
void padico_topo_network_gethosts (padico_topo_network_t n, padico_topo_host_vect_t hosts)
 
void padico_topo_network_get_common_host (padico_topo_network_t n1, padico_topo_network_t n2, padico_topo_host_vect_t hosts)
 
void padico_topo_network_set_perf (padico_topo_network_t n, int latency_nsec, int bandwidth_kbps)
 
void padico_topo_network_get_perf (padico_topo_network_t n, int *latency_nsec, int *bandwidth_kbps)
 
padico_string_t padico_topo_host_serialize (padico_topo_host_t host)
 
padico_string_t padico_topo_node_serialize (padico_topo_node_t node)
 
padico_string_t padico_topo_network_serialize (padico_topo_network_t net)
 
padico_string_t padico_na_topology_serialize (padico_topo_binding_scope_t scope)
 
const void * padico_topo_address_getbytes (padico_topo_address_t address)
 
padico_topo_node_t padico_topo_getlocalnode (void)
 
static padico_topo_network_t padico_topo_session_getnetwork (const char *session_id)
 
static padico_topo_node_t padico_topo_session_getnodebyrank (const char *session_id, int rank)
 
static int padico_topo_session_getrank (const char *session_id, padico_topo_node_t node)
 
padico_topo_hwaddr_t padico_topo_hwaddr_create (const char *name, int index, int type, size_t len, const void *addr)
 
void padico_topo_hwaddr_get (padico_topo_hwaddr_t hwaddr, const char **name, int *index, int *type, size_t *len, const void **addr)
 
void padico_topo_hwaddr_add (padico_topo_host_t host, padico_topo_hwaddr_t *_hwaddr)
 
void padico_topo_hwaddr_destroy (padico_topo_hwaddr_t hwaddr)
 
void padico_topo_binding_add_addr (padico_topo_binding_t binding, const void *addr)
 
void padico_topo_binding_add_index (padico_topo_binding_t binding, int64_t index)
 
void padico_topo_binding_add_hwaddr (padico_topo_binding_t binding, padico_topo_hwaddr_t hwaddr)
 
void padico_topo_binding_add_gw_addr (padico_topo_binding_t binding, struct in_addr *inaddr)
 
void padico_topo_binding_add_hostname (padico_topo_binding_t binding, const char *name)
 
void padico_topo_binding_add_route (padico_topo_binding_t binding, padico_topo_network_t dest, const void *gwaddr)
 
void padico_topo_binding_add_filter (padico_topo_binding_t binding, padico_topo_filter_policy_t policy, uint16_t port, int protocol)
 
void padico_topo_binding_add_perf (padico_topo_binding_t binding, int latency, int bandwidth)
 
void padico_topo_binding_get_perf (padico_topo_binding_t binding, int *latency_nsec, int *bandwidth_kbps)
 
padico_topo_hwaddr_t padico_topo_binding_gethwaddr (padico_topo_binding_t binding)
 
int padico_topo_binding_get_index (padico_topo_binding_t binding, int64_t *index)
 
padico_topo_addr_visibility_t padico_topo_inet_visibility (in_addr_t _inaddr)
 
padico_topo_addr_visibility_t padico_topo_inet6_visibility (const struct in6_addr *in6addr)
 
void padico_sockaddr_init (struct sockaddr_pa *addr, socklen_t *addrlen, int magic)
 
int padico_sockaddr_check (const struct sockaddr_pa *addr, int magic)
 
padico_string_t padico_vaddr_marshall (const struct padico_vaddr_s *)
 
padico_vaddr_t padico_vaddr_unmarshall (const char *)
 
static padico_vaddr_t padico_vaddr_new (struct sockaddr *addr, socklen_t addrlen, int proto)
 
static void padico_vaddr_delete (padico_vaddr_t vaddr)
 

Variables

typdef struct padico_topo_node_vect_s * padico_topo_node_vect_t
 
typdef struct padico_topo_network_vect_s * padico_topo_network_vect_t
 
typdef struct padico_topo_host_vect_s * padico_topo_host_vect_t
 
typdef struct padico_topo_binding_vect_s * padico_topo_binding_vect_t
 

Detailed Description

Macro Definition Documentation

◆ AF_PADICO

#define AF_PADICO
Value:
(AF_MAX + 1) /* just to make sure that AF_PADICO addresses
are never leaked into the OS... */
static int done
Definition console-mod.c:49

Definition at line 409 of file Topology.h.

◆ AF_PADICO_AUTO

#define AF_PADICO_AUTO   AF_PADICO_MAGIC('A', 'U', 'T', 'O')

Definition at line 427 of file Topology.h.

◆ AF_PADICO_INET

#define AF_PADICO_INET   AF_PADICO_MAGIC('I', 'N', 'E', 'T')

Definition at line 423 of file Topology.h.

◆ AF_PADICO_MAGIC

#define AF_PADICO_MAGIC (   B1,
  B2,
  B3,
  B4 
)     (((padico_address_kind_t){ .bytes = { B1, B2, B3, B4 } }).integer)

Definition at line 413 of file Topology.h.

◆ AF_PADICO_MAKE

#define AF_PADICO_MAKE (   I)     ((padico_address_kind_t){ .integer = (I) })

Definition at line 416 of file Topology.h.

◆ AF_PADICO_PAYLOAD

#define AF_PADICO_PAYLOAD   64

Definition at line 429 of file Topology.h.

◆ AF_PADICO_REVERSE

#define AF_PADICO_REVERSE (   I)     ((AF_PADICO_MAKE(I)).bytes)

Definition at line 419 of file Topology.h.

◆ AF_PADICO_UNIX

#define AF_PADICO_UNIX   AF_PADICO_MAGIC('U', 'N', 'I', 'X')

Definition at line 425 of file Topology.h.

◆ padico_na_rank

Examples
Tests/VIO/vio-test.c.

Definition at line 324 of file Topology.h.

◆ padico_na_size

Definition at line 323 of file Topology.h.

◆ padico_sockaddr_magic

#define padico_sockaddr_magic (   ADDRESS)
Value:
( assert(((struct sockaddr_pa*)(ADDRESS))->spa_family == AF_PADICO), \
((struct sockaddr_pa*)(ADDRESS))->spa_magic )
assert(slab_size > 0)
#define AF_PADICO
Definition Topology.h:409
uint32_t spa_magic
Definition Topology.h:434

Definition at line 445 of file Topology.h.

◆ padico_sockaddr_payload

#define padico_sockaddr_payload (   TYPE,
  ADDRESS 
)
Value:
( assert(sizeof(TYPE) <= AF_PADICO_PAYLOAD), \
(TYPE*)(((struct sockaddr_pa*)(ADDRESS))->spa_payload) )
#define AF_PADICO_PAYLOAD
Definition Topology.h:429

Definition at line 441 of file Topology.h.

◆ PADICO_TOPO_FILTER_MASK_ALLOW

#define PADICO_TOPO_FILTER_MASK_ALLOW   (PADICO_TOPO_FILTER_ALLOW_IN | PADICO_TOPO_FILTER_ALLOW_AOUT)

Definition at line 120 of file Topology.h.

◆ PADICO_TOPO_FILTER_MASK_BLOCK

#define PADICO_TOPO_FILTER_MASK_BLOCK   (PADICO_TOPO_FILTER_BLOCK_IN | PADICO_TOPO_FILTER_BLOCK_OUT)

Definition at line 119 of file Topology.h.

◆ PADICO_TOPO_FILTER_MASK_IN

#define PADICO_TOPO_FILTER_MASK_IN   (PADICO_TOPO_FILTER_BLOCK_IN | PADICO_TOPO_FILTER_ALLOW_IN)

Definition at line 117 of file Topology.h.

◆ PADICO_TOPO_FILTER_MASK_OUT

#define PADICO_TOPO_FILTER_MASK_OUT   (PADICO_TOPO_FILTER_BLOCK_OUT | PADICO_TOPO_FILTER_ALLOW_OUT)

Definition at line 118 of file Topology.h.

◆ padico_topo_getlocalhost

#define padico_topo_getlocalhost ( )    padico_topo_node_gethost(padico_topo_getlocalnode())

Definition at line 319 of file Topology.h.

◆ padico_topo_hostname

#define padico_topo_hostname ( )    padico_topo_host_getname(padico_topo_getlocalhost())

Definition at line 320 of file Topology.h.

◆ padico_topo_nodealias

#define padico_topo_nodealias ( )    padico_topo_node_getalias(padico_topo_getlocalnode())

Definition at line 318 of file Topology.h.

◆ padico_topo_nodename

#define padico_topo_nodename ( )    padico_topo_node_getname(padico_topo_getlocalnode())

Definition at line 317 of file Topology.h.

◆ padico_topo_session

#define padico_topo_session ( )    padico_topo_node_getsession(padico_topo_getlocalnode())

Definition at line 321 of file Topology.h.

◆ PADICO_TOPO_UUID_SIZE

#define PADICO_TOPO_UUID_SIZE   32

Definition at line 73 of file Topology.h.

◆ PF_PADICO

#define PF_PADICO   AF_PADICO

Definition at line 410 of file Topology.h.

◆ PORT_ANY

#define PORT_ANY   0

Definition at line 122 of file Topology.h.

Typedef Documentation

◆ padico_topo_address_t

◆ padico_topo_binding_t

◆ padico_topo_filter_t

◆ padico_topo_host_t

Definition at line 75 of file Topology.h.

◆ padico_topo_hwaddr_t

◆ padico_topo_network_t

◆ padico_topo_node_t

Definition at line 76 of file Topology.h.

◆ padico_topo_service_t

◆ padico_topo_uuid_t

◆ padico_vaddr_t

Definition at line 467 of file Topology.h.

Enumeration Type Documentation

◆ padico_topo_addr_visibility_t

Enumerator
PADICO_TOPO_ADDR_VISIBILITY_NONE 
PADICO_TOPO_ADDR_VISIBILITY_LOOPBACK 

loopback address- only local node/host can see it

PADICO_TOPO_ADDR_VISIBILITY_LINKLOCAL 

link-local address- nodes on the same physical link can see it

PADICO_TOPO_ADDR_VISIBILITY_PRIVATE 

private address- some node/host cannot see it

PADICO_TOPO_ADDR_VISIBILITY_PUBLIC 

public address

Definition at line 99 of file Topology.h.

◆ padico_topo_binding_scope_t

Enumerator
PADICO_TOPO_SCOPE_NONE 
PADICO_TOPO_SCOPE_NODE 
PADICO_TOPO_SCOPE_HOST 
PADICO_TOPO_SCOPE_ALL 

Definition at line 91 of file Topology.h.

◆ padico_topo_filter_policy_t

Enumerator
_PADICO_TOPO_FILTER_NONE 
PADICO_TOPO_FILTER_BLOCK_IN 
PADICO_TOPO_FILTER_BLOCK_OUT 
PADICO_TOPO_FILTER_ALLOW_IN 
PADICO_TOPO_FILTER_ALLOW_OUT 
_PADICO_TOPO_FILTER_MAX 

Definition at line 108 of file Topology.h.

Function Documentation

◆ padico_na_topology_serialize()

◆ padico_sockaddr_check()

int padico_sockaddr_check ( const struct sockaddr_pa *  addr,
int  magic 
)

◆ padico_sockaddr_init()

void padico_sockaddr_init ( struct sockaddr_pa *  addr,
socklen_t *  addrlen,
int  magic 
)

◆ padico_topo_address_getbytes()

const void * padico_topo_address_getbytes ( padico_topo_address_t  address)

Definition at line 2342 of file topology.c.

References topo_address_s::_addr_storage.

Referenced by padico_topo_session_getrank().

◆ padico_topo_binding_add_addr()

◆ padico_topo_binding_add_filter()

void padico_topo_binding_add_filter ( padico_topo_binding_t  binding,
padico_topo_filter_policy_t  policy,
uint16_t  port,
int  protocol 
)

◆ padico_topo_binding_add_gw_addr()

void padico_topo_binding_add_gw_addr ( padico_topo_binding_t  binding,
struct in_addr *  inaddr 
)

Definition at line 213 of file topology.c.

References done, NULL, p, topo_binding_s::props, and TOPO_PROPERTY_GW_ADDR.

Referenced by topo_inet_route_detect().

◆ padico_topo_binding_add_hostname()

void padico_topo_binding_add_hostname ( padico_topo_binding_t  binding,
const char *  name 
)

◆ padico_topo_binding_add_hwaddr()

◆ padico_topo_binding_add_index()

void padico_topo_binding_add_index ( padico_topo_binding_t  binding,
int64_t  index 
)

◆ padico_topo_binding_add_perf()

void padico_topo_binding_add_perf ( padico_topo_binding_t  binding,
int  latency,
int  bandwidth 
)

Definition at line 273 of file topology.c.

References done, topo_binding_s::props, and TOPO_PROPERTY_PERF.

Referenced by topo_detect_link_perf().

◆ padico_topo_binding_add_route()

◆ padico_topo_binding_get_index()

int padico_topo_binding_get_index ( padico_topo_binding_t  binding,
int64_t *  index 
)

◆ padico_topo_binding_get_perf()

void padico_topo_binding_get_perf ( padico_topo_binding_t  binding,
int *  latency_nsec,
int *  bandwidth_kbps 
)

◆ padico_topo_binding_gethwaddr()

◆ padico_topo_gethosts()

padico_topo_host_vect_t padico_topo_gethosts ( )

Get known hosts.

Definition at line 2211 of file topology.c.

References done, e, host, topo_host_s::hostname, padico_topology_s::hostsbyname, na_topology, name, and padico_topo_host_vect_t.

Referenced by nsbe_dijkstra_init().

◆ padico_topo_getlocalnode()

◆ padico_topo_getnodebyname()

◆ padico_topo_getnodebyuuid()

◆ padico_topo_host_add_name()

void padico_topo_host_add_name ( padico_topo_host_t  host,
const char *  name,
int  resolvable 
)

◆ padico_topo_host_add_property()

void padico_topo_host_add_property ( padico_topo_host_t  host,
const char *  label,
const char *  name 
)

Add a property to a host.

Definition at line 1595 of file topology.c.

References done, host, topo_property_s::label, padico_topo_host_getproperty(), topo_host_s::props, TOPO_PROPERTY_MISC, and topo_property_s::value.

Referenced by topology_populate().

◆ padico_topo_host_add_service()

void padico_topo_host_add_service ( padico_topo_host_t  host,
const char *  service_name,
uint16_t  service_port 
)

◆ padico_topo_host_bind()

◆ padico_topo_host_can_input()

int padico_topo_host_can_input ( padico_topo_host_t  host,
padico_topo_network_t  network,
uint16_t  port,
int  protocol 
)

Verify if the port is filtered input between host and network.

Definition at line 2146 of file topology.c.

References e, host, network, PADICO_TOPO_FILTER_ALLOW_IN, padico_topo_host_policy(), port, and topo_net_entity_s::TOPO_ENTITY_HOST.

Referenced by ns_besteffort_selector_2networks(), ns_besteffort_selector_dijkstra(), and nsbe_dijkstra_init().

◆ padico_topo_host_can_output()

int padico_topo_host_can_output ( padico_topo_host_t  host,
padico_topo_network_t  network,
uint16_t  port,
int  protocol 
)

Verify if the port is filtered output between host and network.

Definition at line 2154 of file topology.c.

References e, host, network, PADICO_TOPO_FILTER_ALLOW_OUT, padico_topo_host_policy(), port, and topo_net_entity_s::TOPO_ENTITY_HOST.

Referenced by ns_besteffort_selector_2networks(), ns_besteffort_selector_dijkstra(), and nsbe_dijkstra_init().

◆ padico_topo_host_create()

padico_topo_host_t padico_topo_host_create ( const char *  hostname)

Create new host.

Create new host.

Note
this function takes ownership of memory pointed by 'fqdn' (supposed to be malloced)

Definition at line 1463 of file topology.c.

References topo_host_s::bindings, done, topo_host_s::hnames, host, padico_topology_s::host_table, topo_host_s::hostname, topo_host_s::hwaddrs, na_topology, topo_host_s::nodes, padico_topo_host_add_name(), and topo_host_s::props.

Referenced by g5k_compute_nodes(), padico_topo_host_resolvebyname(), topo_host_from_hostent(), topo_host_start_handler(), and topology_populate().

◆ padico_topo_host_getaddr()

◆ padico_topo_host_getaddr2()

const struct in_addr * padico_topo_host_getaddr2 ( padico_topo_host_t  host,
padico_topo_network_t  network 
)

Get the canonical IP address of a host on a network.

Definition at line 2034 of file topology.c.

References topo_host_s::bindings, done, topo_network_s::family, host, i, network, NULL, and topo_address_as_inaddr().

Referenced by ns_besteffort_selector_2networks(), and padico_topo_host_getname2().

◆ padico_topo_host_getbindings()

padico_topo_binding_vect_t padico_topo_host_getbindings ( padico_topo_host_t  host,
padico_topo_network_t  network 
)

Get the bindings of a host on a network.

The caller takes ownership of the result.

Definition at line 2020 of file topology.c.

References b, topo_host_s::bindings, done, host, i, network, and padico_topo_binding_vect_t.

Referenced by padico_nsbe_rule_resolve().

◆ padico_topo_host_getbyin6addr()

padico_topo_host_t padico_topo_host_getbyin6addr ( const struct in6_addr *  addr)

Get a host from an inet6 address (return NULL if host doesn't exist).

Definition at line 2438 of file topology.c.

References done, host, i, NULL, padico_topo_network_gethostbyaddr(), padico_topo_network_vect_t, and padico_topo_networks_getbyfamily().

Referenced by padico_topo_host_resolve_byin6addr(), and vlink_resolver_resolve_node().

◆ padico_topo_host_getbyinaddr()

padico_topo_host_t padico_topo_host_getbyinaddr ( const struct in_addr *  addr)

Get a host from an inet address (return NULL if host doesn't exist).

Definition at line 2424 of file topology.c.

References done, host, i, NULL, padico_topo_network_gethostbyaddr(), padico_topo_network_vect_t, and padico_topo_networks_getbyfamily().

Referenced by padico_topo_host_resolve_byinaddr(), padico_vsock_sendto(), and vlink_resolver_resolve_node().

◆ padico_topo_host_getname()

◆ padico_topo_host_getname2()

const char * padico_topo_host_getname2 ( padico_topo_host_t  host,
padico_topo_network_t  network 
)

◆ padico_topo_host_getnetworks()

void padico_topo_host_getnetworks ( padico_topo_host_t  host,
padico_topo_network_vect_t  networks 
)

Get the networks a host is connected to.

Definition at line 2054 of file topology.c.

References b, topo_host_s::bindings, done, host, network, topo_binding_s::network, NULL, and topo_network_s::uplink.

Referenced by ns_besteffort_getnetworks(), and ns_besteffort_selector_host().

◆ padico_topo_host_getnode()

static padico_topo_node_t padico_topo_host_getnode ( padico_topo_host_t  host)
inlinestatic

◆ padico_topo_host_getnodes()

padico_topo_node_vect_t padico_topo_host_getnodes ( padico_topo_host_t  host)

◆ padico_topo_host_getproperty()

◆ padico_topo_host_getservice()

int padico_topo_host_getservice ( padico_topo_host_t  host,
char *  service_name 
)

Get the service port of the service on a host.

Definition at line 2178 of file topology.c.

References done, host, topo_service_s::name, p, topo_service_s::port, topo_host_s::props, topo_property_s::service, and TOPO_PROPERTY_SERVICE.

Referenced by ns_besteffort_selector_dijkstra(), and nsbe_dijkstra_init().

◆ padico_topo_host_resolve_byin6addr()

padico_topo_host_t padico_topo_host_resolve_byin6addr ( const struct in6_addr *  addr)

Get a host description record from an inet6 address (create if it didn't exist)

Definition at line 2466 of file topology.c.

References done, host, padico_topo_host_getbyin6addr(), and padico_topo_host_resolvebyname().

Referenced by vlink_resolver_resolve_host().

◆ padico_topo_host_resolve_byinaddr()

padico_topo_host_t padico_topo_host_resolve_byinaddr ( const struct in_addr *  addr)

Get a host description record from an inet address (create if it didn't exist)

Definition at line 2452 of file topology.c.

References done, host, padico_topo_host_getbyinaddr(), and padico_topo_host_resolvebyname().

Referenced by nsdb_create_host(), remote_control_init(), sfrfw_connect(), sfsrtun_connect(), and vlink_resolver_resolve_host().

◆ padico_topo_host_resolvebyname()

◆ padico_topo_host_serialize()

◆ padico_topo_hwaddr_add()

◆ padico_topo_hwaddr_create()

◆ padico_topo_hwaddr_destroy()

void padico_topo_hwaddr_destroy ( padico_topo_hwaddr_t  hwaddr)

Definition at line 175 of file topology.c.

References done.

Referenced by topo_inet_route_detect().

◆ padico_topo_hwaddr_get()

void padico_topo_hwaddr_get ( padico_topo_hwaddr_t  hwaddr,
const char **  name,
int *  index,
int *  type,
size_t *  len,
const void **  addr 
)

◆ padico_topo_inet6_visibility()

◆ padico_topo_inet_visibility()

◆ padico_topo_network_can_input()

int padico_topo_network_can_input ( padico_topo_network_t  subnet,
padico_topo_network_t  network,
uint16_t  port,
int  protocol 
)

◆ padico_topo_network_can_output()

int padico_topo_network_can_output ( padico_topo_network_t  subnet,
padico_topo_network_t  network,
uint16_t  port,
int  protocol 
)

◆ padico_topo_network_contains_node()

int padico_topo_network_contains_node ( padico_topo_network_t  network,
padico_topo_node_t  node 
)

tests whether the given node belong to the network

Definition at line 2259 of file topology.c.

References topo_node_s::bindings, na_bindings_vect_contains_network(), network, and node.

◆ padico_topo_network_create()

◆ padico_topo_network_get_common_host()

void padico_topo_network_get_common_host ( padico_topo_network_t  n1,
padico_topo_network_t  n2,
padico_topo_host_vect_t  hosts 
)

Definition at line 2300 of file topology.c.

References b2, done, and PADICO_TOPO_SCOPE_HOST.

◆ padico_topo_network_get_perf()

void padico_topo_network_get_perf ( padico_topo_network_t  n,
int *  latency_nsec,
int *  bandwidth_kbps 
)

Definition at line 2333 of file topology.c.

References done, n, and NULL.

◆ padico_topo_network_getbyid()

◆ padico_topo_network_gethostbyaddr()

padico_topo_host_t padico_topo_network_gethostbyaddr ( padico_topo_network_t  network,
const void *  _addr 
)

◆ padico_topo_network_gethosts()

void padico_topo_network_gethosts ( padico_topo_network_t  n,
padico_topo_host_vect_t  hosts 
)

Definition at line 2284 of file topology.c.

References b, done, e, n, and PADICO_TOPO_SCOPE_HOST.

Referenced by nsbe_dijkstra_init().

◆ padico_topo_network_getname()

◆ padico_topo_network_getnodebyaddr()

padico_topo_node_t padico_topo_network_getnodebyaddr ( padico_topo_network_t  network,
const void *  addr 
)

Get a node descriptor from an address.

Definition at line 2382 of file topology.c.

References assert(), done, na_network_getentity_byaddr(), network, topo_net_entity_s::node, PADICO_TOPO_SCOPE_NODE, and topo_network_s::scope.

Referenced by padico_topo_session_getnodebyrank().

◆ padico_topo_network_serialize()

◆ padico_topo_network_set_perf()

void padico_topo_network_set_perf ( padico_topo_network_t  n,
int  latency_nsec,
int  bandwidth_kbps 
)

Definition at line 2324 of file topology.c.

References assert(), done, n, and NULL.

Referenced by padico_ibv_create_port().

◆ padico_topo_network_size()

int padico_topo_network_size ( padico_topo_network_t  network)

Definition at line 2237 of file topology.c.

References topo_network_s::bindings, done, and network.

Referenced by control_bootstrap_init(), and control_bootstrap_pmi2_init().

◆ padico_topo_networks_getbyfamily()

padico_topo_network_vect_t padico_topo_networks_getbyfamily ( int  family)

Get networks of a given address family (e.g.

AF_INET, AF_INET6, etc.)

Definition at line 2365 of file topology.c.

References done, topo_address_s::family, i, n, na_topology, padico_topology_s::networks, and padico_topo_network_vect_t.

Referenced by nsbe_dijkstra_init(), padico_topo_host_getbyin6addr(), and padico_topo_host_getbyinaddr().

◆ padico_topo_node_bind()

padico_topo_binding_t padico_topo_node_bind ( padico_topo_node_t  node,
padico_topo_network_t  network,
const void *  address 
)

Declare a new binding for a node.

Definition at line 1618 of file topology.c.

References network, node, padico_topo_binding_add_addr(), topo_binding_bind_node(), and topo_binding_create().

Referenced by na_control_event_listener(), padico_control_init(), and topology_populate().

◆ padico_topo_node_disconnect()

void padico_topo_node_disconnect ( padico_topo_node_t  node)

Remove a disconnected node from topology.

Remove a disconnected node from topology.

Diconnect node from all its bindings, but do not destroy it since pending pointers to it may remain.

Definition at line 2766 of file topology.c.

References b, topo_node_s::bindings, topo_network_s::bindings, topo_uuid_s::bytes, topo_node_s::canonical_nodename, done, topo_node_s::host, n, network, node, topo_host_s::nodes, NULL, topo_binding_destroy(), topo_node_s::uuid, and v.

Referenced by na_control_event_listener().

◆ padico_topo_node_getaddress()

padico_topo_address_t padico_topo_node_getaddress ( padico_topo_node_t  node,
padico_topo_network_t  network 
)

Get the address of the node in the given network.

Definition at line 1898 of file topology.c.

References topo_node_s::bindings, done, i, network, topo_binding_s::network, node, NULL, PADICO_TOPO_SCOPE_NODE, and topo_network_s::scope.

Referenced by padico_topo_session_getrank().

◆ padico_topo_node_gethost()

◆ padico_topo_node_getname()

◆ padico_topo_node_getnetworks()

void padico_topo_node_getnetworks ( padico_topo_node_t  node,
padico_topo_network_vect_t  networks 
)

Get the networks a node is connected to.

Definition at line 1932 of file topology.c.

References b, topo_node_s::bindings, done, and node.

Referenced by ns_besteffort_getnetworks().

◆ padico_topo_node_getsession()

◆ padico_topo_node_getuuid()

◆ padico_topo_node_serialize()

◆ padico_topo_session_getnetwork()

static padico_topo_network_t padico_topo_session_getnetwork ( const char *  session_id)
inlinestatic

◆ padico_topo_session_getnodebyrank()

◆ padico_topo_session_getrank()

static int padico_topo_session_getrank ( const char *  session_id,
padico_topo_node_t  node 
)
inlinestatic

◆ padico_vaddr_delete()

static void padico_vaddr_delete ( padico_vaddr_t  vaddr)
inlinestatic

Definition at line 485 of file Topology.h.

Referenced by vlink_selector_connect().

◆ padico_vaddr_marshall()

◆ padico_vaddr_new()

static padico_vaddr_t padico_vaddr_new ( struct sockaddr *  addr,
socklen_t  addrlen,
int  proto 
)
inlinestatic

◆ padico_vaddr_unmarshall()

Variable Documentation

◆ padico_topo_binding_vect_t

typdef struct padico_topo_binding_vect_s* padico_topo_binding_vect_t

Definition at line 87 of file Topology.h.

Referenced by padico_nsbe_rule_resolve(), and padico_topo_host_getbindings().

◆ padico_topo_host_vect_t

typdef struct padico_topo_host_vect_s* padico_topo_host_vect_t

Definition at line 86 of file Topology.h.

Referenced by nsbe_dijkstra_init(), padico_group_topology(), and padico_topo_gethosts().

◆ padico_topo_network_vect_t

◆ padico_topo_node_vect_t