topo-xml.c
Go to the documentation of this file.
51 padico_string_catf(s, " <Topology:hwaddr name=\"%s\" index=\"%d\">", hwaddr->name, hwaddr->index);
85 padico_string_catf(s, " <Topology:property kind=\"addr\" family=\"%d\">%s</Topology:property>\n", addr->family, s_addr);
101 padico_string_catf(s, " <Topology:property kind=\"gwaddr\" family=\"%d\">%s</Topology:property>\n", gw_addr->family, s_addr);
111 padico_string_catf(s, " <Topology:property kind=\"hostname\" name=\"%s\"/>\n", (*p)->content.HOSTNAME.name);
118 padico_string_catf(s, " <Topology:property kind=\"filter\" policy=\"%s\" protocol=\"%s\" port=\"%d\"/>\n",
128 padico_string_catf(s, " <Topology:property kind=\"route\" network=\"%s\" gwfamily=\"%d\" gwaddr=\"%s\"/>\n",
223 padico_string_t uplink = network->uplink ? topo_binding_serialize(network->uplink) : padico_string_new();
224 padico_string_catf(s, "<Topology:network id=\"%s\" addr_size=\"%d\" scope=\"%s\" family=\"%d\">\n"
346 padico_warning("Taking first of %zd nodes candidates\n", padico_topo_node_vect_size(candidates));
assert(slab_size > 0)
internal definitions for module Topology
static padico_topo_binding_t topo_binding_create(padico_topo_network_t network)
Definition Topology-internals.h:419
typdef struct topo_hostname_vect_s * topo_hostname_vect_t
Definition Topology-internals.h:198
static padico_topo_filter_policy_t topo_filter_policy_getbyname(const char *name)
Definition Topology-internals.h:344
@ TOPO_PROPERTY_MISC
arbitrary attribute (string), without semantics
Definition Topology-internals.h:130
static const char * topo_filter_policy_getname(padico_topo_filter_policy_t policy)
Definition Topology-internals.h:358
static int topo_filter_protocol_getnumber(const char *proto_name)
frontend for getprotobyname(), working even in the absence of /etc/protocols
Definition Topology-internals.h:367
static const char * topo_filter_protocol_getname(int protocol)
frontend for getprotobynumber(), working even in the absence of /etc/protocols
Definition Topology-internals.h:387
Topology description API.
padico_string_t padico_topo_node_serialize(padico_topo_node_t node)
Definition topo-xml.c:168
padico_topo_node_vect_t padico_topo_host_getnodes(padico_topo_host_t host)
Get the nodes on a host.
Definition topology.c:2049
void padico_topo_host_add_name(padico_topo_host_t host, const char *_name, int resolvable)
Add a name to a host;.
Definition topology.c:1525
typdef struct padico_topo_binding_vect_s * padico_topo_binding_vect_t
Definition Topology.h:87
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.
Definition topology.c:1570
padico_string_t padico_topo_host_serialize(padico_topo_host_t host)
Definition topo-xml.c:184
padico_topo_network_t padico_topo_network_create(const char *id, padico_topo_binding_scope_t scope, size_t addr_size, int family)
Definition topology.c:1853
padico_string_t padico_na_topology_serialize(padico_topo_binding_scope_t scope)
Definition topo-xml.c:240
padico_topo_hwaddr_t padico_topo_hwaddr_create(const char *name, int index, int type, size_t len, const void *addr)
Definition topology.c:126
const char * padico_topo_network_getname(padico_topo_network_t network)
Definition topology.c:2233
const char * padico_topo_host_getproperty(padico_topo_host_t host, const char *label)
Get property on a host.
Definition topology.c:2195
padico_topo_network_t padico_topo_network_getbyid(const char *network_id)
Definition topology.c:2351
typdef struct padico_topo_node_vect_s * padico_topo_node_vect_t
Definition Topology.h:84
padico_topo_host_t padico_topo_host_create(const char *hostname)
Create a new 'host' record from a given canonical name.
Definition topology.c:1463
void padico_topo_hwaddr_add(padico_topo_host_t host, padico_topo_hwaddr_t *_hwaddr)
Definition topology.c:153
padico_string_t padico_topo_network_serialize(padico_topo_network_t network)
Definition topo-xml.c:220
padico_topo_node_t padico_topo_getnodebyname(const char *nodename)
node lookup, by node name
Definition topology.c:2389
padico_topo_node_t padico_topo_getnodebyuuid(padico_topo_uuid_t uuid)
node lookup, by UUID
Definition topology.c:2407
padico_topo_host_t padico_topo_host_resolvebyname(const char *hostname)
resolve a host from name
Definition topology.c:2681
char _addr_storage[1]
placeholder for address- more bytes are actually allocated
Definition Topology-internals.h:72
a binding of an entity with a network (protocol level)
Definition Topology-internals.h:187
struct topo_hostname_vect_s hnames
names of the host, including short hostname and fqdn
Definition Topology-internals.h:204
const char * hostname
canonical fully qualified domain name, as reported by gethostbyname(3)
Definition Topology-internals.h:203
Definition Topology-internals.h:194
enum topo_net_entity_s::@87 kind
int family
address family used on tyhe network- AF_UNSPEC if unknown
Definition Topology-internals.h:243
padico_topo_binding_scope_t scope
scope (host/node) of the bindings on this network
Definition Topology-internals.h:244
struct padico_topo_binding_vect_s bindings
network bindings of the node
Definition Topology-internals.h:218
const char * boot_id
session ID identifying our 'padico-launch' instance
Definition Topology-internals.h:217
performance information about link, i.e estimated latency and bandwidth
Definition Topology-internals.h:92
Definition Topology-internals.h:134
static void topo_host_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:388
static padico_string_t topo_binding_serialize(const struct topo_binding_s *b)
Definition topo-xml.c:70
static void topo_lstopo_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:726
static void topo_node_start_handler(puk_parse_entity_t e)
Definition topo-xml.c:299
static padico_string_t topo_hostname_serialize(topo_hostname_vect_t names)
Definition topo-xml.c:58
static padico_string_t na_bindings_serialize(padico_topo_binding_vect_t bindings)
Definition topo-xml.c:153
static void topo_node_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:351
static void topo_network_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:637
static void topo_hostname_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:706
static void topo_host_start_handler(puk_parse_entity_t e)
Definition topo-xml.c:374
static padico_string_t topo_hwaddr_serialize(padico_topo_hwaddr_t hwaddr)
Definition topo-xml.c:46
static void topo_hwaddr_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:686
static void topo_binding_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:593
static void topo_property_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:448
static void topo_performance_end_handler(puk_parse_entity_t e)
Definition topo-xml.c:716
void topo_binding_merge(padico_topo_binding_t binding, padico_topo_binding_t b2)
merge properties from b2 into 'binding', then destroy b2
Definition topology.c:1658
void topo_binding_bind_node(padico_topo_binding_t *_binding, padico_topo_node_t node)
Definition topology.c:1783
void topo_binding_bind_host(padico_topo_binding_t *_binding, padico_topo_host_t host)
Definition topology.c:1747
padico_topo_node_t topo_node_create(const char *name, padico_topo_host_t host, const char *uuid, const char *boot_id)
Create a new node, either locally or received as XML description.
Definition topology.c:1812
void topo_property_destroy(struct topo_property_s *prop)
Definition topology.c:1637