Author: adrian.chadd
Date: Sun Feb 22 15:07:07 2009
New Revision: 13828

Modified:
    playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c
    playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.h
    playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_packet.c

Log:
Flesh out some more hold timer related hackery.


Modified: playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c
==============================================================================
--- playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c  (original)
+++ playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c  Sun Feb 22 15:07:07 2009
@@ -43,14 +43,13 @@
  {
        memcpy(&bi->lcl.bgp_id, &bgp_id, sizeof(bgp_id));
        bi->lcl.asn = asn;
-       bi->lcl.hold_time = hold_time;
+       bi->lcl.hold_timer = hold_time;
  }

  void
  bgp_set_rem(bgp_instance_t *bi, u_short asn)
  {
        bi->rem.asn = asn;
-       bi->rem.hold_time = -1;
  }

  /*

Modified: playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.h
==============================================================================
--- playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.h  (original)
+++ playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.h  Sun Feb 22 15:07:07 2009
@@ -25,13 +25,15 @@

        struct {
                u_short asn;
-               u_short hold_time;
+               u_short hold_timer;
                struct in_addr bgp_id;
        } lcl;

        struct {
                u_short asn;
-               u_short hold_time;
+               u_short hold_timer;
+               struct in_addr bgp_id;
+               u_int8_t version;
        } rem;

        /* The AS path table */

Modified: playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_packet.c
==============================================================================
--- playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_packet.c        (original)
+++ playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_packet.c        Sun Feb 22 15:07:07 2009
@@ -175,23 +175,20 @@
  int
  bgp_handle_open(bgp_instance_t *bi, int fd, const char *buf, int len)
  {
-       u_int8_t version;
-       u_int16_t bgp_as;
-       u_int16_t hold_timer;
-       struct in_addr bgp_id;
        int parm_len;

        /* XXX should ensure we have enough space! */
+       /* XXX should check version!? */

-       version = * (u_int8_t *) buf;
-       bgp_as = ntohs(* (u_int16_t *) (buf + 1));
-       hold_timer = ntohs(* (u_int16_t *) (buf + 3));
-       memcpy(&bgp_id, buf + 5, 4);
+       bi->rem.version = * (u_int8_t *) buf;
+       bi->rem.asn = ntohs(* (u_int16_t *) (buf + 1));
+       bi->rem.hold_timer = ntohs(* (u_int16_t *) (buf + 3));
+       memcpy(&bi->rem.bgp_id, buf + 5, 4);

        parm_len = * (u_int8_t *) (buf + 9);
        /* XXX don't bother decoding the OPEN parameters for now! */

-       debug(85, 2) ("bgp_handle_open: got version %d, AS %d, timer %d,  
parm_len %d\n", version, bgp_as, hold_timer, parm_len);
+       debug(85, 2) ("bgp_handle_open: got version %d, AS %d, timer %d,  
parm_len %d\n", bi->rem.version, bi->rem.asn, bi->rem.hold_timer, parm_len);

        /* Queue a keepalive message */
        bgp_send_keepalive(bi, fd);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to