summaryrefslogtreecommitdiff
path: root/ldpd/labelmapping.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-03-24 07:17:06 -0400
committerGitHub <noreply@github.com>2017-03-24 07:17:06 -0400
commit7bd48975b90419b65326c5663e46bb88c276878f (patch)
treee874b496b507e9fd7f5fa74b0955c5a2cca98889 /ldpd/labelmapping.c
parent7a6327c003a57b8c9c98dea84f48d4f9b2eb0763 (diff)
parent0f7b5df9259347bfc425c73fe7cf1ffc89cf2269 (diff)
Merge pull request #286 from opensourcerouting/ldpd-tshoot
Ldpd tshoot
Diffstat (limited to 'ldpd/labelmapping.c')
-rw-r--r--ldpd/labelmapping.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/ldpd/labelmapping.c b/ldpd/labelmapping.c
index e8ce7fbdf5..f53bc8333d 100644
--- a/ldpd/labelmapping.c
+++ b/ldpd/labelmapping.c
@@ -26,13 +26,13 @@
#include "mpls.h"
-static void enqueue_pdu(struct nbr *, struct ibuf *, uint16_t);
+static void enqueue_pdu(struct nbr *, uint16_t, struct ibuf *, uint16_t);
static int gen_label_tlv(struct ibuf *, uint32_t);
static int gen_reqid_tlv(struct ibuf *, uint32_t);
static void log_msg_mapping(int, uint16_t, struct nbr *, struct map *);
static void
-enqueue_pdu(struct nbr *nbr, struct ibuf *buf, uint16_t size)
+enqueue_pdu(struct nbr *nbr, uint16_t type, struct ibuf *buf, uint16_t size)
{
struct ldp_hdr *ldp_hdr;
@@ -81,7 +81,7 @@ send_labelmessage(struct nbr *nbr, uint16_t type, struct mapping_head *mh)
/* maximum pdu length exceeded, we need a new ldp pdu */
if (size + msg_size > nbr->max_pdu_len) {
- enqueue_pdu(nbr, buf, size);
+ enqueue_pdu(nbr, type, buf, size);
first = 1;
continue;
}
@@ -108,11 +108,32 @@ send_labelmessage(struct nbr *nbr, uint16_t type, struct mapping_head *mh)
log_msg_mapping(1, type, nbr, &me->map);
+ /* no errors - update per neighbor message counters */
+ switch (type) {
+ case MSG_TYPE_LABELMAPPING:
+ nbr->stats.labelmap_sent++;
+ break;
+ case MSG_TYPE_LABELREQUEST:
+ nbr->stats.labelreq_sent++;
+ break;
+ case MSG_TYPE_LABELWITHDRAW:
+ nbr->stats.labelwdraw_sent++;
+ break;
+ case MSG_TYPE_LABELRELEASE:
+ nbr->stats.labelrel_sent++;
+ break;
+ case MSG_TYPE_LABELABORTREQ:
+ nbr->stats.labelabreq_sent++;
+ break;
+ default:
+ break;
+ }
+
TAILQ_REMOVE(mh, me, entry);
free(me);
}
- enqueue_pdu(nbr, buf, size);
+ enqueue_pdu(nbr, type, buf, size);
nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}