Committer: Miika Komu <miika@xxxxxx> Date: 18/03/2010 at 14:09:53 Revision: 4001 Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: Replaced SO_HIP_ with HIP_MSG_ Now that the socket handler is removed, there absolutely no reason to have user message types named as SO_HIP_xx. The SO_ prefix is reserved for socket options. Modified: M agent/connhipd.c M doc/HACKING M doc/verbose-header-files.txt M firewall/cache.c M firewall/common_hipd_msg.c M firewall/datapkt.c M firewall/esp_prot_fw_msg.c M firewall/firewall.c M firewall/firewall_control.c M firewall/lsi.c M firewall/opptcp.c M firewall/proxy.c M firewall/sysopp.c M firewall/user_ipsec_fw_msg.c M hipd/accessor.c M hipd/bos.c M hipd/cert.c M hipd/close.c M hipd/dht.c M hipd/hipd.c M hipd/init.c M hipd/input.c M hipd/maintenance.c M hipd/nat.c M hipd/netdev.c M hipd/oppdb.c M hipd/output.c M hipd/update.c M hipd/user.c M hipd/user_ipsec_hipd_msg.c M lib/conf/hipconf.c M lib/core/builder.c M lib/core/certtools.c M lib/core/hostid.c M lib/core/icomm.h M lib/core/state.h M lib/dht/libhipdht.c M lib/opphip/wrap.c M tools/pisacert.c M verbose-headers.txt === modified file 'agent/connhipd.c' --- agent/connhipd.c 2010-03-10 17:44:36 +0000 +++ agent/connhipd.c 2010-03-18 12:09:47 +0000 @@ -127,22 +127,22 @@ struct in6_addr hitr; type = hip_get_msg_type(msg); - if (type == SO_HIP_AGENT_PING_REPLY) { + if (type == HIP_MSG_AGENT_PING_REPLY) { HIP_DEBUG("Received ping reply from daemon. " \ "Connection to daemon established.\n"); gui_set_info(lang_get("gui-info-000")); hip_agent_connected = 1; - } else if (type == SO_HIP_SET_NAT_ON) { + } else if (type == HIP_MSG_SET_NAT_ON) { gui_update_nat(1); HIP_DEBUG("NAT extensions on.\n"); - } else if (type == SO_HIP_SET_NAT_NONE) { + } else if (type == HIP_MSG_SET_NAT_NONE) { gui_update_nat(0); HIP_DEBUG("NAT extensions off.\n"); - } else if (type == SO_HIP_DAEMON_QUIT) { + } else if (type == HIP_MSG_DAEMON_QUIT) { HIP_DEBUG("Daemon quit. Waiting daemon to wake up again...\n"); gui_set_info(lang_get("gui-info-001")); hip_agent_connected = 0; - } else if (type == SO_HIP_ADD_DB_HI) { + } else if (type == HIP_MSG_ADD_DB_HI) { HIP_DEBUG("Message received successfully from daemon with type" " HIP_ADD_DB_HI (%d).\n", type); n = 0; @@ -277,7 +277,7 @@ if (hip_agent_connected < 1) { /* Test connection. */ - hip_build_user_hdr(msg, SO_HIP_AGENT_PING, 0); + hip_build_user_hdr(msg, HIP_MSG_AGENT_PING, 0); n = hip_send_recv_daemon_info(msg, 1, hip_agent_sock); //if (n < 0) HIP_DEBUG("Could not send ping to daemon, waiting.\n"); hip_agent_connected--; @@ -335,7 +335,7 @@ out_err: /* Send quit message to daemon. */ - hip_build_user_hdr(msg, SO_HIP_AGENT_QUIT, 0); + hip_build_user_hdr(msg, HIP_MSG_AGENT_QUIT, 0); n = hip_send_recv_daemon_info(msg, 1, hip_agent_sock); if (n < 0) { HIP_ERROR("Could not send quit message to daemon.\n"); === modified file 'doc/HACKING' --- doc/HACKING 2010-03-05 08:24:06 +0000 +++ doc/HACKING 2010-03-18 12:09:47 +0000 @@ -1506,18 +1506,18 @@ -------------------------------------------------- Add a case block for your ACTION_NEWACT constant in the switch(action) block. -2.1. SO_HIP_NEWMODE in lib/conf/icomm.h +2.1. HIP_MSG_NEWMODE in lib/conf/icomm.h --------------------------------------- -Define a constant SO_HIP_NEWMODE which has value between 0 and -HIP_SO_ROOT_MAX. Take also care of the value of HIP_SO_ROOT_MAX. +Define a constant HIP_MSG_NEWMODE which has value between 0 and +HIP_MSG_ROOT_MAX. Take also care of the value of HIP_MSG_ROOT_MAX. 2.2. hip_handle_user_msg() in hipd/user.c ----------------------------------------- -Add a case block for your SO_HIP_NEWMODE constant in the switch(msg_type) block. +Add a case block for your HIP_MSG_NEWMODE constant in the switch(msg_type) block. 2.3. hip_message_type_name() in lib/conf/builder.c -------------------------------------------------- -Add a case block for your SO_HIP_NEWMODE constant in the switch(msg_type) block. +Add a case block for your HIP_MSG_NEWMODE constant in the switch(msg_type) block. In this case, you just need to return the same string as the constant. 3.1. action_handler[] in lib/conf/hipconf.c === modified file 'doc/verbose-header-files.txt' --- doc/verbose-header-files.txt 2010-03-07 11:20:52 +0000 +++ doc/verbose-header-files.txt 2010-03-18 12:09:47 +0000 @@ -519,8 +519,8 @@ hipd/registration.h : hip_set_srv_max_lifetime hipd/registration.h : hip_set_srv_min_lifetime hipd/nat.h : HIP_SIMULATE_NATS -libhipcore/icomm.h : HIP_SO_ROOT_MAX -libhipcore/icomm.h : HIP_SO_ROOT_MIN +libhipcore/icomm.h : HIP_MSG_ROOT_MAX +libhipcore/icomm.h : HIP_MSG_ROOT_MIN libhipcore/sqlitedbapi.h : hip_sqlite_create_table libhipcore/sqlitedbapi.h : hip_sqlite_execute_into_db hipd/registration.h : hip_srv_status_t @@ -1154,7 +1154,7 @@ firewall/hslist.h : slist_last libhiptool/xfrm.h : soft_add_expires_seconds libhiptool/xfrm.h : soft_use_expires_seconds -libhipcore/icomm.h : SO_HIP_STUN +libhipcore/icomm.h : HIP_MSG_STUN libhiptool/nlink /usr/include/linux/socket.h : SOL_NETLINK libhipcore/kerncompat.h : spin_unlock_irqrestore agent/str_var.h : SPRINTHUGESTR === modified file 'firewall/cache.c' --- firewall/cache.c 2010-03-10 17:44:36 +0000 +++ firewall/cache.c 2010-03-18 12:09:47 +0000 @@ -162,7 +162,7 @@ HIP_IFEL(!(msg = malloc(HIP_MAX_PACKET)), -1, "malloc failed\n"); hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_HA_INFO, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_HA_INFO, 0), -1, "Building of daemon header failed\n"); HIP_IFEL(hip_send_recv_daemon_info(msg, 0, hip_fw_sock), -1, "send recv daemon info\n"); === modified file 'firewall/common_hipd_msg.c' --- firewall/common_hipd_msg.c 2010-03-10 17:44:36 +0000 +++ firewall/common_hipd_msg.c 2010-03-18 12:09:47 +0000 @@ -36,7 +36,7 @@ HIP_IFEL(!(msg = hip_msg_alloc()), -1, "malloc failed\n"); hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_HA_INFO, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_HA_INFO, 0), -1, "Building of daemon header failed\n"); HIP_IFEL(hip_send_recv_daemon_info(msg, 0, hip_fw_sock), -1, "send recv daemon info\n"); === modified file 'firewall/datapkt.c' --- firewall/datapkt.c 2010-03-10 17:44:36 +0000 +++ firewall/datapkt.c 2010-03-18 12:09:47 +0000 @@ -108,7 +108,7 @@ HIP_DEBUG("PAYLOAD_PROTO in HIP DATA HEADER = %d ", payload ); /* @todo: this will assert */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_BUILD_HOST_ID_SIGNATURE_DATAPACKET, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_BUILD_HOST_ID_SIGNATURE_DATAPACKET, 0), -1, "build hdr failed\n"); _HIP_DUMP_MSG(msg); === modified file 'firewall/esp_prot_fw_msg.c' --- firewall/esp_prot_fw_msg.c 2010-03-10 17:44:36 +0000 +++ firewall/esp_prot_fw_msg.c 2010-03-18 12:09:47 +0000 @@ -56,7 +56,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_BEX_STORE_UPDATE, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_BEX_STORE_UPDATE, 0), -1, "build hdr failed\n"); // first add hash_length and num_hchain for each transform @@ -170,7 +170,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_ESP_PROT_TFM, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_ESP_PROT_TFM, 0), -1, "build hdr failed\n"); if (activate > 0) { @@ -331,7 +331,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_TRIGGER_UPDATE, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_TRIGGER_UPDATE, 0), -1, "build hdr failed\n"); HIP_DEBUG_HIT("src_hit", entry->inner_src_addr); @@ -496,7 +496,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_ANCHOR_CHANGE, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_ANCHOR_CHANGE, 0), -1, "build hdr failed\n"); HIP_DEBUG_HIT("src_hit", entry->inner_src_addr); === modified file 'firewall/firewall.c' --- firewall/firewall.c 2010-03-17 16:22:48 +0000 +++ firewall/firewall.c 2010-03-18 12:09:47 +0000 @@ -706,7 +706,7 @@ hip_lsi_t *lsi = NULL; HIP_IFE(!(msg = hip_msg_alloc()), -1); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_DEFAULT_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_DEFAULT_HIT, 0), -1, "build user hdr\n"); HIP_IFEL(hip_send_recv_daemon_info(msg, 0, hip_fw_sock), -1, "send/recv daemon info\n"); @@ -777,7 +777,7 @@ HIP_DEBUG("Firewall exit\n"); msg = hip_msg_alloc(); - if (hip_build_user_hdr(msg, SO_HIP_FIREWALL_QUIT, 0) || + if (hip_build_user_hdr(msg, HIP_MSG_FIREWALL_QUIT, 0) || hip_send_recv_daemon_info(msg, 1, hip_fw_sock)) { HIP_DEBUG("Failed to notify hipd of firewall shutdown.\n"); } @@ -2112,7 +2112,7 @@ system_print("ip6tables -I FORWARD -j HIPFW-FORWARD"); //HIP_IFEL(!(msg = hip_msg_alloc()), -1, "malloc\n"); - //HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_PING, 0), -1, "hdr\n") + //HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_PING, 0), -1, "hdr\n") while (hip_fw_get_default_hit() == NULL) { HIP_DEBUG("Sleeping until hipd is running...\n"); @@ -2411,7 +2411,7 @@ highest_descriptor = maxof(3, hip_fw_async_sock, h4->fd, h6->fd); hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_FIREWALL_START, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_FIREWALL_START, 0), -1, "build user hdr\n"); if (hip_send_recv_daemon_info(msg, 1, hip_fw_sock)) { HIP_DEBUG("Failed to notify hipd of firewall start.\n"); @@ -2482,8 +2482,8 @@ if (is_root) { access_ok = 1; } else if (!is_root && - (msg_type >= HIP_SO_ANY_MIN && - msg_type <= HIP_SO_ANY_MAX)) { + (msg_type >= HIP_MSG_ANY_MIN && + msg_type <= HIP_MSG_ANY_MAX)) { access_ok = 1; } if (!access_ok) { @@ -2512,8 +2512,8 @@ if (ntohs(sock_addr.sin6_port) != HIP_DAEMON_LOCAL_PORT) { int type = hip_get_msg_type(msg); - if (type == SO_HIP_FW_BEX_DONE) { - HIP_DEBUG("SO_HIP_FW_BEX_DONE\n"); + if (type == HIP_MSG_FW_BEX_DONE) { + HIP_DEBUG("HIP_MSG_FW_BEX_DONE\n"); HIP_DEBUG("%d == %d\n", ntohs(sock_addr.sin6_port), HIP_DAEMON_LOCAL_PORT); } === modified file 'firewall/firewall_control.c' --- firewall/firewall_control.c 2010-03-09 18:26:22 +0000 +++ firewall/firewall_control.c 2010-03-18 12:09:47 +0000 @@ -51,12 +51,12 @@ /* update bex_state in firewalldb */ switch (msg_type) { - case SO_HIP_FW_BEX_DONE: + case HIP_MSG_FW_BEX_DONE: err = hip_firewall_set_bex_state(src_hit, dst_hit, (dst_hit ? 1 : -1)); break; - case SO_HIP_FW_UPDATE_DB: + case HIP_MSG_FW_UPDATE_DB: err = hip_firewall_set_bex_state(src_hit, dst_hit, 0); break; default: @@ -83,28 +83,28 @@ HIP_DEBUG("of type %d\n", type); switch (type) { - case SO_HIP_FW_BEX_DONE: - case SO_HIP_FW_UPDATE_DB: + case HIP_MSG_FW_BEX_DONE: + case HIP_MSG_FW_UPDATE_DB: if (hip_lsi_support) { hip_handle_bex_state_update(msg); } break; - case SO_HIP_IPSEC_ADD_SA: + case HIP_MSG_IPSEC_ADD_SA: HIP_DEBUG("Received add sa request from hipd\n"); HIP_IFEL(handle_sa_add_request(msg), -1, "hip userspace sadb add did NOT succeed\n"); break; - case SO_HIP_IPSEC_DELETE_SA: + case HIP_MSG_IPSEC_DELETE_SA: HIP_DEBUG("Received delete sa request from hipd\n"); HIP_IFEL(handle_sa_delete_request(msg), -1, "hip userspace sadb delete did NOT succeed\n"); break; - case SO_HIP_IPSEC_FLUSH_ALL_SA: + case HIP_MSG_IPSEC_FLUSH_ALL_SA: HIP_DEBUG("Received flush all sa request from hipd\n"); HIP_IFEL(handle_sa_flush_all_request(msg), -1, "hip userspace sadb flush all did NOT succeed\n"); break; - case SO_HIP_SET_HIPPROXY_ON: + case HIP_MSG_SET_HIPPROXY_ON: HIP_DEBUG("Received HIP PROXY STATUS: ON message from hipd\n"); HIP_DEBUG("Proxy is on\n"); if (!hip_proxy_status) { @@ -112,7 +112,7 @@ } hip_proxy_status = 1; break; - case SO_HIP_SET_HIPPROXY_OFF: + case HIP_MSG_SET_HIPPROXY_OFF: HIP_DEBUG("Received HIP PROXY STATUS: OFF message from hipd\n"); HIP_DEBUG("Proxy is off\n"); if (hip_proxy_status) { @@ -120,36 +120,36 @@ } hip_proxy_status = 0; break; - case SO_HIP_SET_OPPTCP_ON: + case HIP_MSG_SET_OPPTCP_ON: HIP_DEBUG("Opptcp on\n"); if (!hip_opptcp) { hip_fw_init_opptcp(); } hip_opptcp = 1; break; - case SO_HIP_SET_OPPTCP_OFF: + case HIP_MSG_SET_OPPTCP_OFF: HIP_DEBUG("Opptcp on\n"); if (hip_opptcp) { hip_fw_uninit_opptcp(); } hip_opptcp = 0; break; - case SO_HIP_GET_PEER_HIT: + case HIP_MSG_GET_PEER_HIT: if (hip_proxy_status) { err = hip_fw_proxy_set_peer_hit(msg); } else if (system_based_opp_mode) { err = hip_fw_sys_opp_set_peer_hit(msg); } break; - case SO_HIP_TURN_INFO: + case HIP_MSG_TURN_INFO: // struct hip_turn_info *turn = hip_get_param_contents(HIP_PARAM_TURN_INFO); // save to database break; - case SO_HIP_RESET_FIREWALL_DB: + case HIP_MSG_RESET_FIREWALL_DB: hip_firewall_cache_delete_hldb(0); hip_firewall_delete_hldb(); break; - case SO_HIP_OFFER_FULLRELAY: + case HIP_MSG_OFFER_FULLRELAY: if (!esp_relay) { HIP_DEBUG("Enabling ESP relay\n"); hip_fw_init_esp_relay(); @@ -157,28 +157,28 @@ HIP_DEBUG("ESP relay already enabled\n"); } break; - case SO_HIP_CANCEL_FULLRELAY: + case HIP_MSG_CANCEL_FULLRELAY: HIP_DEBUG("Disabling ESP relay\n"); hip_fw_uninit_esp_relay(); break; - case SO_HIP_SET_DATAPACKET_MODE_ON: + case HIP_MSG_SET_DATAPACKET_MODE_ON: HIP_DEBUG("Setting HIP DATA PACKET MODE ON \n "); hip_datapacket_mode = 1; break; - case SO_HIP_SET_DATAPACKET_MODE_OFF: + case HIP_MSG_SET_DATAPACKET_MODE_OFF: HIP_DEBUG("Setting HIP DATA PACKET MODE OFF \n "); hip_datapacket_mode = 0; break; - case SO_HIP_FW_FLUSH_SYS_OPP_HIP: + case HIP_MSG_FW_FLUSH_SYS_OPP_HIP: if (system_based_opp_mode) { HIP_DEBUG("Flushing system-based opportunistic mode " \ "iptables chains\n"); hip_fw_flush_system_based_opp_chains(); } break; - case SO_HIP_FIREWALL_STATUS: + case HIP_MSG_FIREWALL_STATUS: msg_out = hip_msg_alloc(); - HIP_IFEL(hip_build_user_hdr(msg_out, SO_HIP_FIREWALL_START, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg_out, HIP_MSG_FIREWALL_START, 0), -1, "Couldn't build message to daemon\n"); HIP_IFEL(hip_send_recv_daemon_info(msg_out, 1, hip_fw_sock), -1, "Couldn't notify daemon of firewall presence\n"); === modified file 'firewall/lsi.c' --- firewall/lsi.c 2010-03-10 17:44:36 +0000 +++ firewall/lsi.c 2010-03-18 12:09:47 +0000 @@ -70,7 +70,7 @@ * message correctly */ /* build the message header */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_TRIGGER_BEX, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_TRIGGER_BEX, 0), -1, "build hdr failed\n"); /* destination HIT, LSI or IP are obligatory */ @@ -196,7 +196,7 @@ HIP_IFEL(!(msg = hip_msg_alloc()), -1, "malloc failed\n"); hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_HA_INFO, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_HA_INFO, 0), -1, "Building of daemon header failed\n"); HIP_IFEL(hip_send_recv_daemon_info(msg, 0, 0), -1, "send recv daemon info\n"); @@ -490,7 +490,7 @@ HIP_IFE(!(msg = hip_msg_alloc()), -1); /* build the message header */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_PEER_HIT, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_PEER_HIT, 0), -1, "build hdr failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) (local_hit), === modified file 'firewall/opptcp.c' --- firewall/opptcp.c 2010-03-10 17:44:36 +0000 +++ firewall/opptcp.c 2010-03-18 12:09:47 +0000 @@ -63,7 +63,7 @@ HIP_IFE(!(msg = hip_msg_alloc()), -1); /* build the message header */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_OPPTCP_UNBLOCK_AND_BLACKLIST, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_OPPTCP_UNBLOCK_AND_BLACKLIST, 0), -1, "build hdr failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) (peer_ip), @@ -333,7 +333,7 @@ HIP_IFE(!(msg = hip_msg_alloc()), -1); /* build the message header */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_OPPTCP_SEND_TCP_PACKET, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_OPPTCP_SEND_TCP_PACKET, 0), -1, "build hdr failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) hdr, === modified file 'firewall/proxy.c' --- firewall/proxy.c 2010-03-16 21:09:08 +0000 +++ firewall/proxy.c 2010-03-18 12:09:47 +0000 @@ -43,7 +43,7 @@ HIP_IFEL(!(msg = HIP_MALLOC(HIP_MAX_PACKET, 0)), -1, "alloc\n"); hip_msg_init(msg); HIP_IFEL(hip_build_user_hdr(msg, - SO_HIP_HIPPROXY_STATUS_REQUEST, 0), + HIP_MSG_HIPPROXY_STATUS_REQUEST, 0), -1, "Build hdr failed\n"); //n = hip_sendto(msg, &hip_firewall_addr); @@ -81,7 +81,7 @@ HIP_IFE(!(msg = hip_msg_alloc()), -1); /* build the message header */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_PEER_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_PEER_HIT, 0), -1, "build hdr failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) (local_hit), @@ -124,7 +124,7 @@ //struct gaih_addrtuple *at = NULL; HIP_IFEL(!(msg = hip_msg_alloc()), -1, "malloc failed\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_DEFAULT_HIT, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_DEFAULT_HIT, 0), -1, "Fail to get hits"); HIP_IFEL(hip_send_recv_daemon_info(msg, 0, hip_fw_sock), -1, "send/recv\n"); HIP_IFEL(!(param = hip_get_param(msg, HIP_PARAM_HIT)), -1, === modified file 'firewall/sysopp.c' --- firewall/sysopp.c 2010-03-10 17:44:36 +0000 +++ firewall/sysopp.c 2010-03-18 12:09:47 +0000 @@ -44,7 +44,7 @@ /* Build a HIP message with socket option to get all HITs. */ HIP_IFEL(!(msg = hip_msg_alloc()), -1, "malloc failed\n"); hip_msg_init(msg); - HIP_IFE(hip_build_user_hdr(msg, SO_HIP_GET_HITS, 0), -1); + HIP_IFE(hip_build_user_hdr(msg, HIP_MSG_GET_HITS, 0), -1); /* Send the message to the daemon. * The daemon fills the message. */ === modified file 'firewall/user_ipsec_fw_msg.c' --- firewall/user_ipsec_fw_msg.c 2010-03-10 17:44:36 +0000 +++ firewall/user_ipsec_fw_msg.c 2010-03-18 12:09:47 +0000 @@ -38,7 +38,7 @@ /* send this message on activation or for deactivation when -I is specified */ if (activate || hip_kernel_ipsec_fallback) { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_USERSPACE_IPSEC, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_USERSPACE_IPSEC, 0), -1, "build hdr failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) &activate, @@ -48,7 +48,7 @@ HIP_DEBUG("sending userspace ipsec (de-)activation to hipd...\n"); } else { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_RST, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_RST, 0), -1, "build hdr failed\n"); HIP_DEBUG("sending close all connections to hipd...\n"); === modified file 'hipd/accessor.c' --- hipd/accessor.c 2010-03-16 20:43:59 +0000 +++ hipd/accessor.c 2010-03-18 12:09:47 +0000 @@ -78,8 +78,8 @@ /** * Set opportunistic TCP status on or off * - * @param msg a message with message type as SO_HIP_SET_OPPTCP_ON - * or SO_HIP_SET_OPPTCP_OFF + * @param msg a message with message type as HIP_MSG_SET_OPPTCP_ON + * or HIP_MSG_SET_OPPTCP_OFF */ void hip_set_opportunistic_tcp_status(struct hip_common *msg) { @@ -116,7 +116,7 @@ } } - if (type == SO_HIP_SET_OPPTCP_ON) { + if (type == HIP_MSG_SET_OPPTCP_ON) { hip_use_opptcp = 1; } else { hip_use_opptcp = 0; @@ -168,8 +168,8 @@ hip_msg_init(msg); HIP_IFE(hip_build_user_hdr(msg, (opportunistic_mode == 2 ? - SO_HIP_SET_OPPTCP_ON : - SO_HIP_SET_OPPTCP_OFF), + HIP_MSG_SET_OPPTCP_ON : + HIP_MSG_SET_OPPTCP_OFF), 0), -1); hip_set_opportunistic_tcp_status(msg); @@ -192,7 +192,7 @@ hip_msg_init(msg); HIP_IFEL(hip_build_user_hdr(msg, - SO_HIP_ANSWER_OPPORTUNISTIC_MODE_QUERY, 0), + HIP_MSG_ANSWER_OPPORTUNISTIC_MODE_QUERY, 0), -1, "build user header failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) &opp_mode, @@ -209,7 +209,7 @@ /** * turn hi3 support on or off * - * @param msg a message with type SO_HIP_SET_HI3_ON or SO_HIP_SET_HI3_OFF + * @param msg a message with type HIP_MSG_SET_HI3_ON or HIP_MSG_SET_HI3_OFF */ void hip_set_hi3_status(struct hip_common *msg) { @@ -237,12 +237,12 @@ } } - if (type == SO_HIP_SET_HI3_ON) { + if (type == HIP_MSG_SET_HI3_ON) { hip_i3_init(); hip_use_hi3 = 1; - hip_locator_status = SO_HIP_SET_LOCATOR_ON; + hip_locator_status = HIP_MSG_SET_LOCATOR_ON; } else { - hip_locator_status = SO_HIP_SET_LOCATOR_OFF; + hip_locator_status = HIP_MSG_SET_LOCATOR_OFF; hip_hi3_clean(); hip_use_hi3 = 0; } @@ -289,7 +289,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_ANSWER_IP_HIT_MAPPING_QUERY, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_ANSWER_IP_HIT_MAPPING_QUERY, 0), -1, "build user header failed\n"); HIP_IFEL(hip_build_param_contents(msg, === modified file 'hipd/bos.c' --- hipd/bos.c 2010-03-16 22:35:54 +0000 +++ hipd/bos.c 2010-03-18 12:09:47 +0000 @@ -74,7 +74,7 @@ HIP_DEBUG("\n"); /* Extra consistency test */ - if (hip_get_msg_type(msg) != SO_HIP_BOS) { + if (hip_get_msg_type(msg) != HIP_MSG_BOS) { err = -EINVAL; HIP_ERROR("Bad message type\n"); goto out_err; === modified file 'hipd/cert.c' --- hipd/cert.c 2010-03-05 08:47:53 +0000 +++ hipd/cert.c 2010-03-18 12:09:47 +0000 @@ -251,7 +251,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_SPKI_SIGN, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_SPKI_SIGN, 0), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_spki_info(msg, cert), -1, "Failed to build cert_info\n"); @@ -666,7 +666,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_SPKI_SIGN, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_SPKI_SIGN, 0), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_spki_info(msg, cert), -1, "Failed to build cert_info\n"); @@ -1027,7 +1027,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_X509V3_SIGN, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_X509V3_SIGN, 0), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_x509_resp(msg, (char *) der_cert, der_cert_len), -1, "Failed to create x509 response parameter\n"); @@ -1122,7 +1122,7 @@ } hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_X509V3_VERIFY, err), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_X509V3_VERIFY, err), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_x509_resp(msg, (char *) &der_cert, p->der_len), -1, "Failed to create x509 response parameter\n"); === modified file 'hipd/close.c' --- hipd/close.c 2010-03-16 22:10:36 +0000 +++ hipd/close.c 2010-03-18 12:09:47 +0000 @@ -69,7 +69,7 @@ HIP_DEBUG("State is ESTABLISHED in current host association, sending " \ "CLOSE message to peer.\n"); - hip_firewall_set_bex_data(SO_HIP_FW_UPDATE_DB, + hip_firewall_set_bex_data(HIP_MSG_FW_UPDATE_DB, entry, &entry->hit_our, &entry->hit_peer); @@ -162,7 +162,7 @@ msg_to_firewall = hip_msg_alloc(); hip_msg_init(msg_to_firewall); HIP_IFE(hip_build_user_hdr(msg_to_firewall, - SO_HIP_RESET_FIREWALL_DB, 0), -1); + HIP_MSG_RESET_FIREWALL_DB, 0), -1); bzero(&sock_addr, sizeof(sock_addr)); sock_addr.sin6_family = AF_INET6; sock_addr.sin6_port = htons(HIP_FIREWALL_PORT); === modified file 'hipd/dht.c' --- hipd/dht.c 2010-03-11 11:12:11 +0000 +++ hipd/dht.c 2010-03-18 12:09:47 +0000 @@ -42,7 +42,7 @@ int hip_init_dht_sockets(int *socket, int *socket_status) { int err = 0; - if (hip_opendht_inuse == SO_HIP_DHT_ON) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON) { if (*socket_status == STATE_OPENDHT_IDLE) { HIP_DEBUG("Connecting to the DHT with socket no: %d \n", *socket); if (*socket < 1) { @@ -76,7 +76,7 @@ struct in6_addr tmp_hit; /* Check if OpenDHT is off then out_err*/ - HIP_IFE((hip_opendht_inuse != SO_HIP_DHT_ON), 0); + HIP_IFE((hip_opendht_inuse != HIP_MSG_DHT_ON), 0); HIP_IFEL(hip_get_default_hit(&tmp_hit), -1, "No HIT found\n"); @@ -106,7 +106,7 @@ * while it may be too long for OpenDHT */ char out_packet[HIP_MAX_PACKET]; - HIP_IFE((hip_opendht_inuse != SO_HIP_DHT_ON), 0); + HIP_IFE((hip_opendht_inuse != HIP_MSG_DHT_ON), 0); memset(out_packet, '\0', HIP_MAX_PACKET); opendht_error = opendht_put((unsigned char *) hostname, @@ -147,7 +147,7 @@ * while OpenDHT max size may be lower */ int err = 0; - HIP_IFE((hip_opendht_inuse != SO_HIP_DHT_ON), 0); + HIP_IFE((hip_opendht_inuse != HIP_MSG_DHT_ON), 0); memset(out_packet, '\0', HIP_MAX_PACKET); opendht_error = hip_dht_put_hdrr((unsigned char *) tmp_hit_str, @@ -271,7 +271,7 @@ int err = 0; char packet[2048]; - HIP_IFE((hip_opendht_inuse != SO_HIP_DHT_ON), 0); + HIP_IFE((hip_opendht_inuse != HIP_MSG_DHT_ON), 0); if (*socket_status == STATE_OPENDHT_IDLE) { HIP_DEBUG("Connecting to the DHT with socket no: %d \n", *socket); @@ -520,7 +520,7 @@ alg = hip_get_host_id_algo(hostid); /* Type of the hip msg in header has been modified to - * user message type SO_HIP_VERIFY_DHT_HDRR_RESP , to + * user message type HIP_MSG_VERIFY_DHT_HDRR_RESP , to * get it here. Revert it back to HDRR to give it * original shape as returned by the DHT and * then verify signature @@ -589,7 +589,7 @@ { int err = 0; - HIP_IFE((hip_opendht_inuse != SO_HIP_DHT_ON), 0); + HIP_IFE((hip_opendht_inuse != HIP_MSG_DHT_ON), 0); HIP_DEBUG("DHT error count now %d/%d.\n", hip_opendht_error_count, OPENDHT_ERROR_COUNT_MAX); === modified file 'hipd/hipd.c' --- hipd/hipd.c 2010-03-16 12:48:19 +0000 +++ hipd/hipd.c 2010-03-18 12:09:47 +0000 @@ -113,16 +113,16 @@ char opendht_current_key[INET6_ADDRSTRLEN + 2]; /* now DHT is always off, so you have to set it on if you want to use it */ -int hip_opendht_inuse = SO_HIP_DHT_OFF; +int hip_opendht_inuse = HIP_MSG_DHT_OFF; int hip_opendht_error_count = 0; /* Error count, counting errors from libhipopendht */ -int hip_buddies_inuse = SO_HIP_BUDDIES_OFF; +int hip_buddies_inuse = HIP_MSG_BUDDIES_OFF; /* Tells to the daemon should it build LOCATOR parameters to R1 and I2 */ -int hip_locator_status = SO_HIP_SET_LOCATOR_OFF; +int hip_locator_status = HIP_MSG_SET_LOCATOR_OFF; /* It tells the daemon to set tcp timeout parameters. Added By Tao Wan, on 09.Jan.2008 */ -int hip_tcptimeout_status = SO_HIP_SET_TCPTIMEOUT_ON; +int hip_tcptimeout_status = HIP_MSG_SET_TCPTIMEOUT_ON; /* Create /etc/hip stuff and exit (used for binary hipfw packaging) */ int create_configs_and_exit = 0; @@ -156,7 +156,7 @@ uint8_t esp_prot_transforms[MAX_NUM_TRANSFORMS]; long esp_prot_num_parallel_hchains = 0; -int hip_shotgun_status = SO_HIP_SHOTGUN_OFF; +int hip_shotgun_status = HIP_MSG_SHOTGUN_OFF; int hip_trigger_update_on_heart_beat_failure = 1; int hip_wait_addr_changes_to_stabilize = 1; @@ -257,9 +257,9 @@ msg_type = hip_get_msg_type(msg); - if (msg_type == SO_HIP_AGENT_PING) { + if (msg_type == HIP_MSG_AGENT_PING) { hip_msg_init(msg); - hip_build_user_hdr(msg, SO_HIP_AGENT_PING_REPLY, 0); + hip_build_user_hdr(msg, HIP_MSG_AGENT_PING_REPLY, 0); n = hip_send_agent(msg); HIP_IFEL(n < 0, 0, "sendto() failed on agent socket\n"); @@ -271,7 +271,7 @@ } hip_agent_status = 1; } - } else if (msg_type == SO_HIP_AGENT_QUIT) { + } else if (msg_type == HIP_MSG_AGENT_QUIT) { HIP_DEBUG("Agent quit.\n"); hip_agent_status = 0; } else if (msg_type == HIP_R1 || msg_type == HIP_I1) { @@ -492,7 +492,7 @@ hipd_set_state(HIPD_STATE_EXEC); while (hipd_get_state() != HIPD_STATE_CLOSED) { /* prepare file descriptor sets */ - if (hip_opendht_inuse == SO_HIP_DHT_ON) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON) { FD_ZERO(&write_fdset); if (hip_opendht_fqdn_sent == STATE_OPENDHT_WAITING_CONNECT) { FD_SET(hip_opendht_sock_fqdn, &write_fdset); @@ -528,7 +528,7 @@ #ifdef CONFIG_HIP_FIREWALL if (hip_firewall_status < 0) { hip_msg_init(hipd_msg); - err = hip_build_user_hdr(hipd_msg, SO_HIP_FIREWALL_STATUS, 0); + err = hip_build_user_hdr(hipd_msg, HIP_MSG_FIREWALL_STATUS, 0); if (err) { HIP_ERROR("hip_build_user_hdr\n"); } else { @@ -540,7 +540,7 @@ #endif /* If DHT is on have to use write sets for asynchronic communication */ - if (hip_opendht_inuse == SO_HIP_DHT_ON) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON) { err = select((highest_descriptor + 1), &read_fdset, &write_fdset, NULL, &timeout); } else { @@ -715,10 +715,10 @@ } #ifdef CONFIG_HIP_DHT /* DHT SOCKETS HANDLING */ - if (hip_opendht_inuse == SO_HIP_DHT_ON && hip_opendht_sock_fqdn != -1) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON && hip_opendht_sock_fqdn != -1) { if (FD_ISSET(hip_opendht_sock_fqdn, &read_fdset) && FD_ISSET(hip_opendht_sock_fqdn, &write_fdset) && - (hip_opendht_inuse == SO_HIP_DHT_ON)) { + (hip_opendht_inuse == HIP_MSG_DHT_ON)) { HIP_DEBUG("DHT socket waiting for connect (readable and writable)\n"); } else if (FD_ISSET(hip_opendht_sock_fqdn, &write_fdset)) { if (address_count == 0) { @@ -728,7 +728,7 @@ } } if (FD_ISSET(hip_opendht_sock_fqdn, &read_fdset) && - (hip_opendht_inuse == SO_HIP_DHT_ON)) { + (hip_opendht_inuse == HIP_MSG_DHT_ON)) { /* Receive answer from openDHT FQDN->HIT mapping */ if (hip_opendht_fqdn_sent == STATE_OPENDHT_WAITING_ANSWER) { memset(opendht_response, '\0', sizeof(opendht_response)); @@ -753,7 +753,7 @@ } if (FD_ISSET(hip_opendht_sock_hit, &read_fdset) && FD_ISSET(hip_opendht_sock_hit, &write_fdset) && - (hip_opendht_inuse == SO_HIP_DHT_ON)) { + (hip_opendht_inuse == HIP_MSG_DHT_ON)) { HIP_ERROR("DHT socket waiting for connect (readable and writable)\n\n"); } else if (FD_ISSET(hip_opendht_sock_hit, &write_fdset)) { if (address_count == 0) { @@ -763,7 +763,7 @@ } } if ((FD_ISSET(hip_opendht_sock_hit, &read_fdset)) && - (hip_opendht_inuse == SO_HIP_DHT_ON)) { + (hip_opendht_inuse == HIP_MSG_DHT_ON)) { /* Receive answer from openDHT HIT->IP mapping */ if (hip_opendht_hit_sent == STATE_OPENDHT_WAITING_ANSWER) { memset(opendht_response, '\0', sizeof(opendht_response)); === modified file 'hipd/init.c' --- hipd/init.c 2010-03-17 17:23:33 +0000 +++ hipd/init.c 2010-03-18 12:09:47 +0000 @@ -650,7 +650,7 @@ #ifdef CONFIG_HIP_HI3 if (hip_use_i3) { - hip_locator_status = SO_HIP_SET_LOCATOR_ON; + hip_locator_status = HIP_MSG_SET_LOCATOR_ON; } #endif @@ -732,7 +732,7 @@ char port_buf[] = "00000"; int family; - HIP_IFEL((hip_opendht_inuse == SO_HIP_DHT_OFF), 0, "No DHT\n"); + HIP_IFEL((hip_opendht_inuse == HIP_MSG_DHT_OFF), 0, "No DHT\n"); /* Init the opendht_queue */ HIP_IFEL((hip_init_dht_queue() == -1), -1, "Failed to initialize opendht queue\n"); @@ -1173,7 +1173,7 @@ msg = hip_msg_alloc(); if (msg) { - hip_build_user_hdr(msg, SO_HIP_DAEMON_QUIT, 0); + hip_build_user_hdr(msg, HIP_MSG_DAEMON_QUIT, 0); hip_send_agent(msg); free(msg); } === modified file 'hipd/input.c' --- hipd/input.c 2010-03-11 08:56:57 +0000 +++ hipd/input.c 2010-03-18 12:09:47 +0000 @@ -520,7 +520,7 @@ HIP_DEBUG("Number of items in the peer addr list: %d ", ((struct lhash_st *) entry->peer_addr_list_to_be_added)->num_items); } - if (hip_shotgun_status == SO_HIP_SHOTGUN_ON + if (hip_shotgun_status == HIP_MSG_SHOTGUN_ON && type == HIP_R1 && entry->peer_addr_list_to_be_added && (((struct lhash_st *) entry->peer_addr_list_to_be_added)->num_items > 1 || @@ -2921,9 +2921,9 @@ out_err: if (entry->state == HIP_STATE_ESTABLISHED) { HIP_DEBUG("Send response to firewall \n"); - hip_firewall_set_bex_data(SO_HIP_FW_BEX_DONE, entry, &entry->hit_our, &entry->hit_peer); + hip_firewall_set_bex_data(HIP_MSG_FW_BEX_DONE, entry, &entry->hit_our, &entry->hit_peer); } else { - hip_firewall_set_bex_data(SO_HIP_FW_BEX_DONE, entry, NULL, NULL); + hip_firewall_set_bex_data(HIP_MSG_FW_BEX_DONE, entry, NULL, NULL); } if (ctx) { === modified file 'hipd/maintenance.c' --- hipd/maintenance.c 2010-03-18 08:39:07 +0000 +++ hipd/maintenance.c 2010-03-18 12:09:47 +0000 @@ -208,7 +208,7 @@ } hip_msg_init(msg); - err = hip_build_user_hdr(msg, SO_HIP_ADD_DB_HI, 0); + err = hip_build_user_hdr(msg, HIP_MSG_ADD_DB_HI, 0); if (err) { HIP_ERROR("build hdr failed: %s\n", strerror(err)); goto out_err; @@ -440,7 +440,7 @@ } } #ifdef CONFIG_HIP_DHT - if (hip_opendht_inuse == SO_HIP_DHT_ON) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON) { if (opendht_counter < 0) { hip_register_to_dht(); opendht_counter = OPENDHT_REFRESH_INIT; @@ -453,7 +453,7 @@ } else { queue_counter--; } - if (hip_buddies_inuse == SO_HIP_BUDDIES_ON) { + if (hip_buddies_inuse == HIP_MSG_BUDDIES_ON) { if (cert_publish_counter < 0) { err = hip_publish_certificates(); if (err < 0) { @@ -519,7 +519,7 @@ * Update firewall on host association state. Currently used by the * LSI and system-based opportunistic mode in the firewall. * - * @param action SO_HIP_FW_UPDATE_DB or SO_HIP_FW_BEX_DONE + * @param action HIP_MSG_FW_UPDATE_DB or HIP_MSG_FW_BEX_DONE * @param entry the host association * @param hit_s optional source HIT * @param hit_r optional destination HIT @@ -631,7 +631,7 @@ /** * tell firewall to turn on or off the ESP relay mode * - * @param action SO_HIP_OFFER_FULLRELAY or SO_HIP_CANCEL_FULLRELAY + * @param action HIP_MSG_OFFER_FULLRELAY or HIP_MSG_CANCEL_FULLRELAY * * @return zero on success or negative on failure */ @@ -644,7 +644,7 @@ HIP_DEBUG("Setting ESP relay to %d\n", action); HIP_IFE(!(msg = hip_msg_alloc()), -ENOMEM); HIP_IFEL(hip_build_user_hdr(msg, - action ? SO_HIP_OFFER_FULLRELAY : SO_HIP_CANCEL_FULLRELAY, 0), + action ? HIP_MSG_OFFER_FULLRELAY : HIP_MSG_CANCEL_FULLRELAY, 0), -1, "Build header failed\n"); sent = hip_sendto_firewall(msg); === modified file 'hipd/nat.c' --- hipd/nat.c 2010-03-07 16:11:10 +0000 +++ hipd/nat.c 2010-03-18 12:09:47 +0000 @@ -280,10 +280,10 @@ nat = nat_mode; switch (nat) { - case SO_HIP_SET_NAT_PLAIN_UDP: + case HIP_MSG_SET_NAT_PLAIN_UDP: nat = HIP_NAT_MODE_PLAIN_UDP; break; - case SO_HIP_SET_NAT_NONE: + case HIP_MSG_SET_NAT_NONE: nat = HIP_NAT_MODE_NONE; break; default: === modified file 'hipd/netdev.c' --- hipd/netdev.c 2010-03-16 18:16:38 +0000 +++ hipd/netdev.c 2010-03-18 12:09:47 +0000 @@ -762,7 +762,7 @@ bzero(&result, sizeof(result)); bzero(dht_response, sizeof(dht_response)); - if (hip_opendht_inuse == SO_HIP_DHT_ON) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON) { memset(dht_locator_last, '\0', sizeof(dht_locator_last)); HIP_IFEL(hip_opendht_get_key(&handle_hdrr_value, opendht_serving_gateway, @@ -861,7 +861,7 @@ } /* Try to resolve HIT to IPv4/IPv6 address with OpenDHT server */ - if (hip_opendht_inuse == SO_HIP_DHT_ON && !skip_namelookup) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON && !skip_namelookup) { char hit_str[INET6_ADDRSTRLEN]; memset(hit_str, 0, sizeof(hit_str)); @@ -1065,7 +1065,7 @@ HIP_DEBUG("No information of peer found, trying broadcast\n"); broadcast = 1; shotgun_status_orig = hip_shotgun_status; - hip_shotgun_status = SO_HIP_SHOTGUN_ON; + hip_shotgun_status = HIP_MSG_SHOTGUN_ON; IPV4_TO_IPV6_MAP(&bcast, dst_addr); err = 0; } === modified file 'hipd/oppdb.c' --- hipd/oppdb.c 2010-03-18 10:01:23 +0000 +++ hipd/oppdb.c 2010-03-18 12:09:47 +0000 @@ -223,7 +223,7 @@ HIP_IFEL((app_id->sin6_port == 0), 0, "Zero port, ignore\n"); HIP_IFE(!(message = hip_msg_alloc()), -1); - HIP_IFEL(hip_build_user_hdr(message, SO_HIP_GET_PEER_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(message, HIP_MSG_GET_PEER_HIT, 0), -1, "build user header failed\n"); if (!opp_info) { @@ -661,7 +661,7 @@ if (!opportunistic_mode) { hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_PEER_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_PEER_HIT, 0), -1, "Building of user header failed\n"); err = -11; /* Force immediately to send message to app */ goto out_err; @@ -709,7 +709,7 @@ ipv6_addr_copy(&id, &dst_ip); if (hip_for_each_ha(hip_hadb_map_ip_to_hit, &id)) { HIP_DEBUG_HIT("existing HA found with HIT", &id); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_PEER_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_PEER_HIT, 0), -1, "Building of msg header failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) (&id), @@ -738,7 +738,7 @@ /* Fallback if we have contacted peer before the peer did not * support HIP the last time */ if (hip_oppipdb_find_byip((struct in6_addr *) &dst_ip)) { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_PEER_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_PEER_HIT, 0), -1, "Building of user header failed\n"); err = -11; /* Force immediately to send message to app */ @@ -795,7 +795,7 @@ if (!opportunistic_mode) { hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_OPPTCP_UNBLOCK_AND_BLACKLIST, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_OPPTCP_UNBLOCK_AND_BLACKLIST, 0), -1, "Building of user header failed\n"); } === modified file 'hipd/output.c' --- hipd/output.c 2010-03-16 15:10:38 +0000 +++ hipd/output.c 2010-03-18 12:09:47 +0000 @@ -462,7 +462,7 @@ HIP_DEBUG("Sending I1 to the following addresses:\n"); hip_print_peer_addresses_to_be_added(entry); - if (hip_shotgun_status == SO_HIP_SHOTGUN_OFF || + if (hip_shotgun_status == HIP_MSG_SHOTGUN_OFF || (entry->peer_addr_list_to_be_added == NULL)) { HIP_IFEL(hip_hadb_get_peer_addr(entry, &peer_addr), -1, "No preferred IP address for the peer.\n"); @@ -1348,7 +1348,7 @@ * */ - if (hip_shotgun_status == SO_HIP_SHOTGUN_OFF) { + if (hip_shotgun_status == HIP_MSG_SHOTGUN_OFF) { if (IN6_IS_ADDR_V4MAPPED(peer_addr) && ((hip_get_nat_mode(entry) != HIP_NAT_MODE_NONE) || dst_port != 0)) { return hip_send_udp_from_one_src(local_addr, peer_addr, src_port, dst_port, === modified file 'hipd/update.c' --- hipd/update.c 2010-03-09 18:26:22 +0000 +++ hipd/update.c 2010-03-18 12:09:47 +0000 @@ -41,7 +41,7 @@ hip_msg_init(locator_msg); HIP_IFEL(hip_build_user_hdr(locator_msg, - SO_HIP_SET_LOCATOR_ON, 0), -1, + HIP_MSG_SET_LOCATOR_ON, 0), -1, "Failed to add user header\n"); HIP_IFEL(hip_build_locators_old(locator_msg, 0), -1, "Failed to build locators\n"); @@ -320,7 +320,7 @@ goto out_err; } - if (hip_shotgun_status == SO_HIP_SHOTGUN_OFF) { + if (hip_shotgun_status == HIP_MSG_SHOTGUN_OFF) { switch (type) { case HIP_UPDATE_LOCATOR: HIP_IFEL(hip_select_local_addr_for_first_update(ha, src_addr, dst_addr, &local_addr), -1, @@ -423,7 +423,7 @@ nsupdate(0); } - if (hip_locator_status == SO_HIP_SET_LOCATOR_ON) { + if (hip_locator_status == HIP_MSG_SET_LOCATOR_ON) { hip_recreate_all_precreated_r1_packets(); } if (locator_msg) { @@ -602,7 +602,7 @@ msg = hip_msg_alloc(); HIP_IFEL(!msg, -1, "msg alloc failed\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_FW_FLUSH_SYS_OPP_HIP, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_FW_FLUSH_SYS_OPP_HIP, 0), -1, "build hdr failed\n"); err = hip_sendto_firewall(msg); === modified file 'hipd/user.c' --- hipd/user.c 2010-03-16 18:16:38 +0000 +++ hipd/user.c 2010-03-18 12:09:47 +0000 @@ -35,8 +35,8 @@ /** * Handles a user message. * - * @note If you added a SO_HIP_NEWMODE in lib/core/icomm.h, you also need to - * add a case block for your SO_HIP_NEWMODE constant in the + * @note If you added a HIP_MSG_NEWMODE in lib/core/icomm.h, you also need to + * add a case block for your HIP_MSG_NEWMODE constant in the * switch(msg_type) block in this function. * @param msg a pointer to the received user message HIP packet. * @param src @@ -71,7 +71,7 @@ if (is_root) { access_ok = 1; } else if (!is_root && - (msg_type >= HIP_SO_ANY_MIN && msg_type <= HIP_SO_ANY_MAX)) { + (msg_type >= HIP_MSG_ANY_MIN && msg_type <= HIP_MSG_ANY_MAX)) { access_ok = 1; } @@ -92,40 +92,40 @@ //hip_message_type_name(msg_type)); switch (msg_type) { - case SO_HIP_NULL_OP: + case HIP_MSG_NULL_OP: HIP_DEBUG("Null op\n"); break; - case SO_HIP_PING: + case HIP_MSG_PING: break; - case SO_HIP_ADD_LOCAL_HI: + case HIP_MSG_ADD_LOCAL_HI: err = hip_handle_add_local_hi(msg); break; - case SO_HIP_DEL_LOCAL_HI: + case HIP_MSG_DEL_LOCAL_HI: err = hip_handle_del_local_hi(msg); break; - case SO_HIP_ADD_PEER_MAP_HIT_IP: - HIP_DEBUG("Handling SO_HIP_ADD_PEER_MAP_HIT_IP.\n"); + case HIP_MSG_ADD_PEER_MAP_HIT_IP: + HIP_DEBUG("Handling HIP_MSG_ADD_PEER_MAP_HIT_IP.\n"); err = hip_add_peer_map(msg); if (err) { HIP_ERROR("add peer mapping failed.\n"); goto out_err; } break; - case SO_HIP_RST: + case HIP_MSG_RST: //send_response = 0; err = hip_send_close(msg, 1); break; - case SO_HIP_BOS: + case HIP_MSG_BOS: err = hip_send_bos(msg); break; - case SO_HIP_SET_NAT_ICE_UDP: + case HIP_MSG_SET_NAT_ICE_UDP: HIP_DEBUG("Setting LOCATOR ON, when ice is on\n"); - hip_locator_status = SO_HIP_SET_LOCATOR_ON; + hip_locator_status = HIP_MSG_SET_LOCATOR_ON; HIP_DEBUG("hip_locator status = %d (should be %d)\n", - hip_locator_status, SO_HIP_SET_LOCATOR_ON); + hip_locator_status, HIP_MSG_SET_LOCATOR_ON); /* no break statement here intentionally */ - case SO_HIP_SET_NAT_NONE: - case SO_HIP_SET_NAT_PLAIN_UDP: + case HIP_MSG_SET_NAT_NONE: + case HIP_MSG_SET_NAT_PLAIN_UDP: HIP_IFEL(hip_user_nat_mode(msg_type), -1, "Error when setting daemon NAT status to \"on\"\n"); @@ -134,85 +134,85 @@ HIP_DEBUG("Recreate all R1s\n"); hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_LOCATOR_GET: + case HIP_MSG_LOCATOR_GET: HIP_DEBUG("Got a request for locators\n"); hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_LOCATOR_GET, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_LOCATOR_GET, 0), -1, "Failed to build user message header.: %s\n", strerror(err)); if ((err = hip_build_locators_old(msg, 0)) < 0) { HIP_DEBUG("LOCATOR parameter building failed\n"); } break; - case SO_HIP_SET_LOCATOR_ON: + case HIP_MSG_SET_LOCATOR_ON: HIP_DEBUG("Setting LOCATOR ON\n"); - hip_locator_status = SO_HIP_SET_LOCATOR_ON; + hip_locator_status = HIP_MSG_SET_LOCATOR_ON; HIP_DEBUG("hip_locator status = %d (should be %d)\n", - hip_locator_status, SO_HIP_SET_LOCATOR_ON); + hip_locator_status, HIP_MSG_SET_LOCATOR_ON); HIP_DEBUG("Recreate all R1s\n"); hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_SET_LOCATOR_OFF: + case HIP_MSG_SET_LOCATOR_OFF: HIP_DEBUG("Setting LOCATOR OFF\n"); - hip_locator_status = SO_HIP_SET_LOCATOR_OFF; + hip_locator_status = HIP_MSG_SET_LOCATOR_OFF; HIP_DEBUG("hip_locator status = %d (should be %d)\n", - hip_locator_status, SO_HIP_SET_LOCATOR_OFF); + hip_locator_status, HIP_MSG_SET_LOCATOR_OFF); hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_HEARTBEAT: + case HIP_MSG_HEARTBEAT: heartbeat = hip_get_param(msg, HIP_PARAM_HEARTBEAT); hip_icmp_interval = heartbeat->heartbeat; heartbeat_counter = hip_icmp_interval; HIP_DEBUG("Received heartbeat interval (%d seconds)\n", hip_icmp_interval); break; - case SO_HIP_SET_DEBUG_ALL: + case HIP_MSG_SET_DEBUG_ALL: /* Displays all debugging messages. */ _HIP_DEBUG("Handling DEBUG ALL user message.\n"); HIP_IFEL(hip_set_logdebug(LOGDEBUG_ALL), -1, "Error when setting daemon DEBUG status to ALL\n"); break; - case SO_HIP_SET_DEBUG_MEDIUM: + case HIP_MSG_SET_DEBUG_MEDIUM: /* Removes debugging messages. */ HIP_DEBUG("Handling DEBUG MEDIUM user message.\n"); HIP_IFEL(hip_set_logdebug(LOGDEBUG_MEDIUM), -1, "Error when setting daemon DEBUG status to MEDIUM\n"); break; - case SO_HIP_SET_DEBUG_NONE: + case HIP_MSG_SET_DEBUG_NONE: /* Removes debugging messages. */ HIP_DEBUG("Handling DEBUG NONE user message.\n"); HIP_IFEL(hip_set_logdebug(LOGDEBUG_NONE), -1, "Error when setting daemon DEBUG status to NONE\n"); break; - case SO_HIP_CONF_PUZZLE_NEW: + case HIP_MSG_CONF_PUZZLE_NEW: err = hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_CONF_PUZZLE_GET: + case HIP_MSG_CONF_PUZZLE_GET: err = hip_get_puzzle_difficulty_msg(msg); break; - case SO_HIP_CONF_PUZZLE_SET: + case HIP_MSG_CONF_PUZZLE_SET: err = hip_set_puzzle_difficulty_msg(msg); break; - case SO_HIP_CONF_PUZZLE_INC: + case HIP_MSG_CONF_PUZZLE_INC: dst_hit = hip_get_param_contents(msg, HIP_PARAM_HIT); hip_inc_cookie_difficulty(dst_hit); break; - case SO_HIP_CONF_PUZZLE_DEC: + case HIP_MSG_CONF_PUZZLE_DEC: dst_hit = hip_get_param_contents(msg, HIP_PARAM_HIT); hip_dec_cookie_difficulty(dst_hit); break; #ifdef CONFIG_HIP_I3 - case SO_HIP_SET_HI3_ON: + case HIP_MSG_SET_HI3_ON: hip_set_hi3_status(msg); break; - case SO_HIP_SET_HI3_OFF: + case HIP_MSG_SET_HI3_OFF: hip_set_hi3_status(msg); break; #endif #ifdef CONFIG_HIP_OPPORTUNISTIC - case SO_HIP_SET_OPPORTUNISTIC_MODE: + case HIP_MSG_SET_OPPORTUNISTIC_MODE: err = hip_set_opportunistic_mode(msg); break; - case SO_HIP_GET_PEER_HIT: + case HIP_MSG_GET_PEER_HIT: err = hip_opp_get_peer_hit(msg, src); if (err) { _HIP_ERROR("get pseudo hit failed.\n"); @@ -227,7 +227,7 @@ /* skip sending of return message; will be sent later in R1 */ goto out_err; break; - case SO_HIP_QUERY_IP_HIT_MAPPING: + case HIP_MSG_QUERY_IP_HIT_MAPPING: { err = hip_query_ip_hit_mapping(msg); if (err) { @@ -236,7 +236,7 @@ } } break; - case SO_HIP_QUERY_OPPORTUNISTIC_MODE: + case HIP_MSG_QUERY_OPPORTUNISTIC_MODE: { err = hip_query_opportunistic_mode(msg); if (err) { @@ -249,33 +249,33 @@ break; #endif #ifdef CONFIG_HIP_BLIND - case SO_HIP_SET_BLIND_ON: + case HIP_MSG_SET_BLIND_ON: HIP_DEBUG("Blind on!!\n"); hip_encrypt_i2_hi = 1; HIP_IFEL(hip_set_blind_on(), -1, "hip_set_blind_on failed\n"); break; - case SO_HIP_SET_BLIND_OFF: + case HIP_MSG_SET_BLIND_OFF: hip_encrypt_i2_hi = 0; HIP_DEBUG("Blind off!!\n"); HIP_IFEL(hip_set_blind_off(), -1, "hip_set_blind_off failed\n"); break; #endif - case SO_HIP_SET_TCPTIMEOUT_ON: + case HIP_MSG_SET_TCPTIMEOUT_ON: HIP_DEBUG("Setting TCP TIMEOUT ON\n"); - hip_tcptimeout_status = SO_HIP_SET_TCPTIMEOUT_ON; + hip_tcptimeout_status = HIP_MSG_SET_TCPTIMEOUT_ON; HIP_DEBUG("hip tcp timeout status = %d (should be %d)\n", - hip_tcptimeout_status, SO_HIP_SET_TCPTIMEOUT_ON); + hip_tcptimeout_status, HIP_MSG_SET_TCPTIMEOUT_ON); /* paramters setting to do here */ HIP_IFEL(set_new_tcptimeout_parameters_value(), -1, "set new tcptimeout parameters error\n"); break; - case SO_HIP_SET_TCPTIMEOUT_OFF: + case HIP_MSG_SET_TCPTIMEOUT_OFF: HIP_DEBUG("Setting TCP TIMEOUT OFF\n"); - hip_tcptimeout_status = SO_HIP_SET_TCPTIMEOUT_OFF; + hip_tcptimeout_status = HIP_MSG_SET_TCPTIMEOUT_OFF; HIP_DEBUG("hip tcp timeout status = %d (should be %d)\n", - hip_tcptimeout_status, SO_HIP_SET_TCPTIMEOUT_OFF); + hip_tcptimeout_status, HIP_MSG_SET_TCPTIMEOUT_OFF); /* paramters resetting */ HIP_IFEL(reset_default_tcptimeout_parameters_value(), -1, @@ -284,7 +284,7 @@ break; #ifdef CONFIG_HIP_DHT - case SO_HIP_DHT_GW: + case HIP_MSG_DHT_GW: { char tmp_ip_str[20], tmp_ip_str6[39], tmp_host_name[256]; int tmp_ttl, tmp_port, is_hostname = 0, is_ipv4 = 0, is_ipv6 = 0; @@ -367,7 +367,7 @@ } } break; - case SO_HIP_DHT_SERVING_GW: + case HIP_MSG_DHT_SERVING_GW: { struct in_addr ip_gw; struct in6_addr ip_gw_mapped; @@ -385,11 +385,11 @@ rett = inet_pton(AF_INET, inet_ntoa(sa->sin_addr), &ip_gw); IPV4_TO_IPV6_MAP(&ip_gw, &ip_gw_mapped); hip_msg_init(msg); - errr = hip_build_user_hdr(msg, SO_HIP_DHT_SERVING_GW, 0); + errr = hip_build_user_hdr(msg, HIP_MSG_DHT_SERVING_GW, 0); if (errr) { HIP_ERROR("Build hdr failed: %s\n", strerror(errr)); } - if (hip_opendht_inuse == SO_HIP_DHT_ON) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON) { /* FIXME -> see Bug 952 in bugzilla * hip_build_param_opendht_gw_info expects the hostname * as last parameter. @@ -413,7 +413,7 @@ /* NOT the way to do this * int err_value = 0; - * if(hip_opendht_inuse != SO_HIP_DHT_ON){ + * if(hip_opendht_inuse != HIP_MSG_DHT_ON){ * err_value = 5; * hip_build_param_contents(msg, &err_value, * HIP_PARAM_INT, sizeof(int)); @@ -428,7 +428,7 @@ */ } break; - case SO_HIP_DHT_SET: + case HIP_MSG_DHT_SET: { struct hip_opendht_set *name_info; err = 0; @@ -440,7 +440,7 @@ } break; #endif /* CONFIG_HIP_DHT */ - case SO_HIP_CERT_SPKI_VERIFY: + case HIP_MSG_CERT_SPKI_VERIFY: { HIP_DEBUG("Got an request to verify SPKI cert\n"); reti = hip_cert_spki_verify(msg); @@ -448,7 +448,7 @@ HIP_DEBUG("SPKI cert verified sending it back to requester\n"); } break; - case SO_HIP_CERT_SPKI_SIGN: + case HIP_MSG_CERT_SPKI_SIGN: { HIP_DEBUG("Got an request to sign SPKI cert sequence\n"); reti = hip_cert_spki_sign(msg, hip_local_hostid_db); @@ -456,7 +456,7 @@ HIP_DEBUG("SPKI cert signed sending it back to requester\n"); } break; - case SO_HIP_CERT_X509V3_SIGN: + case HIP_MSG_CERT_X509V3_SIGN: { HIP_DEBUG("Got an request to sign X509v3 cert\n"); reti = hip_cert_x509v3_handle_request_to_sign(msg, @@ -465,7 +465,7 @@ HIP_DEBUG("X509v3 cert signed sending it back to requester\n"); } break; - case SO_HIP_CERT_X509V3_VERIFY: + case HIP_MSG_CERT_X509V3_VERIFY: { HIP_DEBUG("Got an request to verify X509v3 cert\n"); reti = hip_cert_x509v3_handle_request_to_verify(msg); @@ -475,7 +475,7 @@ "sending it back to requester\n"); } break; - case SO_HIP_TRANSFORM_ORDER: + case HIP_MSG_TRANSFORM_ORDER: { err = 0; struct hip_transformation_order *transorder; @@ -487,12 +487,12 @@ } break; #ifdef CONFIG_HIP_DHT - case SO_HIP_DHT_ON: + case HIP_MSG_DHT_ON: { HIP_DEBUG("Setting DHT ON\n"); - hip_opendht_inuse = SO_HIP_DHT_ON; + hip_opendht_inuse = HIP_MSG_DHT_ON; HIP_DEBUG("hip_opendht_inuse = %d (should be %d)\n", - hip_opendht_inuse, SO_HIP_DHT_ON); + hip_opendht_inuse, HIP_MSG_DHT_ON); } { int dhterr = 0; @@ -502,17 +502,17 @@ } } break; - case SO_HIP_DHT_OFF: + case HIP_MSG_DHT_OFF: { HIP_DEBUG("Setting DHT OFF\n"); - hip_opendht_inuse = SO_HIP_DHT_OFF; + hip_opendht_inuse = HIP_MSG_DHT_OFF; HIP_DEBUG("hip_opendht_inuse = %d (should be %d)\n", - hip_opendht_inuse, SO_HIP_DHT_OFF); + hip_opendht_inuse, HIP_MSG_DHT_OFF); } break; #endif /* CONFIG_HIP_DHT */ - case SO_HIP_SET_HIPPROXY_ON: + case HIP_MSG_SET_HIPPROXY_ON: { //firewall socket address struct sockaddr_in6 sock_addr; @@ -523,11 +523,11 @@ HIP_DEBUG("Setting HIP PROXY ON\n"); hip_set_hip_proxy_on(); - hip_build_user_hdr(msg, SO_HIP_SET_HIPPROXY_ON, 0); + hip_build_user_hdr(msg, HIP_MSG_SET_HIPPROXY_ON, 0); } break; - case SO_HIP_SET_HIPPROXY_OFF: + case HIP_MSG_SET_HIPPROXY_OFF: { //firewall socket address struct sockaddr_in6 sock_addr; @@ -538,11 +538,11 @@ HIP_DEBUG("Setting HIP PROXY OFF\n"); hip_set_hip_proxy_off(); - hip_build_user_hdr(msg, SO_HIP_SET_HIPPROXY_OFF, 0); + hip_build_user_hdr(msg, HIP_MSG_SET_HIPPROXY_OFF, 0); } break; - case SO_HIP_HIPPROXY_STATUS_REQUEST: + case HIP_MSG_HIPPROXY_STATUS_REQUEST: { //firewall socket address struct sockaddr_in6 sock_addr; @@ -556,16 +556,16 @@ memset(msg, 0, sizeof(struct hip_common)); if (hip_get_hip_proxy_status() == 0) { - hip_build_user_hdr(msg, SO_HIP_SET_HIPPROXY_OFF, 0); + hip_build_user_hdr(msg, HIP_MSG_SET_HIPPROXY_OFF, 0); } if (hip_get_hip_proxy_status() == 1) { - hip_build_user_hdr(msg, SO_HIP_SET_HIPPROXY_ON, 0); + hip_build_user_hdr(msg, HIP_MSG_SET_HIPPROXY_ON, 0); } } break; #ifdef CONFIG_HIP_RVS - case SO_HIP_ADD_DEL_SERVER: + case HIP_MSG_ADD_DEL_SERVER: { /* RFC 5203 service registration. The requester, i.e. the client * of the server handles this message. Message indicates that @@ -752,7 +752,7 @@ // Refresh locators stored in DHT #ifdef CONFIG_HIP_DHT - if (hip_opendht_inuse == SO_HIP_DHT_ON) { + if (hip_opendht_inuse == HIP_MSG_DHT_ON) { /* First remove the old one -samu */ hip_dht_remove_current_hdrr(); hip_register_to_dht(); @@ -765,7 +765,7 @@ if (entry->state != HIP_STATE_NONE || HIP_STATE_UNASSOCIATED) { hip_common_t *msg = calloc(HIP_MAX_PACKET, 1); HIP_IFE((msg == 0), -1); - HIP_IFE(hip_build_user_hdr(msg, SO_HIP_RST, 0), -1); + HIP_IFE(hip_build_user_hdr(msg, HIP_MSG_RST, 0), -1); HIP_IFE(hip_build_param_contents(msg, &entry->hit_peer, HIP_PARAM_HIT, @@ -788,7 +788,7 @@ "Error on sending I1 packet to the server.\n"); break; } - case SO_HIP_OFFER_RVS: + case HIP_MSG_OFFER_RVS: /* draft-ietf-hip-registration-02 RVS registration. Rendezvous * server handles this message. Message indicates that the * current machine is willing to offer rendezvous service. This @@ -800,7 +800,7 @@ err = hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_OFFER_FULLRELAY: + case HIP_MSG_OFFER_FULLRELAY: HIP_IFEL(hip_firewall_set_esp_relay(1), -1, "Failed to enable ESP relay in firewall\n"); @@ -810,7 +810,7 @@ HIP_DEBUG("Handling OFFER FULLRELAY user message\n"); err = hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_OFFER_HIPRELAY: + case HIP_MSG_OFFER_HIPRELAY: /* draft-ietf-hip-registration-02 HIPRELAY registration. Relay * server handles this message. Message indicates that the * current machine is willing to offer relay service. This @@ -822,14 +822,14 @@ err = hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_REINIT_RVS: - case SO_HIP_REINIT_RELAY: + case HIP_MSG_REINIT_RVS: + case HIP_MSG_REINIT_RELAY: HIP_DEBUG("Handling REINIT RELAY or REINIT RVS user message.\n"); HIP_IFEL(hip_relay_reinit(), -1, "Unable to reinitialize " \ "the HIP relay / RVS service.\n"); break; - case SO_HIP_CANCEL_RVS: + case HIP_MSG_CANCEL_RVS: HIP_DEBUG("Handling CANCEL RVS user message.\n"); hip_set_srv_status(HIP_SERVICE_RENDEZVOUS, HIP_SERVICE_OFF); @@ -847,13 +847,13 @@ err = hip_recreate_all_precreated_r1_packets(); break; - case SO_HIP_CANCEL_HIPRELAY: + case HIP_MSG_CANCEL_HIPRELAY: HIP_DEBUG("Handling CANCEL RELAY user message.\n"); hip_set_srv_status(HIP_SERVICE_RELAY, HIP_SERVICE_OFF); hip_relht_free_all_of_type(HIP_RELAY); - case SO_HIP_CANCEL_FULLRELAY: + case HIP_MSG_CANCEL_FULLRELAY: hip_set_srv_status(HIP_SERVICE_FULLRELAY, HIP_SERVICE_OFF); hip_relht_free_all_of_type(HIP_FULLRELAY); if (hip_firewall_is_alive()) { @@ -874,51 +874,51 @@ err = hip_recreate_all_precreated_r1_packets(); break; #endif /* CONFIG_HIP_RVS */ - case SO_HIP_GET_HITS: + case HIP_MSG_GET_HITS: hip_msg_init(msg); - hip_build_user_hdr(msg, SO_HIP_GET_HITS, 0); + hip_build_user_hdr(msg, HIP_MSG_GET_HITS, 0); err = hip_for_each_hi(hip_host_id_entry_to_hit_info, msg); break; - case SO_HIP_GET_HA_INFO: + case HIP_MSG_GET_HA_INFO: hip_msg_init(msg); - hip_build_user_hdr(msg, SO_HIP_GET_HA_INFO, 0); + hip_build_user_hdr(msg, HIP_MSG_GET_HA_INFO, 0); err = hip_for_each_ha(hip_handle_get_ha_info, msg); break; - case SO_HIP_DEFAULT_HIT: + case HIP_MSG_DEFAULT_HIT: //hip_msg_init(msg); err = hip_get_default_hit_msg(msg); break; - case SO_HIP_MHADDR_ACTIVE: + case HIP_MSG_MHADDR_ACTIVE: //hip_msg_init(msg); is_active_mhaddr = 1; - //hip_build_user_hdr(msg, SO_HIP_MHADDR_ACTIVE, 0); + //hip_build_user_hdr(msg, HIP_MSG_MHADDR_ACTIVE, 0); break; - case SO_HIP_MHADDR_LAZY: + case HIP_MSG_MHADDR_LAZY: //hip_msg_init(msg); is_active_mhaddr = 0; - //hip_build_user_hdr(msg,SO_HIP_MHADDR_LAZY, 0); + //hip_build_user_hdr(msg,HIP_MSG_MHADDR_LAZY, 0); break; - case SO_HIP_HANDOVER_HARD: + case HIP_MSG_HANDOVER_HARD: is_hard_handover = 1; break; - case SO_HIP_HANDOVER_SOFT: + case HIP_MSG_HANDOVER_SOFT: is_hard_handover = 0; break; - case SO_HIP_RESTART: + case HIP_MSG_RESTART: HIP_DEBUG("Restart message received, restarting HIP daemon now!!!\n"); hipd_set_flag(HIPD_FLAG_RESTART); hip_close(SIGINT); break; #ifdef CONFIG_HIP_OPPORTUNISTIC - case SO_HIP_OPPTCP_UNBLOCK_AND_BLACKLIST: + case HIP_MSG_OPPTCP_UNBLOCK_AND_BLACKLIST: hip_opptcp_unblock_and_blacklist(msg, src); break; - case SO_HIP_OPPTCP_SEND_TCP_PACKET: + case HIP_MSG_OPPTCP_SEND_TCP_PACKET: hip_opptcp_send_tcp_packet(msg, src); #endif break; - case SO_HIP_GET_PROXY_LOCAL_ADDRESS: + case HIP_MSG_GET_PROXY_LOCAL_ADDRESS: { //firewall socket address struct sockaddr_in6 sock_addr; @@ -931,10 +931,10 @@ break; } - case SO_HIP_SET_DATAPACKET_MODE_ON: + case HIP_MSG_SET_DATAPACKET_MODE_ON: { struct sockaddr_in6 sock_addr; - HIP_DEBUG("SO_HIP_SET_DATAPACKET_MODE_ON\n"); + HIP_DEBUG("HIP_MSG_SET_DATAPACKET_MODE_ON\n"); HIP_DUMP_MSG(msg); hip_use_userspace_data_packet_mode = 1; @@ -955,10 +955,10 @@ break; } - case SO_HIP_SET_DATAPACKET_MODE_OFF: + case HIP_MSG_SET_DATAPACKET_MODE_OFF: { struct sockaddr_in6 sock_addr_1; - HIP_DEBUG("SO_HIP_SET_DATAPACKET_MODE_OFF\n"); + HIP_DEBUG("HIP_MSG_SET_DATAPACKET_MODE_OFF\n"); HIP_DUMP_MSG(msg); hip_use_userspace_data_packet_mode = 0; @@ -979,7 +979,7 @@ break; } - case SO_HIP_BUILD_HOST_ID_SIGNATURE_DATAPACKET: + case HIP_MSG_BUILD_HOST_ID_SIGNATURE_DATAPACKET: { int original_type; hip_hit_t data_hit; @@ -987,7 +987,7 @@ HIP_IFEL(hip_get_any_localhost_hit(&data_hit, HIP_HI_DEFAULT_ALGO, 0), -1, "No HIT found\n"); - HIP_DEBUG("SO_HIP_BUILD_HOST_ID_SIGNATURE_DATAPACKET"); + HIP_DEBUG("HIP_MSG_BUILD_HOST_ID_SIGNATURE_DATAPACKET"); original_type = msg->type_hdr; @@ -1002,14 +1002,14 @@ } break; - case SO_HIP_TRIGGER_BEX: - HIP_DEBUG("SO_HIP_TRIGGER_BEX\n"); + case HIP_MSG_TRIGGER_BEX: + HIP_DEBUG("HIP_MSG_TRIGGER_BEX\n"); hip_firewall_status = 1; err = hip_netdev_trigger_bex_msg(msg); goto out_err; break; #ifdef CONFIG_HIP_DHT - case SO_HIP_VERIFY_DHT_HDRR_RESP: // Added by Pardeep to verify signature and host id + case HIP_MSG_VERIFY_DHT_HDRR_RESP: // Added by Pardeep to verify signature and host id /* This case verifies host id in the value (HDRR) against HIT used as a key for DHT * And it also verifies the signature in HDRR * This works on the hip common message sent to the daemon @@ -1017,32 +1017,32 @@ hip_verify_hdrr(msg, NULL); break; #endif - case SO_HIP_USERSPACE_IPSEC: + case HIP_MSG_USERSPACE_IPSEC: HIP_DUMP_MSG(msg); //send_response = 0; err = hip_userspace_ipsec_activate(msg); break; - case SO_HIP_RESTART_DUMMY_INTERFACE: + case HIP_MSG_RESTART_DUMMY_INTERFACE: set_up_device(HIP_HIT_DEV, 0); err = set_up_device(HIP_HIT_DEV, 1); break; - case SO_HIP_ESP_PROT_TFM: + case HIP_MSG_ESP_PROT_TFM: HIP_DUMP_MSG(msg); err = esp_prot_set_preferred_transforms(msg); break; - case SO_HIP_BEX_STORE_UPDATE: + case HIP_MSG_BEX_STORE_UPDATE: HIP_DUMP_MSG(msg); err = anchor_db_update(msg); break; - case SO_HIP_TRIGGER_UPDATE: + case HIP_MSG_TRIGGER_UPDATE: HIP_DUMP_MSG(msg); err = esp_prot_handle_trigger_update_msg(msg); break; - case SO_HIP_ANCHOR_CHANGE: + case HIP_MSG_ANCHOR_CHANGE: HIP_DUMP_MSG(msg); err = esp_prot_handle_anchor_change_msg(msg); break; - case SO_HIP_GET_LSI_PEER: + case HIP_MSG_GET_LSI_PEER: while ((param = hip_get_next_param(msg, param))) { if (hip_get_param_type(param) == HIP_PARAM_HIT) { if (!dst_hit) { @@ -1079,20 +1079,20 @@ HIP_PARAM_LSI, sizeof(hip_lsi_t)), -1); } break; - case SO_HIP_BUDDIES_ON: + case HIP_MSG_BUDDIES_ON: HIP_DEBUG("Setting BUDDIES ON\n"); - hip_buddies_inuse = SO_HIP_BUDDIES_ON; + hip_buddies_inuse = HIP_MSG_BUDDIES_ON; HIP_DEBUG("hip_buddies_inuse = %d (should be %d)\n", - hip_buddies_inuse, SO_HIP_BUDDIES_ON); + hip_buddies_inuse, HIP_MSG_BUDDIES_ON); break; - case SO_HIP_BUDDIES_OFF: + case HIP_MSG_BUDDIES_OFF: HIP_DEBUG("Setting BUDDIES OFF\n"); - hip_buddies_inuse = SO_HIP_BUDDIES_OFF; + hip_buddies_inuse = HIP_MSG_BUDDIES_OFF; HIP_DEBUG("hip_buddies_inuse = %d (should be %d)\n", - hip_buddies_inuse, SO_HIP_BUDDIES_OFF); + hip_buddies_inuse, HIP_MSG_BUDDIES_OFF); break; - case SO_HIP_SET_NAT_PORT: + case HIP_MSG_SET_NAT_PORT: { struct hip_port_info *nat_port; @@ -1113,20 +1113,20 @@ } break; } - case SO_HIP_NSUPDATE_OFF: - case SO_HIP_NSUPDATE_ON: - hip_set_nsupdate_status((msg_type == SO_HIP_NSUPDATE_OFF) ? 0 : 1); - if (msg_type == SO_HIP_NSUPDATE_ON) { + case HIP_MSG_NSUPDATE_OFF: + case HIP_MSG_NSUPDATE_ON: + hip_set_nsupdate_status((msg_type == HIP_MSG_NSUPDATE_OFF) ? 0 : 1); + if (msg_type == HIP_MSG_NSUPDATE_ON) { nsupdate(1); } break; - case SO_HIP_HIT_TO_IP_OFF: - case SO_HIP_HIT_TO_IP_ON: - hip_set_hit_to_ip_status((msg_type == SO_HIP_NSUPDATE_OFF) ? 0 : 1); + case HIP_MSG_HIT_TO_IP_OFF: + case HIP_MSG_HIT_TO_IP_ON: + hip_set_hit_to_ip_status((msg_type == HIP_MSG_NSUPDATE_OFF) ? 0 : 1); break; - case SO_HIP_HIT_TO_IP_SET: + case HIP_MSG_HIT_TO_IP_SET: { err = 0; struct hip_hit_to_ip_set *name_info; @@ -1148,20 +1148,20 @@ hip_hit_to_ip_set(name_info->name); } break; - case SO_HIP_SHOTGUN_ON: + case HIP_MSG_SHOTGUN_ON: HIP_DEBUG("Setting SHOTGUN ON\n"); - hip_shotgun_status = SO_HIP_SHOTGUN_ON; + hip_shotgun_status = HIP_MSG_SHOTGUN_ON; HIP_DEBUG("hip_shotgun_status = %d (should be %d)\n", - hip_shotgun_status, SO_HIP_SHOTGUN_ON); + hip_shotgun_status, HIP_MSG_SHOTGUN_ON); break; - case SO_HIP_SHOTGUN_OFF: + case HIP_MSG_SHOTGUN_OFF: HIP_DEBUG("Setting SHOTGUN OFF\n"); - hip_shotgun_status = SO_HIP_SHOTGUN_OFF; + hip_shotgun_status = HIP_MSG_SHOTGUN_OFF; HIP_DEBUG("hip_shotgun_status = %d (should be %d)\n", - hip_shotgun_status, SO_HIP_SHOTGUN_OFF); + hip_shotgun_status, HIP_MSG_SHOTGUN_OFF); break; - case SO_HIP_MAP_ID_TO_ADDR: + case HIP_MSG_MAP_ID_TO_ADDR: { struct in6_addr *id = NULL; hip_hit_t *hit = NULL; @@ -1182,17 +1182,17 @@ HIP_IFEL(hip_map_id_to_addr(hit, &lsi, &addr), -1, "Couldn't determine address\n"); hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_MAP_ID_TO_ADDR, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_MAP_ID_TO_ADDR, 0), -1, "Build header failed\n"); HIP_IFEL(hip_build_param_contents(msg, &addr, HIP_PARAM_IPV6_ADDR, sizeof(addr)), -1, "Build param failed\n"); break; } - case SO_HIP_FIREWALL_START: + case HIP_MSG_FIREWALL_START: hip_firewall_status = 1; break; - case SO_HIP_FIREWALL_QUIT: + case HIP_MSG_FIREWALL_QUIT: hip_firewall_status = 0; if (hip_relay_get_status() == HIP_RELAY_FULL) { hip_relay_set_status(HIP_RELAY_ON); @@ -1201,7 +1201,7 @@ err = hip_recreate_all_precreated_r1_packets(); } break; - case SO_HIP_LSI_TO_HIT: + case HIP_MSG_LSI_TO_HIT: { hip_lsi_t *lsi; struct hip_tlv_common *param; @@ -1214,14 +1214,14 @@ goto out_err; } hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_LSI_TO_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_LSI_TO_HIT, 0), -1, "Build header failed\n"); HIP_IFEL(hip_build_param_contents(msg, &ha->hit_peer, HIP_PARAM_IPV6_ADDR, sizeof(struct in6_addr)), -1, "Build param failed\n"); break; } - case SO_HIP_MANUAL_UPDATE_PACKET: + case HIP_MSG_MANUAL_UPDATE_PACKET: /// @todo : 13.11.2009: Should we use the msg? err = hip_send_locators_to_all_peers(); break; @@ -1259,7 +1259,7 @@ for (; NLMSG_OK(msg, (uint32_t) len); msg = NLMSG_NEXT(msg, len)) { switch (msg->nlmsg_type) { - case SO_HIP_ADD_PEER_MAP_HIT_IP: + case HIP_MSG_ADD_PEER_MAP_HIT_IP: HIP_DEBUG("add hit-ip map\n"); break; default: === modified file 'hipd/user_ipsec_hipd_msg.c' --- hipd/user_ipsec_hipd_msg.c 2010-03-10 17:44:36 +0000 +++ hipd/user_ipsec_hipd_msg.c 2010-03-18 12:09:47 +0000 @@ -130,7 +130,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_IPSEC_ADD_SA, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_IPSEC_ADD_SA, 0), -1, "build hdr failed\n"); HIP_DEBUG_IN6ADDR("Source IP address: ", saddr); @@ -248,7 +248,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_IPSEC_DELETE_SA, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_IPSEC_DELETE_SA, 0), -1, "build hdr failed\n"); HIP_DEBUG("spi value: %u\n", spi); @@ -301,7 +301,7 @@ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_IPSEC_FLUSH_ALL_SA, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_IPSEC_FLUSH_ALL_SA, 0), -1, "build hdr failed\n"); // this triggers the flushing without specifying any parameters === modified file 'lib/conf/hipconf.c' --- lib/conf/hipconf.c 2010-03-10 17:44:36 +0000 +++ lib/conf/hipconf.c 2010-03-18 12:09:47 +0000 @@ -191,7 +191,7 @@ if (strcmp(opt, "all") == 0) { /* Build a HIP message with socket option to get default HIT. */ - HIP_IFE(hip_build_user_hdr(msg, SO_HIP_GET_HITS, 0), -1); + HIP_IFE(hip_build_user_hdr(msg, HIP_MSG_GET_HITS, 0), -1); /* Send the message to the daemon. The daemon fills the * message. */ HIP_IFE(hip_send_recv_daemon_info(msg, send_only, 0), -ECOMM); @@ -235,7 +235,7 @@ } } else if (strcmp(opt, "default") == 0) { /* Build a HIP message with socket option to get default HIT. */ - HIP_IFE(hip_build_user_hdr(msg, SO_HIP_DEFAULT_HIT, 0), -1); + HIP_IFE(hip_build_user_hdr(msg, HIP_MSG_DEFAULT_HIT, 0), -1); /* Send the message to the daemon. The daemon fills the * message. */ HIP_IFE(hip_send_recv_daemon_info(msg, send_only, 0), -ECOMM); @@ -303,14 +303,14 @@ msg_tmp = hip_msg_alloc(); HIP_IFEL(!msg_tmp, -ENOMEM, "Malloc for msg_tmp failed\n"); - HIP_IFEL(hip_build_user_hdr(msg_tmp, SO_HIP_GET_HITS, 0), + HIP_IFEL(hip_build_user_hdr(msg_tmp, HIP_MSG_GET_HITS, 0), -1, "Failed to build user message header\n"); HIP_IFEL(hip_send_recv_daemon_info(msg_tmp, send_only, 0), -1, "Sending msg failed.\n"); while ((param = hip_get_next_param(msg_tmp, param)) != NULL) { data = (struct hip_hit_info *) hip_get_param_contents_direct(param); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_DEL_LOCAL_HI, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_DEL_LOCAL_HI, 0), -1, "Failed to build user message header\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) &data->lhi.hit, @@ -325,7 +325,7 @@ /** @todo deleting HITs from the interface isn't working, so we restart it */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_RESTART_DUMMY_INTERFACE, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_RESTART_DUMMY_INTERFACE, 0), -1, "Failed to build message header\n"); HIP_INFO("All HIs deleted.\n"); @@ -370,7 +370,7 @@ HIP_HEXDUMP("HIT to delete: ", &hit, sizeof(in6_addr_t)); - if ((err = hip_build_user_hdr(msg, SO_HIP_DEL_LOCAL_HI, 0))) { + if ((err = hip_build_user_hdr(msg, HIP_MSG_DEL_LOCAL_HI, 0))) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out_err; } @@ -396,7 +396,7 @@ _HIP_HEXDUMP("HEXHID ", ha, sizeof(struct hip_hadb_user_info_state)); HIP_INFO("HA is %s\n", hip_state_str(ha->state)); - if (ha->shotgun_status == SO_HIP_SHOTGUN_ON) { + if (ha->shotgun_status == HIP_MSG_SHOTGUN_ON) { HIP_INFO(" Shotgun mode is on.\n"); } else { HIP_INFO(" Shotgun mode is off.\n"); @@ -1047,7 +1047,7 @@ } } - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_ADD_DEL_SERVER, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_ADD_DEL_SERVER, 0), -1, "Failed to build hipconf user message header.\n"); if (!opp_mode) { @@ -1233,12 +1233,12 @@ switch (action) { case ACTION_ADD: - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_ADD_PEER_MAP_HIT_IP, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_ADD_PEER_MAP_HIT_IP, 0), -1, "add peer map failed\n"); break; case ACTION_DEL: - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_DEL_PEER_MAP_HIT_IP, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_DEL_PEER_MAP_HIT_IP, 0), -1, "del peer map failed\n"); break; default: @@ -1293,7 +1293,7 @@ goto out_err; } - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_HEARTBEAT, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_HEARTBEAT, 0), -1, "Failed to build user message header\n"); HIP_IFEL(hip_build_param_heartbeat(msg, seconds), @@ -1345,7 +1345,7 @@ } } - err = hip_build_user_hdr(msg, SO_HIP_TRANSFORM_ORDER, 0); + err = hip_build_user_hdr(msg, HIP_MSG_TRANSFORM_ORDER, 0); if (err) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out; @@ -1394,7 +1394,7 @@ } } - err = hip_build_user_hdr(msg, SO_HIP_RST, 0); + err = hip_build_user_hdr(msg, HIP_MSG_RST, 0); if (err) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out; @@ -1438,15 +1438,15 @@ if (!strcmp("all", opt[0])) { HIP_INFO("Displaying all debugging messages\n"); memset(&hit, 0, sizeof(in6_addr_t)); - status = SO_HIP_SET_DEBUG_ALL; + status = HIP_MSG_SET_DEBUG_ALL; } else if (!strcmp("medium", opt[0])) { HIP_INFO("Displaying ERROR and INFO debugging messages\n"); memset(&hit, 0, sizeof(in6_addr_t)); - status = SO_HIP_SET_DEBUG_MEDIUM; + status = HIP_MSG_SET_DEBUG_MEDIUM; } else if (!strcmp("none", opt[0])) { HIP_INFO("Displaying no debugging messages\n"); memset(&hit, 0, sizeof(in6_addr_t)); - status = SO_HIP_SET_DEBUG_NONE; + status = HIP_MSG_SET_DEBUG_NONE; } else { HIP_IFEL(1, -EINVAL, "Unknown argument\n"); } @@ -1483,7 +1483,7 @@ } /* Build the message header */ - err = hip_build_user_hdr(msg, SO_HIP_BOS, 0); + err = hip_build_user_hdr(msg, HIP_MSG_BOS, 0); if (err) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out; @@ -1522,7 +1522,7 @@ "Failed to find interface %s.\n", opt[0]); ifidx = ifr.ifr_ifindex; - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_MANUAL_UPDATE_PACKET, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_MANUAL_UPDATE_PACKET, 0), -1, "Failed to build user message header.: %s\n", strerror(err)); err = hip_build_param_contents(msg, (void *) &ifidx, HIP_PARAM_UINT, @@ -1554,7 +1554,7 @@ in_port_t port = (in_port_t) atoi(opt[1]); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_SET_NAT_PORT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_SET_NAT_PORT, 0), -1, "Failed to build user message header.: %s\n", strerror(err)); if (action == ACTION_NAT_LOCAL_PORT) { @@ -1594,13 +1594,13 @@ if (!strcmp("plain-udp", opt[0])) { memset(&hit, 0, sizeof(in6_addr_t)); - status = SO_HIP_SET_NAT_PLAIN_UDP; + status = HIP_MSG_SET_NAT_PLAIN_UDP; } else if (!strcmp("none", opt[0])) { memset(&hit, 0, sizeof(struct in6_addr)); - status = SO_HIP_SET_NAT_NONE; + status = HIP_MSG_SET_NAT_NONE; } else if (!strcmp("ice-udp", opt[0])) { memset(&hit, 0, sizeof(struct in6_addr)); - status = SO_HIP_SET_NAT_ICE_UDP; + status = HIP_MSG_SET_NAT_ICE_UDP; } HIP_IFEL(hip_build_user_hdr(msg, status, 0), -1, @@ -1618,7 +1618,7 @@ err = -EINVAL; goto out_err; } - status = SO_HIP_SET_NAT_ON; + status = HIP_MSG_SET_NAT_ON; } HIP_IFEL(hip_build_param_contents(msg, (void *) &hit, HIP_PARAM_HIT, @@ -1644,9 +1644,9 @@ int err = 0, status = 0; if (!strcmp("on", opt[0])) { - status = SO_HIP_SET_DATAPACKET_MODE_ON; + status = HIP_MSG_SET_DATAPACKET_MODE_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_SET_DATAPACKET_MODE_OFF; + status = HIP_MSG_SET_DATAPACKET_MODE_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -1679,17 +1679,17 @@ struct hip_locator *locator = NULL; if (!strcmp("on", opt[0])) { - status = SO_HIP_SET_LOCATOR_ON; + status = HIP_MSG_SET_LOCATOR_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_SET_LOCATOR_OFF; + status = HIP_MSG_SET_LOCATOR_OFF; } else if (!strcmp("get", opt[0])) { - status = SO_HIP_LOCATOR_GET; + status = HIP_MSG_LOCATOR_GET; } else { HIP_IFEL(1, -1, "bad args\n"); } HIP_IFEL(hip_build_user_hdr(msg, status, 0), -1, "Failed to build user message header.: %s\n", strerror(err)); - if (status == SO_HIP_LOCATOR_GET) { + if (status == HIP_MSG_LOCATOR_GET) { HIP_IFEL(hip_send_recv_daemon_info(msg, send_only, 0), -1, "Send recv daemon info failed\n"); locator = hip_get_param(msg, HIP_PARAM_LOCATOR); @@ -1743,19 +1743,19 @@ switch (action) { case ACTION_NEW: - msg_type = SO_HIP_CONF_PUZZLE_NEW; + msg_type = HIP_MSG_CONF_PUZZLE_NEW; break; case ACTION_INC: - msg_type = SO_HIP_CONF_PUZZLE_INC; + msg_type = HIP_MSG_CONF_PUZZLE_INC; break; case ACTION_DEC: - msg_type = SO_HIP_CONF_PUZZLE_DEC; + msg_type = HIP_MSG_CONF_PUZZLE_DEC; break; case ACTION_SET: - msg_type = SO_HIP_CONF_PUZZLE_SET; + msg_type = HIP_MSG_CONF_PUZZLE_SET; break; case ACTION_GET: - msg_type = SO_HIP_CONF_PUZZLE_GET; + msg_type = HIP_MSG_CONF_PUZZLE_GET; break; default: err = -1; @@ -1782,7 +1782,7 @@ } /* obtain the new value for set */ - if ((msg_type == SO_HIP_CONF_PUZZLE_SET) && (optc == 2)) { + if ((msg_type == HIP_MSG_CONF_PUZZLE_SET) && (optc == 2)) { newVal = atoi(opt[1]); } @@ -1798,7 +1798,7 @@ } /* obtain the result for the get action */ - if (msg_type == SO_HIP_CONF_PUZZLE_GET) { + if (msg_type == HIP_MSG_CONF_PUZZLE_GET) { /* Send the message to the daemon. The daemon fills the message. */ HIP_IFE(hip_send_recv_daemon_info(msg, send_only, 0), -ECOMM); @@ -1824,7 +1824,7 @@ } /* attach new val for the set action */ - if (msg_type == SO_HIP_CONF_PUZZLE_SET) { + if (msg_type == HIP_MSG_CONF_PUZZLE_SET) { err = hip_build_param_contents(msg, (void *) &newVal, HIP_PARAM_INT, sizeof(int)); if (err) { @@ -1838,8 +1838,8 @@ goto out_err; } - if ((msg_type == SO_HIP_CONF_PUZZLE_GET) - || (msg_type == SO_HIP_CONF_PUZZLE_SET)) { + if ((msg_type == HIP_MSG_CONF_PUZZLE_GET) + || (msg_type == HIP_MSG_CONF_PUZZLE_SET)) { goto out_err; } @@ -1851,7 +1851,7 @@ } out_err: - if (msg_type == SO_HIP_CONF_PUZZLE_GET) { + if (msg_type == HIP_MSG_CONF_PUZZLE_GET) { hip_msg_init(msg); } return err; @@ -1899,7 +1899,7 @@ } /* Build the message header */ - err = hip_build_user_hdr(msg, SO_HIP_SET_OPPORTUNISTIC_MODE, 0); + err = hip_build_user_hdr(msg, HIP_MSG_SET_OPPORTUNISTIC_MODE, 0); if (err) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out; @@ -1942,9 +1942,9 @@ } if (!strcmp("on", opt[0])) { - status = SO_HIP_SET_BLIND_ON; + status = HIP_MSG_SET_BLIND_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_SET_BLIND_OFF; + status = HIP_MSG_SET_BLIND_OFF; } else { HIP_PERROR("not a valid blind mode\n"); err = -EAFNOSUPPORT; @@ -1984,7 +1984,7 @@ HIP_DEBUG("Name received from user: %s (len = %d (max 256))\n", opt[0], len_name); HIP_IFEL((len_name > 255), -1, "Name too long, max 256\n"); - err = hip_build_user_hdr(msg, SO_HIP_DHT_SET, 0); + err = hip_build_user_hdr(msg, HIP_MSG_DHT_SET, 0); if (err) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out_err; @@ -2060,7 +2060,7 @@ HIP_DEBUG("Host name : %s\n", hostname); } - err = hip_build_user_hdr(msg, SO_HIP_DHT_GW, 0); + err = hip_build_user_hdr(msg, HIP_MSG_DHT_GW, 0); if (err) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out_err; @@ -2111,7 +2111,7 @@ /* ASK THIS INFO FROM DAEMON */ HIP_INFO("Asking serving gateway info from daemon...\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_DHT_SERVING_GW, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_DHT_SERVING_GW, 0), -1, "Building daemon header failed\n"); HIP_IFEL(hip_send_recv_daemon_info(msg, send_only, 0), -1, "Send recv daemon info failed\n"); @@ -2204,9 +2204,9 @@ int err = 0, status = 0; if (!strcmp("on", opt[0])) { - status = SO_HIP_DHT_ON; + status = HIP_MSG_DHT_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_DHT_OFF; + status = HIP_MSG_DHT_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -2237,9 +2237,9 @@ int err = 0, status = 0; if (!strcmp("on", opt[0])) { - status = SO_HIP_BUDDIES_ON; + status = HIP_MSG_BUDDIES_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_BUDDIES_OFF; + status = HIP_MSG_BUDDIES_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -2270,9 +2270,9 @@ int err = 0, status = 0; if (!strcmp("on", opt[0])) { - status = SO_HIP_SHOTGUN_ON; + status = HIP_MSG_SHOTGUN_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_SHOTGUN_OFF; + status = HIP_MSG_SHOTGUN_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -2312,7 +2312,7 @@ "Not an IPv6 address\n"); HIP_IFEL(!ipv6_addr_is_hit(&hit), -1, "Not a HIT\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_LSI_PEER, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_LSI_PEER, 0), -1, "Failed to build user message header.: %s\n", strerror(err)); HIP_IFE(hip_build_param_contents(msg, &hit, HIP_PARAM_HIT, sizeof(hit)), -1); @@ -2366,28 +2366,28 @@ if (action == ACTION_ADD) { if (strcmp(opt[0], "rvs") == 0) { HIP_INFO("Adding rendezvous service.\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_OFFER_RVS, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_OFFER_RVS, 0), -1, "Failed to build user message header.\n"); } else if (strcmp(opt[0], "relay") == 0) { HIP_INFO("Adding HIP UDP relay service.\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_OFFER_HIPRELAY, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_OFFER_HIPRELAY, 0), -1, "Failed to build user message header.\n"); } else if (strcmp(opt[0], "full-relay") == 0) { HIP_INFO("Adding HIP_FULLRELAY service.\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_OFFER_FULLRELAY, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_OFFER_FULLRELAY, 0), -1, "Failed to build user message header.\n"); } else { HIP_ERROR("Unknown service \"%s\".\n", opt[0]); } } else if (action == ACTION_REINIT) { if (strcmp(opt[0], "rvs") == 0) { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_REINIT_RVS, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_REINIT_RVS, 0), -1, "Failed to build user message header.\n"); } else if (strcmp(opt[0], "relay") == 0) { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_REINIT_RELAY, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_REINIT_RELAY, 0), -1, "Failed to build user message header.\n"); } else if (strcmp(opt[0], "full-relay") == 0) { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_REINIT_FULLRELAY, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_REINIT_FULLRELAY, 0), -1, "Failed to build user message header.\n"); } else { HIP_ERROR("Unknown service \"%s\".\n", opt[0]); @@ -2395,17 +2395,17 @@ } else if (action == ACTION_DEL) { if (strcmp(opt[0], "rvs") == 0) { HIP_INFO("Deleting rendezvous service.\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CANCEL_RVS, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CANCEL_RVS, 0), -1, "Failed to build user message header.\n"); } else if (strcmp(opt[0], "relay") == 0) { HIP_INFO("Deleting HIP UDP relay service.\n"); HIP_IFEL(hip_build_user_hdr( - msg, SO_HIP_CANCEL_HIPRELAY, 0), -1, + msg, HIP_MSG_CANCEL_HIPRELAY, 0), -1, "Failed to build user message header.\n"); } else if (strcmp(opt[0], "full-relay") == 0) { HIP_INFO("Deleting HIP full relay service.\n"); HIP_IFEL(hip_build_user_hdr( - msg, SO_HIP_CANCEL_FULLRELAY, 0), -1, + msg, HIP_MSG_CANCEL_FULLRELAY, 0), -1, "Failed to build user message header.\n"); } else { HIP_ERROR("Unknown service \"%s\".\n", opt[0]); @@ -2465,7 +2465,7 @@ HIP_IFEL(optc > 1, -1, "Too many arguments\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_HA_INFO, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_HA_INFO, 0), -1, "Building of daemon header failed\n"); HIP_IFEL(hip_send_recv_daemon_info(msg, send_only, 0), -1, @@ -2514,11 +2514,11 @@ int err = 0; if (strcmp("active", opt[0]) == 0) { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_MHADDR_ACTIVE, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_MHADDR_ACTIVE, 0), -1, "Building of daemon header failed\n"); HIP_INFO("mhaddr mode set to active successfully\n"); } else { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_MHADDR_LAZY, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_MHADDR_LAZY, 0), -1, "Building of daemon header failed\n"); HIP_INFO("mhaddr mode set to lazy successfully\n"); } @@ -2550,11 +2550,11 @@ int err = 0; if (strcmp("hard", opt[0]) == 0) { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_HANDOVER_HARD, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_HANDOVER_HARD, 0), -1, "Building of daemon header failed\n"); HIP_INFO("handover mode set to hard successfully\n"); } else { - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_HANDOVER_SOFT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_HANDOVER_SOFT, 0), -1, "Building of daemon header failed\n"); HIP_INFO("handover mode set to soft successfully\n"); } @@ -2712,7 +2712,7 @@ { int err = 0; - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_RESTART, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_RESTART, 0), -1, "hip_build_user_hdr() failed!"); out_err: @@ -2739,9 +2739,9 @@ int err = 0, status = 0; if (!strcmp("on", opt[0])) { - status = SO_HIP_SET_OPPTCP_ON; + status = HIP_MSG_SET_OPPTCP_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_SET_OPPTCP_OFF; + status = HIP_MSG_SET_OPPTCP_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -2776,10 +2776,10 @@ if (!strcmp("on", opt[0])) { HIP_INFO("tcptimeout set on\n"); - status = SO_HIP_SET_TCPTIMEOUT_ON; + status = HIP_MSG_SET_TCPTIMEOUT_ON; } else if (!strcmp("off", opt[0])) { HIP_INFO("tcptimeout set off\n"); - status = SO_HIP_SET_TCPTIMEOUT_OFF; + status = HIP_MSG_SET_TCPTIMEOUT_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); // err = -1; @@ -2816,9 +2816,9 @@ #ifdef CONFIG_HIP_HIPPROXY if (!strcmp("on", opt[0])) { - status = SO_HIP_SET_HIPPROXY_ON; + status = HIP_MSG_SET_HIPPROXY_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_SET_HIPPROXY_OFF; + status = HIP_MSG_SET_HIPPROXY_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -2851,9 +2851,9 @@ int err = 0, status = 0; if (!strcmp("on", opt[0])) { - status = SO_HIP_SET_HI3_ON; + status = HIP_MSG_SET_HI3_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_SET_HI3_OFF; + status = HIP_MSG_SET_HI3_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -2885,9 +2885,9 @@ int err = 0, status; if (!strcmp("on", opt[0])) { - status = SO_HIP_NSUPDATE_ON; + status = HIP_MSG_NSUPDATE_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_NSUPDATE_OFF; + status = HIP_MSG_NSUPDATE_OFF; } else { HIP_IFEL(1, -1, "bad args\n"); } @@ -2929,7 +2929,7 @@ IPV4_TO_IPV6_MAP(&lsi, &hit); } - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_MAP_ID_TO_ADDR, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_MAP_ID_TO_ADDR, 0), -1, "Failed to build message header\n"); HIP_IFEL(hip_build_param_contents(msg, &hit, HIP_PARAM_IPV6_ADDR, sizeof(hit)), -1, @@ -2982,9 +2982,9 @@ int err = 0, status; if (!strcmp("on", opt[0])) { - status = SO_HIP_HIT_TO_IP_ON; + status = HIP_MSG_HIT_TO_IP_ON; } else if (!strcmp("off", opt[0])) { - status = SO_HIP_HIT_TO_IP_OFF; + status = HIP_MSG_HIT_TO_IP_OFF; } else { return hip_conf_handle_map_id_to_addr(msg, action, opt, optc, send_only); } @@ -3019,7 +3019,7 @@ HIP_DEBUG("hit-to-ip zone received from user: %s (len = %d (max %d))\n", opt[0], len_name, HIT_TO_IP_ZONE_MAX_LEN); HIP_IFEL((len_name >= HIT_TO_IP_ZONE_MAX_LEN), -1, "Name too long (max %s)\n", HIT_TO_IP_ZONE_MAX_LEN); - err = hip_build_user_hdr(msg, SO_HIP_HIT_TO_IP_SET, 0); + err = hip_build_user_hdr(msg, HIP_MSG_HIT_TO_IP_SET, 0); if (err) { HIP_ERROR("Failed to build user message header.: %s\n", strerror(err)); goto out_err; @@ -3056,7 +3056,7 @@ struct hip_tlv_common *param = NULL; HIP_IFEL(inet_pton(AF_INET, opt[0], &lsi) != 1, -1, "inet_pton()\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_LSI_TO_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_LSI_TO_HIT, 0), -1, "Failed to build message header\n"); HIP_IFEL(hip_build_param_contents(msg, &lsi, HIP_PARAM_LSI, sizeof(lsi)), -1, "Failed to build message contents\n"); === modified file 'lib/core/builder.c' --- lib/core/builder.c 2010-03-11 09:39:20 +0000 +++ lib/core/builder.c 2010-03-18 12:09:47 +0000 @@ -27,7 +27,7 @@ * <ul> * <li>struct hip_common *msg = malloc(HIP_MAX_PACKET);</li> * <li>hip_msg_init(msg);</li> - * <li>err = hip_build_user_hdr(msg, SO_HIP_ADD_MAP_HIT_IP, 0);</li> + * <li>err = hip_build_user_hdr(msg, HIP_MSG_ADD_MAP_HIT_IP, 0);</li> * <li>err = hip_build_param_contents(msg, &hit, HIP_PARAM_HIT, * sizeof(struct in6_addr));</li> * <li>err = hip_build_param_contents(msg, &ip, HIP_PARAM_IPV6_ADDR, @@ -1168,8 +1168,8 @@ * Return a sting for a given parameter type number for diagnostics. * The returned string should be just the same as its type constant name. * - * @note If you added a SO_HIP_NEWMODE in lib/core/icomm.h, you also need to - * add a case block for your SO_HIP_NEWMODE constant in the + * @note If you added a HIP_MSG_NEWMODE in lib/core/icomm.h, you also need to + * add a case block for your HIP_MSG_NEWMODE constant in the * switch(msg_type) block in this function. * @param msg_type message type number * @return the name of the message type @@ -1190,96 +1190,96 @@ case HIP_PSIG: return "HIP_PSIG"; case HIP_TRIG: return "HIP_TRIG"; - case SO_HIP_ADD_LOCAL_HI: return "SO_HIP_ADD_LOCAL_HI"; - case SO_HIP_DEL_LOCAL_HI: return "SO_HIP_DEL_LOCAL_HI"; - case SO_HIP_RUN_UNIT_TEST: return "SO_HIP_RUN_UNIT_TEST"; - case SO_HIP_RST: return "SO_HIP_RST"; - case SO_HIP_UNIT_TEST: return "SO_HIP_UNIT_TEST"; - case SO_HIP_BOS: return "SO_HIP_BOS"; - case SO_HIP_NETLINK_DUMMY: return "SO_HIP_NETLINK_DUMMY"; - case SO_HIP_CONF_PUZZLE_NEW: return "SO_HIP_CONF_PUZZLE_NEW"; - case SO_HIP_CONF_PUZZLE_GET: return "SO_HIP_CONF_PUZZLE_GET"; - case SO_HIP_CONF_PUZZLE_SET: return "SO_HIP_CONF_PUZZLE_SET"; - case SO_HIP_CONF_PUZZLE_INC: return "SO_HIP_CONF_PUZZLE_INC"; - case SO_HIP_CONF_PUZZLE_DEC: return "SO_HIP_CONF_PUZZLE_DEC"; - case SO_HIP_SET_OPPORTUNISTIC_MODE: return "SO_HIP_SET_OPPORTUNISTIC_MODE"; - case SO_HIP_SET_BLIND_ON: return "SO_HIP_SET_BLIND_ON"; - case SO_HIP_SET_BLIND_OFF: return "SO_HIP_SET_BLIND_OFF"; - case SO_HIP_DHT_GW: return "SO_HIP_DHT_GW"; - case SO_HIP_SET_DEBUG_ALL: return "SO_HIP_SET_DEBUG_ALL"; - case SO_HIP_SET_DEBUG_MEDIUM: return "SO_HIP_SET_DEBUG_MEDIUM"; - case SO_HIP_SET_DEBUG_NONE: return "SO_HIP_SET_DEBUG_NONE"; - case SO_HIP_MHADDR_ACTIVE: return "SO_HIP_MHADDR_ACTIVE"; - case SO_HIP_MHADDR_LAZY: return "SO_HIP_MHADDR_LAZY"; - case SO_HIP_RESTART: return "SO_HIP_RESTART"; - case SO_HIP_SET_LOCATOR_ON: return "SO_HIP_SET_LOCATOR_ON"; - case SO_HIP_SET_LOCATOR_OFF: return "SO_HIP_SET_LOCATOR_OFF"; - case SO_HIP_DHT_SET: return "SO_HIP_DHT_SET"; - case SO_HIP_DHT_ON: return "SO_HIP_DHT_ON"; - case SO_HIP_DHT_OFF: return "SO_HIP_DHT_OFF"; - case SO_HIP_HIT_TO_IP_ON: return "SO_HIP_HIT_TO_IP_ON"; - case SO_HIP_HIT_TO_IP_OFF: return "SO_HIP_HIT_TO_IP_OFF"; - case SO_HIP_HIT_TO_IP_SET: return "SO_HIP_HIT_TO_IP_SET"; - case SO_HIP_SET_OPPTCP_ON: return "SO_HIP_SET_OPPTCP_ON"; - case SO_HIP_SET_OPPTCP_OFF: return "SO_HIP_SET_OPPTCP_OFF"; - case SO_HIP_OPPTCP_SEND_TCP_PACKET: return "SO_HIP_OPPTCP_SEND_TCP_PACKET"; - case SO_HIP_TRANSFORM_ORDER: return "SO_HIP_TRANSFORM_ORDER"; - case SO_HIP_OFFER_RVS: return "SO_HIP_OFFER_RVS"; - case SO_HIP_CANCEL_RVS: return "SO_HIP_CANCEL_RVS"; - case SO_HIP_REINIT_RVS: return "SO_HIP_REINIT_RVS"; - case SO_HIP_ADD_DEL_SERVER: return "SO_HIP_ADD_DEL_SERVER"; - case SO_HIP_OFFER_HIPRELAY: return "SO_HIP_OFFER_HIPRELAY"; - case SO_HIP_CANCEL_HIPRELAY: return "SO_HIP_CANCEL_HIPRELAY"; - case SO_HIP_REINIT_RELAY: return "SO_HIP_REINIT_RELAY"; - case SO_HIP_ADD_DB_HI: return "SO_HIP_ADD_DB_HI"; - case SO_HIP_FIREWALL_PING: return "SO_HIP_FIREWALL_PING"; - case SO_HIP_FIREWALL_PING_REPLY: return "SO_HIP_FIREWALL_PING_REPLY"; - case SO_HIP_FIREWALL_QUIT: return "SO_HIP_FIREWALL_QUIT"; - case SO_HIP_AGENT_PING: return "SO_HIP_AGENT_PING"; - case SO_HIP_AGENT_PING_REPLY: return "SO_HIP_AGENT_PING_REPLY"; - case SO_HIP_AGENT_QUIT: return "SO_HIP_AGENT_QUIT"; - case SO_HIP_DAEMON_QUIT: return "SO_HIP_DAEMON_QUIT"; - case SO_HIP_I1_REJECT: return "SO_HIP_I1_REJECT"; - case SO_HIP_SET_NAT_PLAIN_UDP: return "SO_HIP_SET_NAT_PLAIN_UDP"; - case SO_HIP_SET_NAT_NONE: return "SO_HIP_SET_NAT_NONE"; - case SO_HIP_SET_HIPPROXY_ON: return "SO_HIP_SET_HIPPROXY_ON"; - case SO_HIP_SET_HIPPROXY_OFF: return "SO_HIP_SET_HIPPROXY_OFF"; - case SO_HIP_GET_PROXY_LOCAL_ADDRESS: return "SO_HIP_GET_PROXY_LOCAL_ADDRESS"; - case SO_HIP_HIPPROXY_STATUS_REQUEST: return "SO_HIP_HIPPROXY_STATUS_REQUEST"; - case SO_HIP_OPPTCP_UNBLOCK_AND_BLACKLIST: return "SO_HIP_OPPTCP_UNBLOCK_AND_BLACKLIST"; - case SO_HIP_FW_BEX_DONE: return "SO_HIP_FW_BEX_DONE"; - case SO_HIP_SET_TCPTIMEOUT_ON: return "SO_HIP_SET_TCPTIMEOUT_ON"; - case SO_HIP_SET_TCPTIMEOUT_OFF: return "SO_HIP_SET_TCPTIMEOUT_OFF"; - case SO_HIP_SET_NAT_ICE_UDP: return "SO_HIP_SET_NAT_ICE_UDP"; - case SO_HIP_IPSEC_ADD_SA: return "SO_HIP_IPSEC_ADD_SA"; - case SO_HIP_USERSPACE_IPSEC: return "SO_HIP_USERSPACE_IPSEC"; - case SO_HIP_ESP_PROT_TFM: return "SO_HIP_ESP_PROT_TFM"; - case SO_HIP_BEX_STORE_UPDATE: return "SO_HIP_BEX_STORE_UPDATE"; - case SO_HIP_TRIGGER_UPDATE: return "SO_HIP_TRIGGER_UPDATE"; - case SO_HIP_ANCHOR_CHANGE: return "SO_HIP_ANCHOR_CHANGE"; - case SO_HIP_TRIGGER_BEX: return "SO_HIP_TRIGGER_BEX"; - //case SO_HIP_IS_OUR_LSI: return "SO_HIP_IS_OUR_LSI"; - case SO_HIP_GET_PEER_HIT: return "SO_HIP_GET_PEER_HIT"; - //case SO_HIP_GET_PEER_HIT_BY_LSIS: return "SO_HIP_GET_PEER_HIT_BY_LSIS"; - case SO_HIP_NSUPDATE_ON: return "SO_HIP_NSUPDATE_ON"; - case SO_HIP_NSUPDATE_OFF: return "SO_HIP_NSUPDATE_OFF"; - case SO_HIP_SET_HI3_ON: return "SO_HIP_SET_HI3_ON"; - case SO_HIP_SET_HI3_OFF: return "SO_HIP_SET_HI3_OFF"; - case SO_HIP_HEARTBEAT: return "SO_HIP_HEARTBEAT"; - case SO_HIP_DHT_SERVING_GW: return "SO_HIP_DHT_SERVING_GW"; - case SO_HIP_SET_NAT_PORT: return "SO_HIP_SET_NAT_PORT"; - case SO_HIP_SHOTGUN_ON: return "SO_HIP_SHOTGUN_ON"; - case SO_HIP_SHOTGUN_OFF: return "SO_HIP_SHOTGUN_OFF"; - case SO_HIP_SIGN_BUDDY_X509V3: return "SO_HIP_SIGN_BUDDY_X509V3"; - case SO_HIP_SIGN_BUDDY_SPKI: return "SO_HIP_SIGN_BUDDY_SPKI"; - case SO_HIP_VERIFY_BUDDY_X509V3: return "SO_HIP_VERIFY_BUDDY_X509V3"; - case SO_HIP_VERIFY_BUDDY_SPKI: return "SO_HIP_VERIFY_BUDDY_SPKI"; - case SO_HIP_MAP_ID_TO_ADDR: return "SO_HIP_MAP_ID_TO_ADDR"; - case SO_HIP_OFFER_FULLRELAY: return "SO_HIP_OFFER_FULLRELAY"; - case SO_HIP_CANCEL_FULLRELAY: return "SO_HIP_CANCEL_FULLRELAY"; - case SO_HIP_REINIT_FULLRELAY: return "SO_HIP_REINIT_FULLRELAY"; - case SO_HIP_FIREWALL_START: return "SO_HIP_FIREWALL_START"; - case SO_HIP_MANUAL_UPDATE_PACKET: return "SO_HIP_MANUAL_UPDATE_PACKET"; + case HIP_MSG_ADD_LOCAL_HI: return "HIP_MSG_ADD_LOCAL_HI"; + case HIP_MSG_DEL_LOCAL_HI: return "HIP_MSG_DEL_LOCAL_HI"; + case HIP_MSG_RUN_UNIT_TEST: return "HIP_MSG_RUN_UNIT_TEST"; + case HIP_MSG_RST: return "HIP_MSG_RST"; + case HIP_MSG_UNIT_TEST: return "HIP_MSG_UNIT_TEST"; + case HIP_MSG_BOS: return "HIP_MSG_BOS"; + case HIP_MSG_NETLINK_DUMMY: return "HIP_MSG_NETLINK_DUMMY"; + case HIP_MSG_CONF_PUZZLE_NEW: return "HIP_MSG_CONF_PUZZLE_NEW"; + case HIP_MSG_CONF_PUZZLE_GET: return "HIP_MSG_CONF_PUZZLE_GET"; + case HIP_MSG_CONF_PUZZLE_SET: return "HIP_MSG_CONF_PUZZLE_SET"; + case HIP_MSG_CONF_PUZZLE_INC: return "HIP_MSG_CONF_PUZZLE_INC"; + case HIP_MSG_CONF_PUZZLE_DEC: return "HIP_MSG_CONF_PUZZLE_DEC"; + case HIP_MSG_SET_OPPORTUNISTIC_MODE: return "HIP_MSG_SET_OPPORTUNISTIC_MODE"; + case HIP_MSG_SET_BLIND_ON: return "HIP_MSG_SET_BLIND_ON"; + case HIP_MSG_SET_BLIND_OFF: return "HIP_MSG_SET_BLIND_OFF"; + case HIP_MSG_DHT_GW: return "HIP_MSG_DHT_GW"; + case HIP_MSG_SET_DEBUG_ALL: return "HIP_MSG_SET_DEBUG_ALL"; + case HIP_MSG_SET_DEBUG_MEDIUM: return "HIP_MSG_SET_DEBUG_MEDIUM"; + case HIP_MSG_SET_DEBUG_NONE: return "HIP_MSG_SET_DEBUG_NONE"; + case HIP_MSG_MHADDR_ACTIVE: return "HIP_MSG_MHADDR_ACTIVE"; + case HIP_MSG_MHADDR_LAZY: return "HIP_MSG_MHADDR_LAZY"; + case HIP_MSG_RESTART: return "HIP_MSG_RESTART"; + case HIP_MSG_SET_LOCATOR_ON: return "HIP_MSG_SET_LOCATOR_ON"; + case HIP_MSG_SET_LOCATOR_OFF: return "HIP_MSG_SET_LOCATOR_OFF"; + case HIP_MSG_DHT_SET: return "HIP_MSG_DHT_SET"; + case HIP_MSG_DHT_ON: return "HIP_MSG_DHT_ON"; + case HIP_MSG_DHT_OFF: return "HIP_MSG_DHT_OFF"; + case HIP_MSG_HIT_TO_IP_ON: return "HIP_MSG_HIT_TO_IP_ON"; + case HIP_MSG_HIT_TO_IP_OFF: return "HIP_MSG_HIT_TO_IP_OFF"; + case HIP_MSG_HIT_TO_IP_SET: return "HIP_MSG_HIT_TO_IP_SET"; + case HIP_MSG_SET_OPPTCP_ON: return "HIP_MSG_SET_OPPTCP_ON"; + case HIP_MSG_SET_OPPTCP_OFF: return "HIP_MSG_SET_OPPTCP_OFF"; + case HIP_MSG_OPPTCP_SEND_TCP_PACKET: return "HIP_MSG_OPPTCP_SEND_TCP_PACKET"; + case HIP_MSG_TRANSFORM_ORDER: return "HIP_MSG_TRANSFORM_ORDER"; + case HIP_MSG_OFFER_RVS: return "HIP_MSG_OFFER_RVS"; + case HIP_MSG_CANCEL_RVS: return "HIP_MSG_CANCEL_RVS"; + case HIP_MSG_REINIT_RVS: return "HIP_MSG_REINIT_RVS"; + case HIP_MSG_ADD_DEL_SERVER: return "HIP_MSG_ADD_DEL_SERVER"; + case HIP_MSG_OFFER_HIPRELAY: return "HIP_MSG_OFFER_HIPRELAY"; + case HIP_MSG_CANCEL_HIPRELAY: return "HIP_MSG_CANCEL_HIPRELAY"; + case HIP_MSG_REINIT_RELAY: return "HIP_MSG_REINIT_RELAY"; + case HIP_MSG_ADD_DB_HI: return "HIP_MSG_ADD_DB_HI"; + case HIP_MSG_FIREWALL_PING: return "HIP_MSG_FIREWALL_PING"; + case HIP_MSG_FIREWALL_PING_REPLY: return "HIP_MSG_FIREWALL_PING_REPLY"; + case HIP_MSG_FIREWALL_QUIT: return "HIP_MSG_FIREWALL_QUIT"; + case HIP_MSG_AGENT_PING: return "HIP_MSG_AGENT_PING"; + case HIP_MSG_AGENT_PING_REPLY: return "HIP_MSG_AGENT_PING_REPLY"; + case HIP_MSG_AGENT_QUIT: return "HIP_MSG_AGENT_QUIT"; + case HIP_MSG_DAEMON_QUIT: return "HIP_MSG_DAEMON_QUIT"; + case HIP_MSG_I1_REJECT: return "HIP_MSG_I1_REJECT"; + case HIP_MSG_SET_NAT_PLAIN_UDP: return "HIP_MSG_SET_NAT_PLAIN_UDP"; + case HIP_MSG_SET_NAT_NONE: return "HIP_MSG_SET_NAT_NONE"; + case HIP_MSG_SET_HIPPROXY_ON: return "HIP_MSG_SET_HIPPROXY_ON"; + case HIP_MSG_SET_HIPPROXY_OFF: return "HIP_MSG_SET_HIPPROXY_OFF"; + case HIP_MSG_GET_PROXY_LOCAL_ADDRESS: return "HIP_MSG_GET_PROXY_LOCAL_ADDRESS"; + case HIP_MSG_HIPPROXY_STATUS_REQUEST: return "HIP_MSG_HIPPROXY_STATUS_REQUEST"; + case HIP_MSG_OPPTCP_UNBLOCK_AND_BLACKLIST: return "HIP_MSG_OPPTCP_UNBLOCK_AND_BLACKLIST"; + case HIP_MSG_FW_BEX_DONE: return "HIP_MSG_FW_BEX_DONE"; + case HIP_MSG_SET_TCPTIMEOUT_ON: return "HIP_MSG_SET_TCPTIMEOUT_ON"; + case HIP_MSG_SET_TCPTIMEOUT_OFF: return "HIP_MSG_SET_TCPTIMEOUT_OFF"; + case HIP_MSG_SET_NAT_ICE_UDP: return "HIP_MSG_SET_NAT_ICE_UDP"; + case HIP_MSG_IPSEC_ADD_SA: return "HIP_MSG_IPSEC_ADD_SA"; + case HIP_MSG_USERSPACE_IPSEC: return "HIP_MSG_USERSPACE_IPSEC"; + case HIP_MSG_ESP_PROT_TFM: return "HIP_MSG_ESP_PROT_TFM"; + case HIP_MSG_BEX_STORE_UPDATE: return "HIP_MSG_BEX_STORE_UPDATE"; + case HIP_MSG_TRIGGER_UPDATE: return "HIP_MSG_TRIGGER_UPDATE"; + case HIP_MSG_ANCHOR_CHANGE: return "HIP_MSG_ANCHOR_CHANGE"; + case HIP_MSG_TRIGGER_BEX: return "HIP_MSG_TRIGGER_BEX"; + //case HIP_MSG_IS_OUR_LSI: return "HIP_MSG_IS_OUR_LSI"; + case HIP_MSG_GET_PEER_HIT: return "HIP_MSG_GET_PEER_HIT"; + //case HIP_MSG_GET_PEER_HIT_BY_LSIS: return "HIP_MSG_GET_PEER_HIT_BY_LSIS"; + case HIP_MSG_NSUPDATE_ON: return "HIP_MSG_NSUPDATE_ON"; + case HIP_MSG_NSUPDATE_OFF: return "HIP_MSG_NSUPDATE_OFF"; + case HIP_MSG_SET_HI3_ON: return "HIP_MSG_SET_HI3_ON"; + case HIP_MSG_SET_HI3_OFF: return "HIP_MSG_SET_HI3_OFF"; + case HIP_MSG_HEARTBEAT: return "HIP_MSG_HEARTBEAT"; + case HIP_MSG_DHT_SERVING_GW: return "HIP_MSG_DHT_SERVING_GW"; + case HIP_MSG_SET_NAT_PORT: return "HIP_MSG_SET_NAT_PORT"; + case HIP_MSG_SHOTGUN_ON: return "HIP_MSG_SHOTGUN_ON"; + case HIP_MSG_SHOTGUN_OFF: return "HIP_MSG_SHOTGUN_OFF"; + case HIP_MSG_SIGN_BUDDY_X509V3: return "HIP_MSG_SIGN_BUDDY_X509V3"; + case HIP_MSG_SIGN_BUDDY_SPKI: return "HIP_MSG_SIGN_BUDDY_SPKI"; + case HIP_MSG_VERIFY_BUDDY_X509V3: return "HIP_MSG_VERIFY_BUDDY_X509V3"; + case HIP_MSG_VERIFY_BUDDY_SPKI: return "HIP_MSG_VERIFY_BUDDY_SPKI"; + case HIP_MSG_MAP_ID_TO_ADDR: return "HIP_MSG_MAP_ID_TO_ADDR"; + case HIP_MSG_OFFER_FULLRELAY: return "HIP_MSG_OFFER_FULLRELAY"; + case HIP_MSG_CANCEL_FULLRELAY: return "HIP_MSG_CANCEL_FULLRELAY"; + case HIP_MSG_REINIT_FULLRELAY: return "HIP_MSG_REINIT_FULLRELAY"; + case HIP_MSG_FIREWALL_START: return "HIP_MSG_FIREWALL_START"; + case HIP_MSG_MANUAL_UPDATE_PACKET: return "HIP_MSG_MANUAL_UPDATE_PACKET"; default: return "UNDEFINED"; } === modified file 'lib/core/certtools.c' --- lib/core/certtools.c 2010-03-10 17:44:36 +0000 +++ lib/core/certtools.c 2010-03-18 12:09:47 +0000 @@ -483,7 +483,7 @@ /* build the msg to be sent to the daemon */ hip_msg_init(msg); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_SPKI_SIGN, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_SPKI_SIGN, 0), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_spki_info(msg, content), -1, "Failed to build cert_info\n"); @@ -675,7 +675,7 @@ "Malloc for msg failed\n"); hip_msg_init(msg); /* build the msg to be sent to the daemon */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_SPKI_VERIFY, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_SPKI_VERIFY, 0), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_spki_info(msg, to_verification), -1, "Failed to build cert_info\n"); @@ -726,7 +726,7 @@ hip_msg_init(msg); /* build the msg to be sent to the daemon */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_X509V3_SIGN, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_X509V3_SIGN, 0), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_x509_req(msg, subject), -1, "Failed to build cert_info\n"); @@ -775,7 +775,7 @@ _HIP_DEBUG("DER LEN %d\n", len); /* build the msg to be sent to the daemon */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_CERT_X509V3_VERIFY, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_CERT_X509V3_VERIFY, 0), -1, "Failed to build user header\n"); HIP_IFEL(hip_build_param_cert_x509_ver(msg, (char *) certificate, len), -1, "Failed to build cert_info\n"); === modified file 'lib/core/hostid.c' --- lib/core/hostid.c 2010-03-10 17:44:36 +0000 +++ lib/core/hostid.c 2010-03-18 12:09:47 +0000 @@ -550,7 +550,7 @@ struct endpoint_hip *endpoint_rsa_pub_hip = NULL; if (action == ACTION_ADD) { - numeric_action = SO_HIP_ADD_LOCAL_HI; + numeric_action = HIP_MSG_ADD_LOCAL_HI; } if ((err = hip_build_user_hdr(msg, numeric_action, 0))) { === modified file 'lib/core/icomm.h' --- lib/core/icomm.h 2010-03-07 11:20:52 +0000 +++ lib/core/icomm.h 2010-03-18 12:09:47 +0000 @@ -20,193 +20,193 @@ #define HIP_FIREWALL_SYNC_PORT 974 -#define SO_HIP_GLOBAL_OPT 1 -#define SO_HIP_SOCKET_OPT 2 -#define SO_HIP_GET_HIT_LIST 3 +#define HIP_MSG_GLOBAL_OPT 1 +#define HIP_MSG_SOCKET_OPT 2 +#define HIP_MSG_GET_HIT_LIST 3 /** @addtogroup hip_so - * HIP socket options. Define a constant SO_HIP_NEWMODE which has value - * between 0 and HIP_SO_ROOT_MAX. You may also need to increase the value of - * HIP_SO_ROOT_MAX. + * HIP socket options. Define a constant HIP_MSG_NEWMODE which has value + * between 0 and HIP_MSG_ROOT_MAX. You may also need to increase the value of + * HIP_MSG_ROOT_MAX. * * @note Values 1 - 64 overlap the message values and thus cannot be used in * hip_message_type_name(). * @todo Should socket option values 1 - 64 be renumbered starting from 65? * @{ */ -#define HIP_SO_ANY_MIN 1 -#define SO_HIP_ADD_PEER_MAP_HIT_IP 2 -#define SO_HIP_DEL_PEER_MAP_HIT_IP 3 -/* slot free */ -#define SO_HIP_SET_MY_EID 5 -/* slot free */ -#define SO_HIP_SET_PEER_EID 7 -#define SO_HIP_NULL_OP 8 -#define SO_HIP_QUERY_OPPORTUNISTIC_MODE 9 -#define SO_HIP_ANSWER_OPPORTUNISTIC_MODE_QUERY 10 -/* slot free */ -#define SO_HIP_QUERY_IP_HIT_MAPPING 12 -#define SO_HIP_ANSWER_IP_HIT_MAPPING_QUERY 13 -#define SO_HIP_GET_PEER_HIT 14 +#define HIP_MSG_ANY_MIN 1 +#define HIP_MSG_ADD_PEER_MAP_HIT_IP 2 +#define HIP_MSG_DEL_PEER_MAP_HIT_IP 3 +/* slot free */ +#define HIP_MSG_SET_MY_EID 5 +/* slot free */ +#define HIP_MSG_SET_PEER_EID 7 +#define HIP_MSG_NULL_OP 8 +#define HIP_MSG_QUERY_OPPORTUNISTIC_MODE 9 +#define HIP_MSG_ANSWER_OPPORTUNISTIC_MODE_QUERY 10 +/* slot free */ +#define HIP_MSG_QUERY_IP_HIT_MAPPING 12 +#define HIP_MSG_ANSWER_IP_HIT_MAPPING_QUERY 13 +#define HIP_MSG_GET_PEER_HIT 14 /* free slot */ -#define SO_HIP_DEFAULT_HIT 16 -#define SO_HIP_GET_PEER_LIST 17 +#define HIP_MSG_DEFAULT_HIT 16 +#define HIP_MSG_GET_PEER_LIST 17 /* Free slots here */ -#define SO_HIP_GET_HITS 21 -#define SO_HIP_GET_HA_INFO 22 -#define SO_HIP_DHT_SERVING_GW 24 +#define HIP_MSG_GET_HITS 21 +#define HIP_MSG_GET_HA_INFO 22 +#define HIP_MSG_DHT_SERVING_GW 24 /* free slot */ -#define SO_HIP_GET_LSI_PEER 26 +#define HIP_MSG_GET_LSI_PEER 26 /* several free slots here */ -#define SO_HIP_HEARTBEAT 31 +#define HIP_MSG_HEARTBEAT 31 /* inclusive */ -#define SO_HIP_PING 32 -#define SO_HIP_TRIGGER_BEX 33 -#define SO_HIP_MAP_ID_TO_ADDR 34 -#define SO_HIP_LSI_TO_HIT 35 -#define HIP_SO_ANY_MAX 63 +#define HIP_MSG_PING 32 +#define HIP_MSG_TRIGGER_BEX 33 +#define HIP_MSG_MAP_ID_TO_ADDR 34 +#define HIP_MSG_LSI_TO_HIT 35 +#define HIP_MSG_ANY_MAX 63 /** @addtogroup hip_so * HIP socket options. * @{ */ -#define HIP_SO_ROOT_MIN 64 -#define SO_HIP_ADD_LOCAL_HI 65 -#define SO_HIP_DEL_LOCAL_HI 66 -#define SO_HIP_RUN_UNIT_TEST 67 -#define SO_HIP_RST 68 -#define SO_HIP_UNIT_TEST 69 -#define SO_HIP_BOS 70 -#define SO_HIP_NETLINK_DUMMY 71 -#define SO_HIP_CONF_PUZZLE_NEW 72 -#define SO_HIP_CONF_PUZZLE_GET 73 -#define SO_HIP_CONF_PUZZLE_SET 74 -#define SO_HIP_CONF_PUZZLE_INC 75 -#define SO_HIP_CONF_PUZZLE_DEC 76 -#define SO_HIP_STUN 77 -#define SO_HIP_SET_OPPORTUNISTIC_MODE 78 -#define SO_HIP_SET_BLIND_ON 79 -#define SO_HIP_SET_BLIND_OFF 80 +#define HIP_MSG_ROOT_MIN 64 +#define HIP_MSG_ADD_LOCAL_HI 65 +#define HIP_MSG_DEL_LOCAL_HI 66 +#define HIP_MSG_RUN_UNIT_TEST 67 +#define HIP_MSG_RST 68 +#define HIP_MSG_UNIT_TEST 69 +#define HIP_MSG_BOS 70 +#define HIP_MSG_NETLINK_DUMMY 71 +#define HIP_MSG_CONF_PUZZLE_NEW 72 +#define HIP_MSG_CONF_PUZZLE_GET 73 +#define HIP_MSG_CONF_PUZZLE_SET 74 +#define HIP_MSG_CONF_PUZZLE_INC 75 +#define HIP_MSG_CONF_PUZZLE_DEC 76 +#define HIP_MSG_STUN 77 +#define HIP_MSG_SET_OPPORTUNISTIC_MODE 78 +#define HIP_MSG_SET_BLIND_ON 79 +#define HIP_MSG_SET_BLIND_OFF 80 /** Socket option for hipconf to change the used gateway with OpenDHT */ -#define SO_HIP_DHT_GW 81 -#define SO_HIP_SET_DEBUG_ALL 82 -#define SO_HIP_SET_DEBUG_MEDIUM 83 -#define SO_HIP_SET_DEBUG_NONE 84 +#define HIP_MSG_DHT_GW 81 +#define HIP_MSG_SET_DEBUG_ALL 82 +#define HIP_MSG_SET_DEBUG_MEDIUM 83 +#define HIP_MSG_SET_DEBUG_NONE 84 /** Socket option for hipconf to ask about the used gateway with OpenDHT */ -#define SO_HIP_LOCATOR_GET 85 -#define SO_HIP_MHADDR_ACTIVE 86 -#define SO_HIP_MHADDR_LAZY 87 +#define HIP_MSG_LOCATOR_GET 85 +#define HIP_MSG_MHADDR_ACTIVE 86 +#define HIP_MSG_MHADDR_LAZY 87 /** Socket option for hipconf to restart daemon. */ -#define SO_HIP_RESTART 88 -#define SO_HIP_SET_LOCATOR_ON 89 -#define SO_HIP_SET_LOCATOR_OFF 90 -#define SO_HIP_DHT_SET 91 -#define SO_HIP_DHT_ON 92 -#define SO_HIP_DHT_OFF 93 -#define SO_HIP_SET_OPPTCP_ON 94 -#define SO_HIP_SET_OPPTCP_OFF 95 -#define SO_HIP_SET_HI3_ON 96 -#define SO_HIP_SET_HI3_OFF 97 -#define SO_HIP_RESET_FIREWALL_DB 98 +#define HIP_MSG_RESTART 88 +#define HIP_MSG_SET_LOCATOR_ON 89 +#define HIP_MSG_SET_LOCATOR_OFF 90 +#define HIP_MSG_DHT_SET 91 +#define HIP_MSG_DHT_ON 92 +#define HIP_MSG_DHT_OFF 93 +#define HIP_MSG_SET_OPPTCP_ON 94 +#define HIP_MSG_SET_OPPTCP_OFF 95 +#define HIP_MSG_SET_HI3_ON 96 +#define HIP_MSG_SET_HI3_OFF 97 +#define HIP_MSG_RESET_FIREWALL_DB 98 -#define SO_HIP_OPPTCP_SEND_TCP_PACKET 99 -#define SO_HIP_TRANSFORM_ORDER 100 +#define HIP_MSG_OPPTCP_SEND_TCP_PACKET 99 +#define HIP_MSG_TRANSFORM_ORDER 100 /** Socket option for the server to offer the RVS service. (server side) */ -#define SO_HIP_OFFER_RVS 101 +#define HIP_MSG_OFFER_RVS 101 /** Socket option for the server to cancel the RVS service. (server side) */ -#define SO_HIP_CANCEL_RVS 102 +#define HIP_MSG_CANCEL_RVS 102 /** Socket option for the server to reinit the RVS service. (server side) */ -#define SO_HIP_REINIT_RVS 103 +#define HIP_MSG_REINIT_RVS 103 /** * Socket option to ask for additional services or service cancellation from a * server, i.e.\ to send a REG_REQUEST parameter to the server. (client side) */ -#define SO_HIP_ADD_DEL_SERVER 104 +#define HIP_MSG_ADD_DEL_SERVER 104 /** Socket option for the server to offer the HIP relay service. (server * side) */ -#define SO_HIP_OFFER_HIPRELAY 106 +#define HIP_MSG_OFFER_HIPRELAY 106 /** Socket option for the server to cancel the HIP relay service. (server * side) */ -#define SO_HIP_CANCEL_HIPRELAY 107 +#define HIP_MSG_CANCEL_HIPRELAY 107 /** Socket option for hipconf to reinit the HIP relay service. (server side) */ -#define SO_HIP_REINIT_RELAY 108 -#define SO_HIP_ADD_DB_HI 115 -#define SO_HIP_FIREWALL_PING 120 -#define SO_HIP_FIREWALL_PING_REPLY 121 -#define SO_HIP_FIREWALL_QUIT 122 -#define SO_HIP_AGENT_PING 123 -#define SO_HIP_AGENT_PING_REPLY 124 -#define SO_HIP_AGENT_QUIT 125 -#define SO_HIP_DAEMON_QUIT 126 -#define SO_HIP_I1_REJECT 127 +#define HIP_MSG_REINIT_RELAY 108 +#define HIP_MSG_ADD_DB_HI 115 +#define HIP_MSG_FIREWALL_PING 120 +#define HIP_MSG_FIREWALL_PING_REPLY 121 +#define HIP_MSG_FIREWALL_QUIT 122 +#define HIP_MSG_AGENT_PING 123 +#define HIP_MSG_AGENT_PING_REPLY 124 +#define HIP_MSG_AGENT_QUIT 125 +#define HIP_MSG_DAEMON_QUIT 126 +#define HIP_MSG_I1_REJECT 127 // free slot -#define SO_HIP_SET_NAT_PLAIN_UDP 129 -#define SO_HIP_SET_NAT_NONE 130 -#define SO_HIP_SET_HIPPROXY_ON 131 -#define SO_HIP_SET_HIPPROXY_OFF 132 -#define SO_HIP_GET_PROXY_LOCAL_ADDRESS 133 -#define SO_HIP_HIPPROXY_STATUS_REQUEST 134 -#define SO_HIP_OPPTCP_UNBLOCK_AND_BLACKLIST 135 -#define SO_HIP_IPSEC_ADD_SA 136 -#define SO_HIP_SET_TCPTIMEOUT_ON 137 -#define SO_HIP_SET_TCPTIMEOUT_OFF 138 -#define SO_HIP_SET_NAT_ICE_UDP 139 +#define HIP_MSG_SET_NAT_PLAIN_UDP 129 +#define HIP_MSG_SET_NAT_NONE 130 +#define HIP_MSG_SET_HIPPROXY_ON 131 +#define HIP_MSG_SET_HIPPROXY_OFF 132 +#define HIP_MSG_GET_PROXY_LOCAL_ADDRESS 133 +#define HIP_MSG_HIPPROXY_STATUS_REQUEST 134 +#define HIP_MSG_OPPTCP_UNBLOCK_AND_BLACKLIST 135 +#define HIP_MSG_IPSEC_ADD_SA 136 +#define HIP_MSG_SET_TCPTIMEOUT_ON 137 +#define HIP_MSG_SET_TCPTIMEOUT_OFF 138 +#define HIP_MSG_SET_NAT_ICE_UDP 139 #define HIP_PARAM_INT 140 -#define SO_HIP_CERT_SPKI_SIGN 141 -#define SO_HIP_CERT_SPKI_VERIFY 142 -#define SO_HIP_CERT_X509V3_SIGN 143 -#define SO_HIP_CERT_X509V3_VERIFY 144 -#define SO_HIP_USERSPACE_IPSEC 145 -#define SO_HIP_ESP_PROT_TFM 146 -#define SO_HIP_BEX_STORE_UPDATE 147 +#define HIP_MSG_CERT_SPKI_SIGN 141 +#define HIP_MSG_CERT_SPKI_VERIFY 142 +#define HIP_MSG_CERT_X509V3_SIGN 143 +#define HIP_MSG_CERT_X509V3_VERIFY 144 +#define HIP_MSG_USERSPACE_IPSEC 145 +#define HIP_MSG_ESP_PROT_TFM 146 +#define HIP_MSG_BEX_STORE_UPDATE 147 // free slot -#define SO_HIP_TRIGGER_UPDATE 149 -#define SO_HIP_FW_UPDATE_DB 152 -#define SO_HIP_IPSEC_DELETE_SA 153 -#define SO_HIP_IPSEC_FLUSH_ALL_SA 154 -#define SO_HIP_ANCHOR_CHANGE 155 +#define HIP_MSG_TRIGGER_UPDATE 149 +#define HIP_MSG_FW_UPDATE_DB 152 +#define HIP_MSG_IPSEC_DELETE_SA 153 +#define HIP_MSG_IPSEC_FLUSH_ALL_SA 154 +#define HIP_MSG_ANCHOR_CHANGE 155 /* free slot */ -#define SO_HIP_FW_BEX_DONE 157 -#define SO_HIP_RESTART_DUMMY_INTERFACE 158 -#define SO_HIP_VERIFY_DHT_HDRR_RESP 159 -/* free slots */ -#define SO_HIP_BUDDIES_ON 162 -#define SO_HIP_BUDDIES_OFF 163 -#define SO_HIP_TURN_INFO 164 -/* free slots */ -#define SO_HIP_NSUPDATE_OFF 179 -#define SO_HIP_NSUPDATE_ON 180 -#define SO_HIP_HIT_TO_IP_OFF 181 -#define SO_HIP_HIT_TO_IP_ON 182 -#define SO_HIP_HIT_TO_IP_SET 183 -#define SO_HIP_SET_NAT_PORT 184 -#define SO_HIP_SHOTGUN_ON 185 -#define SO_HIP_SHOTGUN_OFF 186 -#define SO_HIP_SIGN_BUDDY_X509V3 187 -#define SO_HIP_SIGN_BUDDY_SPKI 188 -#define SO_HIP_VERIFY_BUDDY_X509V3 189 -#define SO_HIP_VERIFY_BUDDY_SPKI 190 -#define SO_HIP_OFFER_FULLRELAY 191 -#define SO_HIP_CANCEL_FULLRELAY 192 -#define SO_HIP_REINIT_FULLRELAY 193 -#define SO_HIP_FIREWALL_START 194 -#define SO_HIP_SET_DATAPACKET_MODE_ON 195 -#define SO_HIP_SET_DATAPACKET_MODE_OFF 196 -#define SO_HIP_BUILD_HOST_ID_SIGNATURE_DATAPACKET 197 -#define SO_HIP_MANUAL_UPDATE_PACKET 198 +#define HIP_MSG_FW_BEX_DONE 157 +#define HIP_MSG_RESTART_DUMMY_INTERFACE 158 +#define HIP_MSG_VERIFY_DHT_HDRR_RESP 159 +/* free slots */ +#define HIP_MSG_BUDDIES_ON 162 +#define HIP_MSG_BUDDIES_OFF 163 +#define HIP_MSG_TURN_INFO 164 +/* free slots */ +#define HIP_MSG_NSUPDATE_OFF 179 +#define HIP_MSG_NSUPDATE_ON 180 +#define HIP_MSG_HIT_TO_IP_OFF 181 +#define HIP_MSG_HIT_TO_IP_ON 182 +#define HIP_MSG_HIT_TO_IP_SET 183 +#define HIP_MSG_SET_NAT_PORT 184 +#define HIP_MSG_SHOTGUN_ON 185 +#define HIP_MSG_SHOTGUN_OFF 186 +#define HIP_MSG_SIGN_BUDDY_X509V3 187 +#define HIP_MSG_SIGN_BUDDY_SPKI 188 +#define HIP_MSG_VERIFY_BUDDY_X509V3 189 +#define HIP_MSG_VERIFY_BUDDY_SPKI 190 +#define HIP_MSG_OFFER_FULLRELAY 191 +#define HIP_MSG_CANCEL_FULLRELAY 192 +#define HIP_MSG_REINIT_FULLRELAY 193 +#define HIP_MSG_FIREWALL_START 194 +#define HIP_MSG_SET_DATAPACKET_MODE_ON 195 +#define HIP_MSG_SET_DATAPACKET_MODE_OFF 196 +#define HIP_MSG_BUILD_HOST_ID_SIGNATURE_DATAPACKET 197 +#define HIP_MSG_MANUAL_UPDATE_PACKET 198 /** Socket option for hipconf to set handover mode, hard or soft. */ -#define SO_HIP_HANDOVER_HARD 199 -#define SO_HIP_HANDOVER_SOFT 200 -#define SO_HIP_FIREWALL_STATUS 201 -#define SO_HIP_FW_FLUSH_SYS_OPP_HIP 202 +#define HIP_MSG_HANDOVER_HARD 199 +#define HIP_MSG_HANDOVER_SOFT 200 +#define HIP_MSG_FIREWALL_STATUS 201 +#define HIP_MSG_FW_FLUSH_SYS_OPP_HIP 202 /** @} */ /* inclusive */ -#define HIP_SO_ROOT_MAX 255 +#define HIP_MSG_ROOT_MAX 255 -#define SO_HIP_SET_NAT_ON SO_HIP_SET_NAT_PLAIN_UDP +#define HIP_MSG_SET_NAT_ON HIP_MSG_SET_NAT_PLAIN_UDP #define FLUSH_HA_INFO_DB 1 === modified file 'lib/core/state.h' --- lib/core/state.h 2010-03-09 18:26:22 +0000 +++ lib/core/state.h 2010-03-18 12:09:47 +0000 @@ -509,8 +509,8 @@ int inbound_sa_count; /** Variable shoting shotgun status for this host association: - * SO_HIP_SHOTGUN_ON if shotgun is on, - * SO_HIP_SHOTGUN_OFF if it is off. + * HIP_MSG_SHOTGUN_ON if shotgun is on, + * HIP_MSG_SHOTGUN_OFF if it is off. */ int shotgun_status; === modified file 'lib/dht/libhipdht.c' --- lib/dht/libhipdht.c 2010-03-10 17:44:36 +0000 +++ lib/dht/libhipdht.c 2010-03-18 12:09:47 +0000 @@ -818,7 +818,7 @@ memcpy(&hdrr_info.dht_key, addrkey, sizeof(struct in6_addr)); hdrr_info.sig_verified = -1; hdrr_info.hit_verified = -1; - HIP_IFEL(hip_build_user_hdr(hipcommonmsg, SO_HIP_VERIFY_DHT_HDRR_RESP, 0), -1, + HIP_IFEL(hip_build_user_hdr(hipcommonmsg, HIP_MSG_VERIFY_DHT_HDRR_RESP, 0), -1, "Building daemon header failed\n"); hip_build_param_hip_hdrr_info(hipcommonmsg, &hdrr_info); _HIP_DUMP_MSG(hipcommonmsg); === modified file 'lib/opphip/wrap.c' --- lib/opphip/wrap.c 2010-03-10 17:44:36 +0000 +++ lib/opphip/wrap.c 2010-03-18 12:09:47 +0000 @@ -175,7 +175,7 @@ struct hip_common *msg = NULL; HIP_IFEL(!(msg = hip_msg_alloc()), -1, "malloc failed\n"); - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_DEFAULT_HIT, 0), + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_DEFAULT_HIT, 0), -1, "Fail to get hits"); HIP_IFEL(hip_send_recv_daemon_info(msg, 0, 0), -1, "send/recv\n"); HIP_IFEL(!(param = hip_get_param(msg, HIP_PARAM_HIT)), -1, @@ -371,7 +371,7 @@ HIP_IFE(!(msg = hip_msg_alloc()), -1); /* build the message header */ - HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_GET_PEER_HIT, 0), -1, + HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_GET_PEER_HIT, 0), -1, "build hdr failed\n"); HIP_IFEL(hip_build_param_contents(msg, (void *) (local_hit), === modified file 'tools/pisacert.c' --- tools/pisacert.c 2010-03-12 17:13:04 +0000 +++ tools/pisacert.c 2010-03-18 12:09:47 +0000 @@ -35,7 +35,7 @@ msg = hip_msg_alloc(); HIP_IFE(!msg, -1); - HIP_IFE(hip_build_user_hdr(msg, SO_HIP_DEFAULT_HIT, 0), -1); + HIP_IFE(hip_build_user_hdr(msg, HIP_MSG_DEFAULT_HIT, 0), -1); HIP_IFE(hip_send_recv_daemon_info(msg, 0, 0), -ECOMM); param = hip_get_param(msg, HIP_PARAM_HIT); === modified file 'verbose-headers.txt' --- verbose-headers.txt 2010-03-07 11:20:52 +0000 +++ verbose-headers.txt 2010-03-18 12:09:47 +0000 @@ -484,9 +484,9 @@ libhipcore/icomm.h : firewall_hl libhipcore/icomm.h : firewall_port_cache_hl libhipcore/icomm.h : _HIP_ICOMM -libhipcore/icomm.h : HIP_SO_ROOT_MAX -libhipcore/icomm.h : HIP_SO_ROOT_MIN -libhipcore/icomm.h : SO_HIP_STUN +libhipcore/icomm.h : HIP_MSG_ROOT_MAX +libhipcore/icomm.h : HIP_MSG_ROOT_MIN +libhipcore/icomm.h : HIP_MSG_STUN libhipcore/ife.h : GOTO_OUT libhipcore/ife.h : _HIP_IFE libhipcore/kerncompat.h : atomic_set