OpenHIP 0.9svn1
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <pthread.h>
#include <ctype.h>
#include <openssl/sha.h>
#include <openssl/dsa.h>
#include <openssl/asn1.h>
#include <openssl/rand.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <libxml/tree.h>
#include <hip/hip_types.h>
#include <hip/hip_proto.h>
#include <hip/hip_globals.h>
#include <hip/hip_funcs.h>
#include <hip/hip_dns.h>
Functions | |
int | locate_config_file (char *filename, int filename_size, char *default_name) |
void | parse_xml_attributes (xmlAttrPtr attr, hi_node *hi) |
void | parse_xml_hostid (xmlNodePtr node, hi_node *hi) |
int | read_identities_file (char *filename, int mine) |
void | print_hi_to_buff (uint8_t **bufp, int *buf_len, hi_node *hi, int mine) |
void | xmlNewChild_from_bn (xmlNodePtr node, BIGNUM *bn, char *name) |
int | hi_to_xml (xmlNodePtr root_node, hi_node *h, int mine) |
int | save_identities_file (int mine) |
int | read_conf_file (char *filename) |
int hi_to_xml | ( | xmlNodePtr | root_node, |
hi_node * | h, | ||
int | mine | ||
) |
References _sockaddr_list::addr, addr_to_str(), _hi_node::addrs, _hi_node::algorithm_id, _hi_node::allow_incoming, _hi_node::anonymous, _hi_node::dsa, HI_ALG_DSA, HI_ALG_RSA, HI_TYPESTR, hipcfg_getLegacyNodesByEndbox(), _hi_node::hit, HIT_SIZE, IN6_LOOP, IN_LOOP, log_(), _hi_node::lsi, _hi_node::name, _sockaddr_list::next, _hi_node::r1_gen_count, _hi_node::rsa, _hi_node::rvs_addrs, SA, SA2IP, _hi_node::size, _hi_node::skip_addrcheck, VALID_FAM, WARN, xmlNewChild_from_bn(), and yesno.
Referenced by save_identities_file().
int locate_config_file | ( | char * | filename, |
int | filename_size, | ||
char * | default_name | ||
) |
Referenced by hipCfgMap::getHITFromLocalFile(), and main_loop().
void parse_xml_attributes | ( | xmlAttrPtr | attr, |
hi_node * | hi | ||
) |
References _hi_node::algorithm_id, _hi_node::allow_incoming, _hi_node::anonymous, _hi_node::r1_gen_count, _hi_node::size, _hi_node::skip_addrcheck, and TRUE.
Referenced by read_identities_file().
void parse_xml_hostid | ( | xmlNodePtr | node, |
hi_node * | hi | ||
) |
References ACTIVE, add_address_to_list(), _sockaddr_list::addr, _hi_node::addrs, _hi_node::algorithm_id, _hi_node::dsa, hex_to_bin(), HI_ALG_DSA, HI_ALG_RSA, _hi_node::hit, HIT_SIZE, log_(), _hi_node::lsi, _hi_node::name, _hi_node::name_len, _hi_node::rsa, _hi_node::rvs_addrs, SA2IP, SALEN, _sockaddr_list::status, str_to_addr(), UNVERIFIED, VALID_FAM, and WARN.
Referenced by read_identities_file().
References _sockaddr_list::addr, addr_to_str(), _hi_node::addrs, _hi_node::addrs_mutex, _hi_node::hit, hit_to_str(), _hi_node::lsi, _hi_node::name, _sockaddr_list::next, SA, and VALID_FAM.
Referenced by read_identities_file().
int read_conf_file | ( | char * | filename | ) |
References hip_conf::cookie_difficulty, hip_conf::cookie_lifetime, hip_conf::dh_group, hip_conf::dh_lifetime, hip_conf::dht_server, hip_conf::disable_dns_lookups, hip_conf::disable_dns_thread, hip_conf::disable_notify, hip_conf::disable_udp, hip_conf::dns_server, hip_conf::enable_bcast, hip_conf::esp_transforms, hip_conf::failure_timeout, FALSE, HCNF, hip_conf::hip_transforms, hip_conf::ignored_addr, hip_conf::loc_lifetime, log_(), hip_conf::master_interface, hip_conf::master_interface2, MAX_HI_NAMESIZE, hip_conf::max_reg_lifetime, hip_conf::max_retries, hip_conf::min_reg_lifetime, hip_conf::msl, name::name, name::next, hip_conf::outbound_ifaces, hip_conf::packet_timeout, hip_conf::peer_certificate_required, hip_conf::preferred, hip_conf::preferred_hi, hip_conf::preferred_iface, hip_conf::r1_lifetime, hip_conf::sa_lifetime, hip_conf::save_known_identities, hip_conf::save_my_identities, hip_conf::send_hi_name, str_to_addr(), SUITE_ID_MAX, TRUE, hip_conf::ual, and WARN.
Referenced by main(), and main_loop().
int read_identities_file | ( | char * | filename, |
int | mine | ||
) |
References add_addresses_from_dns(), _sockaddr_list::addr, _hi_node::addrs, _hi_node::algorithm_id, append_hi_node(), create_new_hi_node(), _hi_node::dsa, free_hi_node(), HI_ALG_DSA, HI_ALG_RSA, hip_dht_resolve_hi(), _hi_node::hit, HIT2LSI, hits_equal(), log_(), _hi_node::lsi, my_hi_head, _hi_node::name, NORM, parse_xml_attributes(), parse_xml_hostid(), peer_hi_head, print_hi_to_buff(), _hi_node::rsa, SA2IP, TRUE, VALID_FAM, validate_hit(), WARN, and zero_hit.
Referenced by main_loop().
int save_identities_file | ( | int | mine | ) |
References HCNF, hi_to_xml(), hipcfg_peers_allowed(), hit_to_str(), hip_conf::known_hi_filename, log_(), MAX_HI_NAMESIZE, hip_conf::my_hi_filename, my_hi_head, _hi_node::name, _hi_node::next, NORM, peer_hi_head, and WARN.
Referenced by hip_exit().
void xmlNewChild_from_bn | ( | xmlNodePtr | node, |
BIGNUM * | bn, | ||
char * | name | ||
) |
Referenced by hi_to_xml().