OpenHIP 0.9svn1
|
#include <unistd.h>
#include <pthread.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <openssl/rand.h>
#include <sys/time.h>
#include <hip/hip_service.h>
#include <hip/hip_types.h>
#include <hip/hip_funcs.h>
#include <hip/hip_globals.h>
#include <hip/hip_mr.h>
#include <win32/checksum.h>
#include <linux/types.h>
#include <linux/netfilter.h>
#include <linux/version.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/nfnetlink_queue.h>
Classes | |
struct | if_data |
Defines | |
#define | aligned_be64 u_int64_t __attribute__((aligned(8))) |
#define | BUFSIZE 2048 |
#define | MR_TIMEOUT_US 500000 |
#define | MAX_MR_CLIENTS MAX_CONNECTIONS |
#define | MAX_EIFACES 8 |
#define | PRINT_NLMSGHDR(n) |
Enumerations | |
enum | { EIF_UNAVAILABLE, EIF_AVAILABLE } |
Functions | |
int | addr_match_payload (__u8 *payload, int family, struct sockaddr *src, struct sockaddr *dst) |
__u32 | get_next_spinat (void) |
hip_mr_client * | mr_client_lookup (hip_hit hit) |
void | mr_process_I1 (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload) |
void | mr_process_R1 (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload) |
__u32 | mr_process_I2 (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload) |
__u32 | mr_process_R2 (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload) |
__u32 | mr_process_I1_or_R2 (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload) |
void | mr_process_CLOSE (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload, int packet_type) |
unsigned char * | add_tlv_spi_nat (int family, unsigned char *payload, size_t data_len, size_t *new_len, __u32 new_spi) |
unsigned char * | check_hip_packet (int family, int inbound, struct if_data *ext_if, unsigned char *payload, size_t data_len, size_t *new_len) |
unsigned char * | new_header (int family, unsigned char *payload) |
unsigned char * | check_esp_packet (int family, int inbound, struct if_data *ext_if, unsigned char *payload) |
void | mr_clear_retransmissions (hip_spi_nat *spi_nats) |
void * | hip_mobile_router (void *arg) |
int | hip_send_proxy_update (struct sockaddr *newaddr, struct sockaddr *dstaddr, hip_spi_nat *spi_nat, hip_hit *mn_hit) |
int | build_tlv_proxy_hmac (hip_proxy_ticket *ticket, __u8 *data, int location, int type) |
int | free_hip_mr_client (hip_mr_client *hip_mr_c) |
int | is_mobile_router () |
int | hip_mobile_router_add_remove_rules (int queue_num, int del) |
int | netfilter_queue_init (int queue_num) |
int | netfilter_queue_bind (int nlfd, int n, int af) |
int | netfilter_queue_unbind (int nlfd, int n, int af) |
int | netfilter_queue_config_command (int nlfd, int queue_num, int cmd, int af) |
int | netfilter_queue_config_param (int nlfd, int queue_num) |
int | netfilter_queue_sendmsg (int nlfd, __u8 *data, int len) |
__u8 * | netfilter_queue_command_hdr (__u8 *buf, int queue_num, int type, int *len) |
int | netfilter_get_packet (int nlfd, __u8 *buf, int *buf_len, __u8 *family, __u32 *id, __u8 *hook, int *ifi) |
int | netfilter_queue_set_verdict (int nlfd, int queue_num, __u32 id, __u32 verdict, int data_len, __u8 *data) |
void | rewrite_addrs (__u8 *payload, struct sockaddr *src, struct sockaddr *dst) |
__u32 | mr_process_I2_or_R2 (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload) |
void | mr_process_update (hip_mr_client *hip_mr_c, int family, int inbound, struct if_data *ext_if, hiphdr *hiph, unsigned char *payload) |
unsigned char * | do_inbound_esp_packet (int family, unsigned char *payload, struct sockaddr *addr, hip_spi_nat *spi_nat) |
unsigned char * | do_outbound_esp_packet (int family, struct if_data *ext_if, unsigned char *payload, hip_mr_client *client, hip_spi_nat *spi_nat) |
int | hip_mr_retransmit (struct timeval *time1, hip_hit hit) |
int | copy_for_retrans (__u8 *data, int len, struct sockaddr *dst, hip_spi_nat *spi_nat) |
int | hip_mr_set_external_ifs () |
void | send_updates (struct sockaddr *out) |
void | hip_mr_handle_address_change (int add, struct sockaddr *newaddr, int ifi) |
int | init_hip_mr_client (hip_hit peer_hit, struct sockaddr *src) |
int | add_proxy_ticket (const __u8 *data) |
Variables | |
static hip_mr_client | hip_mr_client_table [MAX_MR_CLIENTS] |
static hip_mutex_t | hip_mr_client_mutex |
static int | max_hip_mr_clients |
static int | neifs = 0 |
static struct if_data | external_interfaces [MAX_EIFACES] |
#define aligned_be64 u_int64_t __attribute__((aligned(8))) |
#define BUFSIZE 2048 |
Referenced by hip_mobile_router().
#define MAX_EIFACES 8 |
#define MAX_MR_CLIENTS MAX_CONNECTIONS |
Referenced by free_hip_mr_client(), and init_hip_mr_client().
#define MR_TIMEOUT_US 500000 |
Referenced by hip_mobile_router().
#define PRINT_NLMSGHDR | ( | n | ) |
{ \
printf("nlmsg len=%d type=%d flags=%d seq=%d pid=%d\n", \
n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags, \
n->nlmsg_seq, n->nlmsg_pid); }
int add_proxy_ticket | ( | const __u8 * | data | ) |
References _tlv_proxy_ticket::action, _hip_proxy_ticket::action, hip_mr_client_mutex, hit_to_str(), hits_equal(), _tlv_proxy_ticket::hmac, _hip_proxy_ticket::hmac, _tlv_proxy_ticket::hmac_key, _hip_proxy_ticket::hmac_key, _tlv_proxy_ticket::hmac_key_index, _hip_proxy_ticket::hmac_key_index, _tlv_proxy_ticket::lifetime, _hip_proxy_ticket::lifetime, log_(), max_hip_mr_clients, _hip_mr_client::mn_hit, _tlv_proxy_ticket::mn_hit, _hip_spi_nat::next, NORM, _hip_spi_nat::peer_hit, _tlv_proxy_ticket::peer_hit, RESPONSE_SENT, _hip_mr_client::spi_nats, _hip_mr_client::state, _hip_spi_nat::ticket, _tlv_proxy_ticket::transform_type, _hip_proxy_ticket::transform_type, and WARN.
Referenced by hip_parse_update().
unsigned char * add_tlv_spi_nat | ( | int | family, |
unsigned char * | payload, | ||
size_t | data_len, | ||
size_t * | new_len, | ||
__u32 | new_spi | ||
) |
int addr_match_payload | ( | __u8 * | payload, |
int | family, | ||
struct sockaddr * | src, | ||
struct sockaddr * | dst | ||
) |
References FALSE, ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, ip::ip_src, SA2IP, SAIPLEN, and TRUE.
Referenced by check_esp_packet().
int build_tlv_proxy_hmac | ( | hip_proxy_ticket * | ticket, |
__u8 * | data, | ||
int | location, | ||
int | type | ||
) |
References auth_key_len(), eight_byte_align(), ESP_3DES_CBC_HMAC_MD5, ESP_3DES_CBC_HMAC_SHA1, ESP_AES_CBC_HMAC_SHA1, ESP_BLOWFISH_CBC_HMAC_SHA1, ESP_NULL_HMAC_MD5, ESP_NULL_HMAC_SHA1, _hiphdr::hdr_len, _tlv_hmac::hmac, _hip_proxy_ticket::hmac_key, _tlv_hmac::length, log_(), NORM, _hip_proxy_ticket::transform_type, and _tlv_hmac::type.
Referenced by hip_send_proxy_update().
unsigned char * check_esp_packet | ( | int | family, |
int | inbound, | ||
struct if_data * | ext_if, | ||
unsigned char * | payload | ||
) |
unsigned char * check_hip_packet | ( | int | family, |
int | inbound, | ||
struct if_data * | ext_if, | ||
unsigned char * | payload, | ||
size_t | data_len, | ||
size_t * | new_len | ||
) |
References add_tlv_spi_nat(), _hiphdr::checksum, checksum_packet(), CLOSE, CLOSE_ACK, dst, _hiphdr::hdr_len, HIP_I1, HIP_I2, hip_mr_client_mutex, HIP_R1, HIP_R2, _hiphdr::hit_rcvr, _hiphdr::hit_sndr, ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, ip::ip_src, log_(), mr_client_lookup(), mr_process_CLOSE(), mr_process_I1(), mr_process_I2(), mr_process_R1(), mr_process_R2(), mr_process_update(), NORM, _hiphdr::packet_type, SA, SA2IP, SAIPLEN, src, UPDATE, and WARN.
Referenced by hip_mobile_router().
int copy_for_retrans | ( | __u8 * | data, |
int | len, | ||
struct sockaddr * | dst, | ||
hip_spi_nat * | spi_nat | ||
) |
unsigned char* do_inbound_esp_packet | ( | int | family, |
unsigned char * | payload, | ||
struct sockaddr * | addr, | ||
hip_spi_nat * | spi_nat | ||
) |
References log_(), new_header(), NORM, _hip_spi_nat::peer_addr, _hip_spi_nat::private_spi, rewrite_addrs(), SA, and ip_esp_hdr::spi.
Referenced by check_esp_packet().
unsigned char* do_outbound_esp_packet | ( | int | family, |
struct if_data * | ext_if, | ||
unsigned char * | payload, | ||
hip_mr_client * | client, | ||
hip_spi_nat * | spi_nat | ||
) |
References if_data::address, dst, hip_send_proxy_update(), _hip_spi_nat::last_out_addr, log_(), logaddr(), _hip_mr_client::mn_addr, _hip_mr_client::mn_hit, new_header(), NORM, _hip_spi_nat::peer_ipv4_addr, _hip_spi_nat::peer_ipv6_addr, rewrite_addrs(), SA, SA2IP, SAIPLEN, and SALEN.
Referenced by check_esp_packet().
int free_hip_mr_client | ( | hip_mr_client * | hip_mr_c | ) |
References CANCELLED, max_hip_mr_clients, MAX_MR_CLIENTS, _hip_spi_nat::next, _hip_mr_client::spi_nats, and _hip_mr_client::state.
Referenced by init_hip_mr_client().
__u32 get_next_spinat | ( | void | ) |
References max_hip_mr_clients, _hip_spi_nat::next, _hip_spi_nat::public_spi, and SPI_RESERVED.
Referenced by mr_process_I2_or_R2().
void* hip_mobile_router | ( | void * | arg | ) |
References BUFSIZE, check_esp_packet(), check_hip_packet(), external_interfaces, FALSE, g_state, H_PROTO_HIP, hip_mobile_router_add_remove_rules(), hip_mr_client_mutex, ip6_hdr::ip6_dst, ip::ip_dst, ip::ip_len, ip::ip_p, MR_TIMEOUT_US, neifs, netfilter_get_packet(), netfilter_queue_init(), netfilter_queue_set_verdict(), SA, SA2IP, SAIPLEN, SALEN, and TRUE.
Referenced by init_hip().
int hip_mobile_router_add_remove_rules | ( | int | queue_num, |
int | del | ||
) |
Referenced by hip_mobile_router().
void hip_mr_handle_address_change | ( | int | add, |
struct sockaddr * | newaddr, | ||
int | ifi | ||
) |
References _sockaddr_list::addr, EIF_AVAILABLE, EIF_UNAVAILABLE, external_interfaces, HCNF, hip_mr_client_mutex, _sockaddr_list::if_index, if_data::ifindex, hip_conf::ignored_addr, log_(), logaddr(), hip_opt::mr, my_addr_head, neifs, _sockaddr_list::next, NORM, OPT, SA, SA2IP, SA2IP6, SAIPLEN, send_updates(), if_data::state, and WARN.
Referenced by handle_local_address_change().
int hip_mr_retransmit | ( | struct timeval * | time1, |
hip_hit | hit | ||
) |
References _hiphdr::checksum, checksum_packet(), hip_packet_entry::dst, dst, FALSE, HCNF, hip_retransmit(), _hip_spi_nat::last_out_addr, hip_packet_entry::len, log_(), logaddr(), hip_conf::max_retries, mr_clear_retransmissions(), mr_client_lookup(), _hip_spi_nat::next, hip_opt::no_retransmit, NORM, NORMT, OPT, hip_packet_entry::packet, hip_conf::packet_timeout, hip_packet_entry::retransmits, _hip_spi_nat::rexmt_cache, _hip_spi_nat::rvs_addr, SA, SA2IP, SAIPLEN, SALEN, _hip_mr_client::spi_nats, src, TDIFF, TRUE, _hip_spi_nat::use_rvs, VALID_FAM, and hip_packet_entry::xmit_time.
Referenced by hip_retransmit_waiting_packets().
int hip_mr_set_external_ifs | ( | ) |
References _sockaddr_list::addr, devname_to_index(), EIF_AVAILABLE, EIF_UNAVAILABLE, ERR, external_interfaces, HCNF, hip_mr_client_mutex, _sockaddr_list::if_index, if_data::ifindex, hip_conf::ignored_addr, log_(), logaddr(), hip_opt::mr, my_addr_head, if_data::name, name::name, neifs, _sockaddr_list::next, name::next, NORM, OPT, hip_conf::outbound_ifaces, _sockaddr_list::preferred, SA, SA2IP, SA2IP6, SAIPLEN, if_data::state, TRUE, and WARN.
Referenced by main_loop().
int hip_send_proxy_update | ( | struct sockaddr * | newaddr, |
struct sockaddr * | dstaddr, | ||
hip_spi_nat * | spi_nat, | ||
hip_hit * | mn_hit | ||
) |
References _hip_proxy_ticket::action, _tlv_auth_ticket::action, build_tlv_proxy_hmac(), _hiphdr::checksum, checksum_packet(), _hiphdr::control, copy_for_retrans(), dst, eight_byte_align(), FALSE, HCNF, _hiphdr::hdr_len, HIP_PROTO_VER, HIP_RES_SHIM6_BITS, hip_send(), _hiphdr::hit_rcvr, _hiphdr::hit_sndr, _hip_proxy_ticket::hmac, _tlv_auth_ticket::hmac, _hip_proxy_ticket::hmac_key_index, _tlv_auth_ticket::hmac_key_index, IPPROTO_NONE, _tlv_auth_ticket::length, _tlv_locator::length, _hip_proxy_ticket::lifetime, _tlv_auth_ticket::lifetime, hip_conf::loc_lifetime, _locator::locator, _tlv_locator::locator1, _locator::locator_length, _locator::locator_lifetime, LOCATOR_PREFERRED, LOCATOR_TRAFFIC_TYPE_BOTH, _locator::locator_type, LOCATOR_TYPE_SPI_IPV6, log_(), logaddr(), MAX_SIG_SIZE, NORMT, _hiphdr::nxt_hdr, _hiphdr::packet_type, PARAM_AUTH_TICKET, PARAM_HMAC, PARAM_LOCATOR, _hip_spi_nat::peer_hit, _hip_spi_nat::public_spi, _hiphdr::res, _locator::reserved, SA2IP, SAIPLEN, src, _hip_spi_nat::ticket, _locator::traffic_type, _hip_proxy_ticket::transform_type, _tlv_auth_ticket::transform_type, _tlv_auth_ticket::type, _tlv_locator::type, UPDATE, and _hiphdr::version.
Referenced by do_outbound_esp_packet(), mr_process_update(), and send_updates().
int init_hip_mr_client | ( | hip_hit | peer_hit, |
struct sockaddr * | src | ||
) |
References CANCELLED, free_hip_mr_client(), hip_mr_client_mutex, log_(), max_hip_mr_clients, MAX_MR_CLIENTS, _hip_mr_client::mn_addr, _hip_mr_client::mn_hit, mr_client_lookup(), RESPONSE_SENT, SA, SALEN, _hip_mr_client::state, and WARN.
Referenced by handle_reg_request().
int is_mobile_router | ( | ) |
References hip_opt::mr, and OPT.
Referenced by init_hip().
void mr_clear_retransmissions | ( | hip_spi_nat * | spi_nats | ) |
hip_mr_client * mr_client_lookup | ( | hip_hit | hit | ) |
References hits_equal(), and max_hip_mr_clients.
Referenced by check_hip_packet(), hip_mr_retransmit(), and init_hip_mr_client().
void mr_process_CLOSE | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload, | ||
int | packet_type | ||
) |
References if_data::address, CLOSE_ACK, _hiphdr::hit_rcvr, _hiphdr::hit_sndr, hits_equal(), _hip_mr_client::mn_addr, _hip_spi_nat::next, _hip_spi_nat::peer_addr, _hip_spi_nat::peer_hit, rewrite_addrs(), SA, and _hip_mr_client::spi_nats.
Referenced by check_hip_packet().
void mr_process_I1 | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload | ||
) |
References if_data::address, dst, _hiphdr::hit_rcvr, _hiphdr::hit_sndr, hits_equal(), ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, ip::ip_src, log_(), logaddr(), _hip_mr_client::mn_addr, _hip_spi_nat::next, NORM, _hip_spi_nat::peer_addr, _hip_spi_nat::peer_hit, _hip_spi_nat::peer_ipv4_addr, _hip_spi_nat::peer_ipv6_addr, _hip_spi_nat::private_spi, _hip_spi_nat::public_spi, rewrite_addrs(), SA, SA2IP, SAIPLEN, and _hip_mr_client::spi_nats.
Referenced by check_hip_packet().
__u32 mr_process_I1_or_R2 | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload | ||
) |
__u32 mr_process_I2 | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload | ||
) |
References mr_process_I2_or_R2().
Referenced by check_hip_packet().
__u32 mr_process_I2_or_R2 | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload | ||
) |
References if_data::address, get_next_spinat(), _hiphdr::hdr_len, _hiphdr::hit_rcvr, _hiphdr::hit_sndr, hits_equal(), _hip_spi_nat::last_out_addr, _tlv_head::length, length, log_(), _hip_mr_client::mn_addr, _tlv_esp_info::new_spi, _hip_spi_nat::next, NORM, PARAM_ESP_INFO, PARAM_ESP_INFO_NOSIG, _hip_spi_nat::peer_addr, _hip_spi_nat::peer_hit, _hip_spi_nat::peer_spi, _hip_spi_nat::private_spi, _hip_spi_nat::public_spi, rewrite_addrs(), SA, SALEN, _hip_mr_client::spi_nats, tlv_length_to_parameter_length(), _tlv_head::type, and type.
Referenced by mr_process_I2(), and mr_process_R2().
void mr_process_R1 | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload | ||
) |
References if_data::address, _tlv_via_rvs::address, _hiphdr::hdr_len, _hiphdr::hit_rcvr, _hiphdr::hit_sndr, hits_equal(), ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, ip::ip_src, _tlv_head::length, length, log_(), logaddr(), _hip_mr_client::mn_addr, _hip_spi_nat::next, NORM, PARAM_VIA_RVS, _hip_spi_nat::peer_addr, _hip_spi_nat::peer_hit, _hip_spi_nat::peer_ipv4_addr, _hip_spi_nat::peer_ipv6_addr, rewrite_addrs(), _hip_spi_nat::rvs_addr, SA, SA2IP, SAIPLEN, _hip_mr_client::spi_nats, tlv_length_to_parameter_length(), _tlv_head::type, and type.
Referenced by check_hip_packet().
__u32 mr_process_R2 | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload | ||
) |
References mr_process_I2_or_R2().
Referenced by check_hip_packet().
void mr_process_update | ( | hip_mr_client * | hip_mr_c, |
int | family, | ||
int | inbound, | ||
struct if_data * | ext_if, | ||
hiphdr * | hiph, | ||
unsigned char * | payload | ||
) |
References if_data::address, _hiphdr::hdr_len, hip_send_proxy_update(), _hiphdr::hit_rcvr, _hiphdr::hit_sndr, hits_equal(), _tlv_head::length, length, _locator::locator, _tlv_locator::locator1, _locator::locator_length, _locator::locator_type, LOCATOR_TYPE_IPV6, LOCATOR_TYPE_SPI_IPV6, log_(), _hip_mr_client::mn_addr, _hip_mr_client::mn_hit, mr_clear_retransmissions(), _hip_spi_nat::next, PARAM_LOCATOR, PARAM_SEQ, PARAM_VIA_RVS, _hip_spi_nat::peer_addr, _hip_spi_nat::peer_hit, _hip_spi_nat::peer_ipv4_addr, _hip_spi_nat::peer_ipv6_addr, rewrite_addrs(), _hip_spi_nat::rvs_addr, SA, SA2IP, SAIPLEN, _hip_mr_client::spi_nats, tlv_length_to_parameter_length(), _tlv_head::type, type, _hip_spi_nat::use_rvs, and WARN.
Referenced by check_hip_packet().
int netfilter_get_packet | ( | int | nlfd, |
__u8 * | buf, | ||
int * | buf_len, | ||
__u8 * | family, | ||
__u32 * | id, | ||
__u8 * | hook, | ||
int * | ifi | ||
) |
References NLMSG_DATA, nlmsghdr::nlmsg_len, nlmsghdr::nlmsg_type, and SA.
Referenced by hip_mobile_router().
int netfilter_queue_bind | ( | int | nlfd, |
int | n, | ||
int | af | ||
) |
References netfilter_queue_config_command().
Referenced by netfilter_queue_init().
References NLM_F_REQUEST, NLMSG_ALIGN, nlmsghdr::nlmsg_flags, nlmsghdr::nlmsg_len, nlmsghdr::nlmsg_pid, nlmsghdr::nlmsg_seq, nlmsghdr::nlmsg_type, and type.
Referenced by netfilter_queue_config_command(), and netfilter_queue_config_param().
int netfilter_queue_config_command | ( | int | nlfd, |
int | queue_num, | ||
int | cmd, | ||
int | af | ||
) |
References netfilter_queue_command_hdr(), netfilter_queue_sendmsg(), and NLMSG_ALIGN.
Referenced by netfilter_queue_bind(), and netfilter_queue_unbind().
int netfilter_queue_config_param | ( | int | nlfd, |
int | queue_num | ||
) |
References netfilter_queue_command_hdr(), netfilter_queue_sendmsg(), and NLMSG_ALIGN.
Referenced by netfilter_queue_init().
int netfilter_queue_init | ( | int | queue_num | ) |
References AF_NETLINK, netfilter_queue_bind(), netfilter_queue_config_param(), netfilter_queue_unbind(), sockaddr_nl::nl_family, sockaddr_nl::nl_groups, and SA.
Referenced by hip_mobile_router().
int netfilter_queue_sendmsg | ( | int | nlfd, |
__u8 * | data, | ||
int | len | ||
) |
References AF_NETLINK, sockaddr_nl::nl_family, NLMSG_NEXT, NLMSG_OK, nlmsghdr::nlmsg_type, and SA.
Referenced by netfilter_queue_config_command(), and netfilter_queue_config_param().
int netfilter_queue_set_verdict | ( | int | nlfd, |
int | queue_num, | ||
__u32 | id, | ||
__u32 | verdict, | ||
int | data_len, | ||
__u8 * | data | ||
) |
References AF_NETLINK, sockaddr_nl::nl_family, NLM_F_REQUEST, NLMSG_ALIGN, nlmsghdr::nlmsg_flags, nlmsghdr::nlmsg_len, nlmsghdr::nlmsg_pid, nlmsghdr::nlmsg_seq, and nlmsghdr::nlmsg_type.
Referenced by hip_mobile_router().
int netfilter_queue_unbind | ( | int | nlfd, |
int | n, | ||
int | af | ||
) |
References netfilter_queue_config_command().
Referenced by netfilter_queue_init().
unsigned char * new_header | ( | int | family, |
unsigned char * | payload | ||
) |
References ip::ip_hl, ip::ip_id, ip::ip_len, ip::ip_off, ip::ip_p, ip::ip_sum, ip::ip_tos, ip::ip_ttl, and ip::ip_v.
Referenced by do_inbound_esp_packet(), and do_outbound_esp_packet().
void rewrite_addrs | ( | __u8 * | payload, |
struct sockaddr * | src, | ||
struct sockaddr * | dst | ||
) |
References ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, ip_fast_csum(), ip::ip_hl, ip::ip_src, ip::ip_sum, SA2IP, and SAIPLEN.
Referenced by do_inbound_esp_packet(), do_outbound_esp_packet(), mr_process_CLOSE(), mr_process_I1(), mr_process_I2_or_R2(), mr_process_R1(), and mr_process_update().
void send_updates | ( | struct sockaddr * | out | ) |
struct if_data external_interfaces[MAX_EIFACES] [static] |
Referenced by hip_mobile_router(), hip_mr_handle_address_change(), and hip_mr_set_external_ifs().
hip_mutex_t hip_mr_client_mutex [static] |
hip_mr_client hip_mr_client_table[MAX_MR_CLIENTS] [static] |
int max_hip_mr_clients [static] |
int neifs = 0 [static] |
Referenced by hip_mobile_router(), hip_mr_handle_address_change(), and hip_mr_set_external_ifs().