[hipl-commit] [trunk] Rev 4529: Remove BOS code.

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Mon, 17 May 2010 00:02:21 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 17/05/2010 at 00:02:20
Revision: 4529
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Remove BOS code.

Modified:
  D  hipd/bos.c
  D  hipd/bos.h
  M  Makefile.am
  M  doc/HOWTO.xml
  M  firewall/conntrack.c
  M  hipd/hadb.c
  M  hipd/input.c
  M  hipd/input.h
  M  hipd/netdev.c
  M  hipd/user.c
  M  hipd/user.h
  M  lib/conf/conf.c
  M  lib/conf/conf.h
  M  lib/core/builder.c
  M  lib/core/icomm.h
  M  lib/core/protodefs.h
  M  lib/core/state.h

=== modified file 'Makefile.am'
--- Makefile.am 2010-05-16 17:58:14 +0000
+++ Makefile.am 2010-05-16 21:02:09 +0000
@@ -51,7 +51,6 @@
 
 hipd_hipd_SOURCES = hipd/accessor.c              \
                     hipd/blind.c                 \
-                    hipd/bos.c                   \
                     hipd/cert.c                  \
                     hipd/close.c                 \
                     hipd/configfilereader.c      \

=== modified file 'doc/HOWTO.xml'
--- doc/HOWTO.xml       2010-05-16 17:58:14 +0000
+++ doc/HOWTO.xml       2010-05-16 21:02:09 +0000
@@ -3901,19 +3901,6 @@
         </para>
   </section>
 
-  <section id="ch_hip_bos">
-    <title> Using HIP BOS support</title>
-    <para>
-        To generate a BOS packet (sent to the global multicast address
-      on all interfaces), use the following command:
-    </para>
-    <para>
-                  hipconf hip bos
-    </para>
-    <para>
-            BOS-aware hosts will record the machine's HOST ID, HIT, and IP 
address.
-    </para>
-  </section>
 <!--
   <section>
 

=== modified file 'firewall/conntrack.c'
--- firewall/conntrack.c        2010-04-20 12:15:57 +0000
+++ firewall/conntrack.c        2010-05-16 21:02:09 +0000
@@ -1725,9 +1725,6 @@
     } else if (common->type_hdr == HIP_NOTIFY) {
         // don't process and let pass through
         err = 1;
-    } else if (common->type_hdr == HIP_BOS) {   //removed from base01
-        // don't process and let pass through
-        err = 1;
     } else if (common->type_hdr == HIP_CLOSE) {
         err = handle_close(ip6_src, ip6_dst, common, tuple, ctx);
     } else if (common->type_hdr == HIP_CLOSE_ACK) {

=== modified file 'hipd/hadb.c'
--- hipd/hadb.c 2010-05-12 16:09:38 +0000
+++ hipd/hadb.c 2010-05-16 21:02:09 +0000
@@ -1137,7 +1137,6 @@
     default_rcv_func_set.hip_receive_r2        = hip_receive_r2;
     default_rcv_func_set.hip_receive_update    = hip_receive_update;
     default_rcv_func_set.hip_receive_notify    = hip_receive_notify;
-    default_rcv_func_set.hip_receive_bos       = hip_receive_bos;
     default_rcv_func_set.hip_receive_close     = hip_receive_close;
     default_rcv_func_set.hip_receive_close_ack = hip_receive_close_ack;
 
@@ -1149,7 +1148,6 @@
     default_handle_func_set.hip_handle_r1        = hip_handle_r1;
     default_handle_func_set.hip_handle_i2        = hip_handle_i2;
     default_handle_func_set.hip_handle_r2        = hip_handle_r2;
-    default_handle_func_set.hip_handle_bos       = hip_handle_bos;
     default_handle_func_set.hip_handle_close     = hip_handle_close;
     default_handle_func_set.hip_handle_close_ack = hip_handle_close_ack;
 

=== modified file 'hipd/input.c'
--- hipd/input.c        2010-05-12 16:09:38 +0000
+++ hipd/input.c        2010-05-16 21:02:09 +0000
@@ -549,8 +549,8 @@
                                struct in6_addr *dst_addr,
                                hip_portpair_t *msg_info)
 {
-    hip_ha_t tmp, *entry = NULL;
-    int err = 0, type, skip_sync = 0;
+    hip_ha_t *entry = NULL;
+    int err = 0, type;
     struct in6_addr ipv6_any_addr = IN6ADDR_ANY_INIT;
 
     /* Debug printing of received packet information. All received HIP
@@ -771,21 +771,6 @@
                               hip_receive_notify(msg, src_addr, dst_addr, 
entry));
         break;
 
-    case HIP_BOS:
-        err = (hip_get_rcv_default_func_set())->
-              hip_receive_bos(msg, src_addr, dst_addr, entry,
-                              msg_info);
-
-        /*In case of BOS the msg->hitr is null, therefore it is replaced
-         * with our own HIT, so that the beet state can also be
-         * synchronized. */
-
-        ipv6_addr_copy(&tmp.hit_peer, &msg->hits);
-        hip_init_us(&tmp, NULL);
-        ipv6_addr_copy(&msg->hitr, &tmp.hit_our);
-        skip_sync = 0;
-        break;
-
     case HIP_CLOSE:
 #ifdef CONFIG_HIP_PERFORMANCE
         HIP_DEBUG("Start PERF_HANDLE_CLOSE\n");
@@ -3340,60 +3325,3 @@
 out_err:
     return err;
 }
-
-/**
- * Receive BOS packet.
- *
- * This function is called when a BOS packet is received. We add the
- * received HIT and HOST_ID to the database.
- *
- * @param bos       a pointer to...
- * @param bos_saddr a pointer to...
- * @param bos_daddr a pointer to...
- * @param entry     a pointer to...
- * @param bos_info  a pointer to...
- * @return          always zero.
- * @todo Check if it is correct to return always zero.
- */
-int hip_receive_bos(struct hip_common *bos,
-                    struct in6_addr *bos_saddr,
-                    struct in6_addr *bos_daddr,
-                    hip_ha_t *entry,
-                    hip_portpair_t *bos_info)
-{
-    int err = 0, state = 0;
-
-    _HIP_DEBUG("hip_receive_bos() invoked.\n");
-
-    HIP_IFEL(ipv6_addr_any(&bos->hits), 0,
-             "Received NULL sender HIT in BOS.\n");
-    HIP_IFEL(!ipv6_addr_any(&bos->hitr), 0,
-             "Received non-NULL receiver HIT in BOS.\n");
-    HIP_DEBUG("Entered in hip_receive_bos...\n");
-    state = entry ? entry->state : HIP_STATE_UNASSOCIATED;
-
-    /** @todo If received BOS packet from already known sender should return
-     *  right now */
-    HIP_DEBUG("Received BOS packet in state %s\n", hip_state_str(state));
-    switch (state) {
-    case HIP_STATE_UNASSOCIATED:
-    case HIP_STATE_I1_SENT:
-    case HIP_STATE_I2_SENT:
-        /* Possibly no state created yet */
-        err = (hip_get_handle_default_func_set())->hip_handle_bos(bos,
-                                                                  bos_saddr,
-                                                                  bos_daddr,
-                                                                  entry,
-                                                                  bos_info);
-        break;
-    case HIP_STATE_R2_SENT:
-    case HIP_STATE_ESTABLISHED:
-        HIP_DEBUG("BOS not handled in state %s\n", hip_state_str(state));
-        break;
-    default:
-        HIP_IFEL(1, 0, "Internal state (%d) is incorrect\n", state);
-    }
-
-out_err:
-    return err;
-}

=== modified file 'hipd/input.h'
--- hipd/input.h        2010-05-12 16:09:38 +0000
+++ hipd/input.h        2010-05-16 21:02:09 +0000
@@ -85,9 +85,6 @@
                        const struct in6_addr *notify_saddr, const struct 
in6_addr *notify_daddr,
                        hip_ha_t *entry);
 
-int hip_receive_bos(struct hip_common *bos, struct in6_addr *bos_saddr,
-                    struct in6_addr *bos_daddr, hip_ha_t *entry, 
hip_portpair_t *bos_info);
-
 int hip_handle_i1(struct hip_common *i1, struct in6_addr *i1_saddr,
                   struct in6_addr *i1_daddr, hip_ha_t *entry, hip_portpair_t 
*i1_info);
 

=== modified file 'hipd/netdev.c'
--- hipd/netdev.c       2010-05-16 17:58:14 +0000
+++ hipd/netdev.c       2010-05-16 21:02:09 +0000
@@ -888,7 +888,7 @@
      * as a last resource */
     if (err) {
         struct in_addr bcast = { INADDR_BROADCAST };
-        /* IPv6 multicast (see bos.c) failed to bind() to link local,
+        /* IPv6 multicast failed to bind() to link local,
          * so using IPv4 here -mk */
         HIP_DEBUG("No information of peer found, trying broadcast\n");
         broadcast           = 1;

=== modified file 'hipd/user.c'
--- hipd/user.c 2010-05-16 17:58:14 +0000
+++ hipd/user.c 2010-05-16 21:02:09 +0000
@@ -123,9 +123,6 @@
     case HIP_MSG_RST:
         err                = hip_send_close(msg, 1);
         break;
-    case HIP_MSG_BOS:
-        err                = hip_send_bos(msg);
-        break;
     case HIP_MSG_SET_NAT_ICE_UDP:
         HIP_DEBUG("Setting LOCATOR ON, when ice is on\n");
         hip_locator_status = HIP_MSG_SET_LOCATOR_ON;

=== modified file 'hipd/user.h'
--- hipd/user.h 2010-04-22 10:12:54 +0000
+++ hipd/user.h 2010-05-16 21:02:09 +0000
@@ -16,7 +16,6 @@
 #include <stdint.h> // For uint8_t
 #include <stdlib.h>
 #include "lib/core/list.h"
-#include "bos.h"
 #include "close.h"
 #include "accessor.h"
 #include "hidb.h"

=== modified file 'lib/conf/conf.c'
--- lib/conf/conf.c     2010-05-16 17:58:14 +0000
+++ lib/conf/conf.c     2010-05-16 21:02:09 +0000
@@ -60,7 +60,7 @@
 #define TYPE_MAP           2
 #define TYPE_RST           3
 #define TYPE_SERVER        4
-#define TYPE_BOS           5
+/* free slot */
 #define TYPE_PUZZLE        6
 #define TYPE_NAT           7
 #define TYPE_OPP           EXEC_LOADLIB_OPP /* Should be 8 */
@@ -118,7 +118,6 @@
     "new hi default rsa_keybits dsa_keybits\n"
     "get|inc|dec|new puzzle all\n"
     "set puzzle all new_value\n"
-    "bos all\n"
     "nat none|plain-udp\n"
     "nat port local <port>\n"
     "nat port peer <port>\n"
@@ -474,8 +473,6 @@
         ret = ACTION_INC;
     } else if (!strcmp("dec", argv[1])) {
         ret = ACTION_DEC;
-    } else if (!strcmp("bos", argv[1])) {
-        ret = ACTION_BOS;
     } else if (!strcmp("rst", argv[1])) {
         ret = ACTION_RST;
     } else if (!strcmp("run", argv[1])) {
@@ -555,7 +552,6 @@
     case ACTION_NAT:
     case ACTION_DEC:
     case ACTION_RST:
-    case ACTION_BOS:
     case ACTION_LOCATOR:
     case ACTION_HEARTBEAT:
     case ACTION_HIT_TO_LSI:
@@ -642,8 +638,6 @@
         }
     } else if (strcmp("locator", argv[1]) == 0)     {
         ret = TYPE_LOCATOR;
-    } else if ((!strcmp("all", text)) && (strcmp("bos", argv[1]) == 0)) {
-        ret = TYPE_BOS;
     } else if (!strcmp("debug", text)) {
         ret = TYPE_DEBUG;
     } else if ((!strcmp("mode", text)) && (strcmp("mhaddr", argv[1]) == 0)) {
@@ -733,7 +727,6 @@
     case ACTION_HEARTBEAT:
     case ACTION_LOCATOR:
     case ACTION_RST:
-    case ACTION_BOS:
     case ACTION_MHADDR:
     case ACTION_HANDOVER:
     case ACTION_TRANSORDER:
@@ -1423,40 +1416,6 @@
 }
 
 /**
- * Handles the hipconf commands where the type is @c bos.
- *
- * @param msg    a pointer to the buffer where the message for kernel will
- *               be written.
- * @param action the numeric action identifier for the action to be performed.
- * @param opt    an array of pointers to the command line arguments after
- *               the action and type.
- * @param optc   the number of elements in the array (@b 0).
- * @return       zero on success, or negative error value on error.
- */
-int hip_conf_handle_bos(hip_common_t *msg, int action,
-                        const char *opt[], int optc, int send_only)
-{
-    int err;
-
-    /* Check that there are no extra args */
-    if (optc != 0) {
-        HIP_ERROR("Extra arguments\n");
-        err = -EINVAL;
-        goto out;
-    }
-
-    /* Build the message header */
-    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;
-    }
-
-out:
-    return err;
-}
-
-/**
  * Handles the hipconf commands where the type is @c trigger-update.
  *
  * @param msg    a pointer to the buffer where the message for hipd will
@@ -2811,7 +2770,7 @@
     hip_conf_handle_rst,                /* 3: TYPE_RST */
     hip_conf_handle_server,             /* 4: TYPE_SERVER */
     /* Any client side registration action. */
-    hip_conf_handle_bos,                /* 5: TYPE_BOS */
+    NULL,                               /* 5: unused */
     hip_conf_handle_puzzle,             /* 6: TYPE_PUZZLE */
     hip_conf_handle_nat,                /* 7: TYPE_NAT */
     hip_conf_handle_opp,                /* 8: TYPE_OPP */

=== modified file 'lib/conf/conf.h'
--- lib/conf/conf.h     2010-05-16 17:58:14 +0000
+++ lib/conf/conf.h     2010-05-16 21:02:09 +0000
@@ -153,7 +153,7 @@
 /* free slot */
 #define ACTION_HA  13
 #define ACTION_RST 14
-#define ACTION_BOS 15
+/* free slot */
 #define ACTION_DEBUG 16
 #define ACTION_MHADDR 17
 #define ACTION_RESTART 18
@@ -191,11 +191,6 @@
                          const char *opt[],
                          int optc,
                          int send_only);
-int hip_conf_handle_bos(hip_common_t *msg,
-                        int type,
-                        const char *opt[],
-                        int optc,
-                        int send_only);
 int hip_conf_handle_hi(hip_common_t *msg,
                        int type,
                        const char *opt[],

=== modified file 'lib/core/builder.c'
--- lib/core/builder.c  2010-05-16 17:58:14 +0000
+++ lib/core/builder.c  2010-05-16 21:02:09 +0000
@@ -631,7 +631,6 @@
         HIP_R2,
         HIP_UPDATE,
         HIP_NOTIFY,
-        HIP_BOS,
         HIP_CLOSE,
         HIP_CLOSE_ACK,
         HIP_LUPDATE
@@ -1141,7 +1140,6 @@
     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";
@@ -1959,7 +1957,6 @@
 
     /** @todo handle the RVS case better. */
     if (ipv6_addr_any(&hip_common->hitr)) {
-        /* Required for e.g. BOS */
         HIP_DEBUG("Received a connection to opportunistic HIT\n");
     } else {
         HIP_DEBUG_HIT("Received a connection to HIT", &hip_common->hitr);

=== modified file 'lib/core/icomm.h'
--- lib/core/icomm.h    2010-05-16 17:58:14 +0000
+++ lib/core/icomm.h    2010-05-16 21:02:09 +0000
@@ -74,7 +74,7 @@
 #define HIP_MSG_RUN_UNIT_TEST                    67
 #define HIP_MSG_RST                              68
 #define HIP_MSG_UNIT_TEST                        69
-#define HIP_MSG_BOS                              70
+/* free slot */
 #define HIP_MSG_NETLINK_DUMMY                    71
 #define HIP_MSG_CONF_PUZZLE_NEW                  72
 #define HIP_MSG_CONF_PUZZLE_GET                  73

=== modified file 'lib/core/protodefs.h'
--- lib/core/protodefs.h        2010-05-16 17:58:14 +0000
+++ lib/core/protodefs.h        2010-05-16 21:02:09 +0000
@@ -42,7 +42,7 @@
 #define HIP_I2                  3
 #define HIP_R2                  4
 #define HIP_CER                 5
-#define HIP_BOS                 11 ///< removed from ietf-hip-base-01
+
 #define HIP_UPDATE              16
 #define HIP_NOTIFY              17
 #define HIP_CLOSE               18

=== modified file 'lib/core/state.h'
--- lib/core/state.h    2010-05-12 16:09:38 +0000
+++ lib/core/state.h    2010-05-16 21:02:09 +0000
@@ -574,12 +574,6 @@
                               const struct in6_addr *,
                               hip_ha_t *);
 
-    int (*hip_receive_bos)(struct hip_common *,
-                           struct in6_addr *,
-                           struct in6_addr *,
-                           hip_ha_t *,
-                           hip_portpair_t *);
-
     int (*hip_receive_close)(struct hip_common *,
                              hip_ha_t *);
 
@@ -614,11 +608,6 @@
                          struct in6_addr *r2_daddr,
                          hip_ha_t *ha,
                          hip_portpair_t *r2_info);
-    int (*hip_handle_bos)(struct hip_common *bos,
-                          struct in6_addr *r2_saddr,
-                          struct in6_addr *r2_daddr,
-                          hip_ha_t *ha,
-                          hip_portpair_t *);
     int (*hip_handle_close)(struct hip_common *close,
                             hip_ha_t *entry);
     int (*hip_handle_close_ack)(struct hip_common *close_ack,

Other related posts:

  • » [hipl-commit] [trunk] Rev 4529: Remove BOS code. - Diego Biurrun