OpenHIP 0.9svn1
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <openssl/sha.h>
#include <openssl/dsa.h>
#include <openssl/asn1.h>
#include <openssl/rand.h>
#include <netinet/ip6.h>
#include <sys/types.h>
#include <errno.h>
#include <hip/hip_types.h>
#include <hip/hip_globals.h>
#include <hip/hip_funcs.h>
Functions | |
void | init_all_R1_caches () |
void | init_R1_cache (hi_node *hi) |
hipcookie * | generate_cookie () |
void | replace_next_R1 () |
int | compute_R1_cache_index (hip_hit *hiti, __u8 current) |
int | calculate_r1_length (hi_node *hi) |
void | init_dh_cache () |
dh_cache_entry * | new_dh_cache_entry (__u8 group_id) |
dh_cache_entry * | get_dh_entry (__u8 group_id, int new) |
void | unuse_dh_entry (DH *dh) |
void | expire_old_dh_entries () |
Variables | |
static __u32 | current_rand |
static __u32 | previous_rand |
static int | current_index = 0 |
int calculate_r1_length | ( | hi_node * | hi | ) |
References build_tlv_hostid_len(), hip_conf::dh_group, dhprime_len, eight_byte_align(), hip_conf::esp_transforms, HCNF, hip_conf::hip_transforms, MAX_CERT_LEN, MAX_SIG_SIZE, hip_conf::num_reg_types, hip_conf::send_hi_name, and SUITE_ID_MAX.
Referenced by init_R1_cache(), and replace_next_R1().
References current_rand, HIT_SIZE, previous_rand, and R1_CACHE_SIZE.
Referenced by hip_parse_I2(), and hip_send_R1().
void expire_old_dh_entries | ( | ) |
References _dh_cache_entry::creation_time, dh_cache, hip_conf::dh_group, hip_conf::dh_lifetime, FALSE, HCNF, _dh_cache_entry::is_current, new_dh_cache_entry(), _dh_cache_entry::next, _dh_cache_entry::ref_count, and TDIFF.
Referenced by main_loop().
hipcookie* generate_cookie | ( | ) |
References hip_conf::cookie_difficulty, hip_conf::cookie_lifetime, HCNF, _hipcookie::k, _hipcookie::lifetime, and _hipcookie::opaque.
Referenced by init_R1_cache(), and replace_next_R1().
dh_cache_entry* get_dh_entry | ( | __u8 | group_id, |
int | new | ||
) |
References dh_cache, _dh_cache_entry::group_id, _dh_cache_entry::is_current, new_dh_cache_entry(), _dh_cache_entry::next, and TRUE.
Referenced by build_rekey(), hip_parse_R1(), init_R1_cache(), and replace_next_R1().
void init_all_R1_caches | ( | ) |
References current_rand, init_R1_cache(), my_hi_head, _hi_node::next, and previous_rand.
Referenced by main_loop().
void init_dh_cache | ( | ) |
References dh_cache, hip_conf::dh_group, HCNF, and new_dh_cache_entry().
Referenced by main_loop().
void init_R1_cache | ( | hi_node * | hi | ) |
References calculate_r1_length(), _r1_cache_entry::creation_time, _r1_cache_entry::current_puzzle, _r1_cache_entry::dh_entry, hip_conf::dh_group, FALSE, generate_cookie(), get_dh_entry(), HCNF, hip_generate_R1(), _r1_cache_entry::len, log_(), _hi_node::name, NORM, _r1_cache_entry::packet, _r1_cache_entry::previous_puzzle, _hi_node::r1_cache, R1_CACHE_SIZE, _hi_node::r1_gen_count, and _dh_cache_entry::ref_count.
Referenced by init_all_R1_caches().
dh_cache_entry* new_dh_cache_entry | ( | __u8 | group_id | ) |
References _dh_cache_entry::creation_time, _dh_cache_entry::dh, dhgen, dhprime, dhprime_len, ERR, group_id, _dh_cache_entry::group_id, _dh_cache_entry::is_current, log_(), _dh_cache_entry::next, NORMT, _dh_cache_entry::ref_count, and TRUE.
Referenced by expire_old_dh_entries(), get_dh_entry(), and init_dh_cache().
void replace_next_R1 | ( | ) |
References calculate_r1_length(), _r1_cache_entry::creation_time, current_index, _r1_cache_entry::current_puzzle, current_rand, _r1_cache_entry::dh_entry, hip_conf::dh_group, FALSE, generate_cookie(), get_dh_entry(), HCNF, hip_generate_R1(), _r1_cache_entry::len, log_(), my_hi_head, _hi_node::next, NORMT, _r1_cache_entry::packet, _r1_cache_entry::previous_puzzle, previous_rand, _hi_node::r1_cache, R1_CACHE_SIZE, _hi_node::r1_gen_count, and _dh_cache_entry::ref_count.
Referenced by main_loop().
void unuse_dh_entry | ( | DH * | dh | ) |
References _dh_cache_entry::dh, dh_cache, _dh_cache_entry::next, and _dh_cache_entry::ref_count.
Referenced by free_hip_assoc(), and hip_finish_rekey().
int current_index = 0 [static] |
Referenced by replace_next_R1().
__u32 current_rand [static] |
Referenced by compute_R1_cache_index(), init_all_R1_caches(), and replace_next_R1().
__u32 previous_rand [static] |
Referenced by compute_R1_cache_index(), init_all_R1_caches(), and replace_next_R1().