hipl-core team mailing list archive
-
hipl-core team
-
Mailing list archive
-
Message #00070
[Branch ~hipl-core/hipl/trunk] Rev 4913: removed remaining code for data_packet extension
------------------------------------------------------------
revno: 4913
committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-08-25 11:06:43 +0200
message:
removed remaining code for data_packet extension
This extension was removed before, however, incomplete. Especially hipd
and hipconf still had pieces of code relating to the extension. I also
changed the parameter list of one function as a parameter was unused
after the code deletion.
modified:
firewall/firewall.c
hipd/hip_socket.c
hipd/hipd.c
hipd/hipd.h
hipd/init.c
hipd/netdev.c
hipd/user.c
hipd/user.h
lib/core/conf.c
lib/core/icomm.h
--
lp:hipl
https://code.launchpad.net/~hipl-core/hipl/trunk
Your team HIPL core team is subscribed to branch lp:hipl.
To unsubscribe from this branch go to https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'firewall/firewall.c'
--- firewall/firewall.c 2010-08-19 09:32:20 +0000
+++ firewall/firewall.c 2010-08-25 09:06:43 +0000
@@ -1348,7 +1348,6 @@
int verdict = accept_hip_esp_traffic_by_default;
HIP_DEBUG("hip_fw_handle_hip_input()\n");
- //Prabhu handle incoming datapackets
verdict = hip_fw_handle_hip_output(ctx);
=== modified file 'hipd/hip_socket.c'
--- hipd/hip_socket.c 2010-08-20 14:59:41 +0000
+++ hipd/hip_socket.c 2010-08-25 09:06:43 +0000
@@ -131,7 +131,7 @@
send_response = hip_get_msg_response(ctx->input_msg);
if (hip_user_run_handles(msg_type, ctx->input_msg, &app_src)) {
- err = hip_handle_user_msg(ctx->input_msg, &app_src, &send_response);
+ err = hip_handle_user_msg(ctx->input_msg, &app_src);
}
if (send_response) {
=== modified file 'hipd/hipd.c'
--- hipd/hipd.c 2010-08-18 16:54:41 +0000
+++ hipd/hipd.c 2010-08-25 09:06:43 +0000
@@ -150,8 +150,6 @@
*/
int hip_use_userspace_ipsec = 0;
-int hip_use_userspace_data_packet_mode = 0;
-
int esp_prot_active = 0;
int esp_prot_num_transforms = 0;
uint8_t esp_prot_transforms[MAX_NUM_TRANSFORMS];
=== modified file 'hipd/hipd.h'
--- hipd/hipd.h 2010-07-07 16:42:17 +0000
+++ hipd/hipd.h 2010-08-25 09:06:43 +0000
@@ -110,8 +110,6 @@
extern hip_transform_suite_t hip_nat_status;
-extern int hip_use_userspace_data_packet_mode;
-
extern int esp_prot_active;
extern int esp_prot_num_transforms;
extern long esp_prot_num_parallel_hchains;
=== modified file 'hipd/init.c'
--- hipd/init.c 2010-08-24 17:14:01 +0000
+++ hipd/init.c 2010-08-25 09:06:43 +0000
@@ -169,7 +169,6 @@
# add server rvs hiprvs.infrahip.net 50000 # Register to free RVS at infrahip\n\
# heartbeat 10 # send ICMPv6 messages inside HIP tunnels\n\
# locator on # host sends all of its locators in base exchange\n\
-# datapacket on # experimental draft hiccups extensions\n\
# shotgun on # use all possible src/dst IP combinations to send I1/UPDATE\n\
# opp normal|advanced|none\n\
# transform order 213 # crypto preference order (1=AES, 2=3DES, 3=NULL)\n\
=== modified file 'hipd/netdev.c'
--- hipd/netdev.c 2010-08-24 17:20:54 +0000
+++ hipd/netdev.c 2010-08-25 09:06:43 +0000
@@ -998,12 +998,6 @@
HIP_DEBUG("Using ifindex %d\n", if_index);
- /* If datapacket mode is set then don't send I1.
- * Instead, reply with data packet mode message type. */
- if (hip_use_userspace_data_packet_mode) {
- goto out_err;
- }
-
HIP_IFEL(hip_send_i1(&entry->hit_our, &entry->hit_peer, entry), -1,
"Sending of I1 failed\n");
=== modified file 'hipd/user.c'
--- hipd/user.c 2010-08-20 14:34:13 +0000
+++ hipd/user.c 2010-08-25 09:06:43 +0000
@@ -216,12 +216,11 @@
* @return zero on success, or negative error value on error.
*/
int hip_handle_user_msg(hip_common_t *msg,
- struct sockaddr_in6 *src,
- int *send_response)
+ struct sockaddr_in6 *src)
{
const hip_hit_t *src_hit = NULL, *dst_hit = NULL;
hip_ha_t *entry = NULL;
- int err = 0, msg_type = 0, n = 0, reti = 0;
+ int err = 0, msg_type = 0, reti = 0;
int access_ok = 0, is_root = 0;
const struct hip_tlv_common *param = NULL;
@@ -709,77 +708,6 @@
/* invoking the signal handler directly is not a sane thing to do */
kill(getpid(), SIGINT);
break;
- case HIP_MSG_SET_DATAPACKET_MODE_ON:
- {
- struct sockaddr_in6 sock_addr;
- HIP_DEBUG("HIP_MSG_SET_DATAPACKET_MODE_ON\n");
- HIP_DUMP_MSG(msg);
-
- hip_use_userspace_data_packet_mode = 1;
-
- memset(&sock_addr, 0, sizeof(sock_addr));
- sock_addr.sin6_family = AF_INET6;
- sock_addr.sin6_port = htons(HIP_FIREWALL_PORT);
- sock_addr.sin6_addr = in6addr_loopback;
-
- n = hip_sendto_user(msg, (struct sockaddr *) &sock_addr);
- if (n <= 0) {
- HIP_ERROR("hipconf datapacket failed \n");
- } else {
- HIP_DEBUG("hipconf datapacket ok (sent %d bytes)\n", n);
- break;
- }
- *send_response = 1;
- break;
- }
-
- case HIP_MSG_SET_DATAPACKET_MODE_OFF:
- {
- struct sockaddr_in6 sock_addr_1;
- HIP_DEBUG("HIP_MSG_SET_DATAPACKET_MODE_OFF\n");
- HIP_DUMP_MSG(msg);
-
- hip_use_userspace_data_packet_mode = 0;
-
- //firewall socket address
- memset(&sock_addr_1, 0, sizeof(sock_addr_1));
- sock_addr_1.sin6_family = AF_INET6;
- sock_addr_1.sin6_port = htons(HIP_FIREWALL_PORT);
- sock_addr_1.sin6_addr = in6addr_loopback;
-
- n = hip_sendto_user(msg, (struct sockaddr *) &sock_addr_1);
- if (n <= 0) {
- HIP_ERROR("hipconf datapacket failed \n");
- } else {
- HIP_DEBUG("hipconf datapacket ok (sent %d bytes)\n", n);
- }
- *send_response = 1;
- break;
- }
-
- case HIP_MSG_BUILD_HOST_ID_SIGNATURE_DATAPACKET:
- {
- int original_type;
- hip_hit_t data_hit;
-
- HIP_IFEL(hip_get_any_localhost_hit(&data_hit, HIP_HI_DEFAULT_ALGO, 0), -1,
- "No HIT found\n");
-
- HIP_DEBUG("HIP_MSG_BUILD_HOST_ID_SIGNATURE_DATAPACKET");
-
- original_type = msg->type_hdr;
-
- /* We are about the sign the packet ..
- * So change the MSG type to HIP_DATA and then reset it to original */
- msg->type_hdr = HIP_DATA;
- err = hip_build_host_id_and_signature(msg, &data_hit);
- msg->type_hdr = original_type;
-
- *send_response = 1;
- goto out_err;
- }
- break;
-
case HIP_MSG_TRIGGER_BEX:
HIP_DEBUG("HIP_MSG_TRIGGER_BEX\n");
hip_firewall_status = 1;
=== modified file 'hipd/user.h'
--- hipd/user.h 2010-07-07 16:42:17 +0000
+++ hipd/user.h 2010-08-25 09:06:43 +0000
@@ -48,7 +48,6 @@
void hip_user_uninit_handles(void);
int hip_sendto_user(const struct hip_common *msg, const struct sockaddr *dst);
int hip_handle_user_msg(hip_common_t *msg,
- struct sockaddr_in6 *src,
- int *send_response);
+ struct sockaddr_in6 *src);
#endif /* HIP_HIPD_USER_H */
=== modified file 'lib/core/conf.c'
--- lib/core/conf.c 2010-08-19 09:32:20 +0000
+++ lib/core/conf.c 2010-08-25 09:06:43 +0000
@@ -128,7 +128,7 @@
#define ACTION_HIT_TO_IP_SET 32
#define ACTION_NAT_LOCAL_PORT 33
#define ACTION_NAT_PEER_PORT 34
-#define ACTION_DATAPACKET 35 /*Support for datapacket--Prabhu */
+/* unused, was ACTION_DATAPACKET 35 */
/* unused, was ACTION_SHOTGUN 36 */
#define ACTION_MAP_ID_TO_ADDR 37
#define ACTION_LSI_TO_HIT 38
@@ -177,7 +177,7 @@
#define TYPE_HIT_TO_LSI 35
#define TYPE_NAT_LOCAL_PORT 36
#define TYPE_NAT_PEER_PORT 37
-#define TYPE_DATAPACKET 38 /*support for data packet mode-- Prabhu */
+/* unused, was TYPE_DATAPACKET 38 */
#define TYPE_SHOTGUN 39
#define TYPE_ID_TO_ADDR 40
#define TYPE_LSI_TO_HIT 41
@@ -232,7 +232,6 @@
"nsupdate on|off\n"
"hit-to-ip on|off\n"
"hit-to-ip-zone <hit-to-ip.zone.>\n"
- "datapacket on|off\n"
"shotgun on|off\n"
"id-to-addr hit|lsi\n"
;
@@ -588,8 +587,6 @@
} else {
ret = ACTION_NAT;
}
- } else if (!strcmp("datapacket", argv[1])) {
- ret = ACTION_DATAPACKET;
}
return ret;
@@ -616,7 +613,6 @@
case ACTION_LOCATOR:
case ACTION_HEARTBEAT:
case ACTION_HIT_TO_LSI:
- case ACTION_DATAPACKET:
case ACTION_MAP_ID_TO_ADDR:
case ACTION_LSI_TO_HIT:
count = 1;
@@ -727,8 +723,6 @@
ret = TYPE_HIT_TO_IP_SET;
} else if (strcmp("hit-to-ip", argv[1]) == 0) {
ret = TYPE_HIT_TO_IP;
- } else if (strcmp("datapacket", argv[1]) == 0) {
- ret = TYPE_DATAPACKET;
} else if (strcmp("lsi-to-hit", argv[1]) == 0) {
ret = TYPE_LSI_TO_HIT;
} else {
@@ -776,7 +770,6 @@
case ACTION_NSUPDATE:
case ACTION_HIT_TO_IP:
case ACTION_HIT_TO_IP_SET:
- case ACTION_DATAPACKET:
type_arg = 2;
break;
case ACTION_MANUAL_UPDATE:
@@ -1580,35 +1573,6 @@
}
/**
- * Handles the hipconf commands where type is @c datapacket. This mode swithces the Hip Firewall to work in data packet mode , meaning it can communicate without establishing BEX with peer node.
- *
- */
-
-static int hip_conf_handle_datapacket(hip_common_t *msg,
- UNUSED int action,
- const char *opt[],
- UNUSED int optc,
- UNUSED int send_only)
-{
- int err = 0, status = 0;
-
- if (!strcmp("on", opt[0])) {
- status = HIP_MSG_SET_DATAPACKET_MODE_ON;
- } else if (!strcmp("off", opt[0])) {
- status = HIP_MSG_SET_DATAPACKET_MODE_OFF;
- } 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));
-
-out_err:
-
- return 0;
-}
-
-/**
* Handles the hipconf commands where the type is @c locator. You can turn
* locator sending in BEX on or query the set of local locators with this
* function.
@@ -2684,7 +2648,7 @@
hip_conf_handle_get_peer_lsi, /* 35: TYPE_MAP_GET_PEER_LSI */
hip_conf_handle_nat_port, /* 36: TYPE_NAT_LOCAL_PORT */
hip_conf_handle_nat_port, /* 37: TYPE_PEER_LOCAL_PORT */
- hip_conf_handle_datapacket, /* 38: TYPE_DATAPACKET*/
+ NULL, /* 38: unused, was TYPE_DATAPACKET*/
NULL, /* 39: unused, was TYPE_SHOTGUN */
hip_conf_handle_map_id_to_addr, /* 40: TYPE_ID_TO_ADDR */
hip_conf_handle_lsi_to_hit, /* 41: TYPE_LSI_TO_HIT */
=== modified file 'lib/core/icomm.h'
--- lib/core/icomm.h 2010-07-14 16:01:50 +0000
+++ lib/core/icomm.h 2010-08-25 09:06:43 +0000
@@ -186,9 +186,6 @@
#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 HIP_MSG_HANDOVER_HARD 199