2 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netvirt.bgpmanager.oam;
11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13 import java.io.BufferedReader;
14 import java.io.BufferedWriter;
16 import java.io.FileNotFoundException;
17 import java.io.FileWriter;
18 import java.io.IOException;
19 import java.io.InputStreamReader;
20 import java.io.PrintWriter;
21 import java.net.Inet4Address;
22 import java.net.Inet6Address;
23 import java.net.InetAddress;
24 import java.net.Socket;
25 import java.net.SocketTimeoutException;
26 import java.net.UnknownHostException;
27 import java.util.ArrayList;
28 import java.util.List;
30 import java.util.Scanner;
31 import java.util.concurrent.ConcurrentHashMap;
32 import javax.inject.Inject;
33 import org.eclipse.jdt.annotation.NonNull;
34 import org.opendaylight.infrautils.metrics.Counter;
35 import org.opendaylight.infrautils.metrics.Labeled;
36 import org.opendaylight.infrautils.metrics.MetricDescriptor;
37 import org.opendaylight.infrautils.metrics.MetricProvider;
38 import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_afi;
39 import org.slf4j.Logger;
40 import org.slf4j.LoggerFactory;
42 @SuppressFBWarnings("DM_DEFAULT_ENCODING")
43 public class BgpCounters implements Runnable, AutoCloseable {
44 public static final String BGP_VPNV6_FILE = "cmd_ip_bgp_vpnv6_all.txt";
45 public static final String BGP_VPNV4_FILE = "cmd_ip_bgp_vpnv4_all.txt";
46 public static final String BGP_EVPN_FILE = "cmd_bgp_l2vpn_evpn_all.txt";
47 public static final String BGP_VPNV6_SUMMARY_FILE = "cmd_ip_bgp_vpnv6_all_summary.txt";
48 public static final String BGP_VPNV4_SUMMARY_FILE = "cmd_ip_bgp_vpnv4_all_summary.txt";
49 public static final String BGP_EVPN_SUMMARY_FILE = "cmd_bgp_evpn_all_summary.txt";
50 public static final String BFD_NBR_DETAIL_FILE = "cmd_bfd_neighbors_details.txt";
53 // BFD related constants
54 public static final int LINE = 1; // line where the ip address of neigbor present after "NeighbroAddr"
55 public static final int NBR_IP_WORD_INDEX = 1; // word where the ip address is present (count start from 0)
56 public static final int RX_COUNT_WORD_INDEX = 1; // word where the Rx Count is present after split :
57 public static final int TX_COUNT_WORD_INDEX = 1; // word where the Tx Count is present after split :
59 private static final Logger LOG = LoggerFactory.getLogger(BgpCounters.class);
61 private final Map<String, String> totalPfxMap = new ConcurrentHashMap<>();
62 private final Map<String, String> ipv4PfxMap = new ConcurrentHashMap<>();
63 private final Map<String, String> ipv6PfxMap = new ConcurrentHashMap<>();
65 private final String bgpSdncMip;
66 private final MetricProvider metricProvider;
69 public BgpCounters(String mipAddress, final MetricProvider metricProvider) {
70 this.metricProvider = metricProvider;
71 this.bgpSdncMip = mipAddress;
80 LOG.debug("Fetching counters from BGP");
82 fetchCmdOutputs("cmd_ip_bgp_summary.txt", "show ip bgp summary");
83 fetchCmdOutputs("cmd_bgp_ipv4_unicast_statistics.txt", "show bgp ipv4 unicast statistics");
84 fetchCmdOutputs(BGP_VPNV4_FILE, "show ip bgp vpnv4 all");
85 fetchCmdOutputs(BGP_VPNV6_FILE, "show ip bgp vpnv6 all");
86 fetchCmdOutputs(BGP_EVPN_FILE, "show bgp l2vpn evpn all");
87 fetchCmdOutputs(BFD_NBR_DETAIL_FILE, "show bgp bfd neighbors details");
92 parseBgpL2vpnEvpnAll();
93 parseBfdNbrsDetails();
94 LOG.debug("Finished updating the counters from BGP");
97 void fetchCmdOutputs(String filename, String cmdName) {
98 try (Socket socket = new Socket(bgpSdncMip, 2605);
99 PrintWriter toRouter = new PrintWriter(socket.getOutputStream(), true);
100 BufferedReader fromRouter = new BufferedReader(new InputStreamReader(socket.getInputStream()));
101 BufferedWriter toFile = new BufferedWriter(new FileWriter(filename, true))) {
102 socket.setSoTimeout(2 * 1000);
104 // Wait for the password prompt
105 StringBuilder sb = new StringBuilder();
107 char[] cbuf = new char[10];
108 while (!sb.toString().contains("Password:")) {
109 if ((read = fromRouter.read(cbuf)) == -1) {
110 LOG.error("Connection closed by BGPd.");
113 sb.append(cbuf, 0, read);
117 toRouter.println(BgpConstants.QBGP_VTY_PASSWORD);
119 // Wait for the prompt (ending with '>' or '#')
120 sb = new StringBuilder();
121 String prompt = null;
122 while (prompt == null) {
123 switch (read = fromRouter.read()) {
125 LOG.error("Connection closed by BGPd, read {}", sb.toString());
130 sb.append((char) read);
131 prompt = sb.toString().trim();
134 sb.append((char) read);
143 while ((read = fromRouter.read()) != '#') {
145 LOG.error("Connection closed by BGPd, read {}", sb.toString());
152 toRouter.println(cmdName);
156 // Read all the router's output
157 sb = new StringBuilder();
158 cbuf = new char[1024];
159 while ((read = fromRouter.read(cbuf)) != -1) {
160 sb.append(cbuf, 0, read);
161 if (sb.toString().trim().endsWith(prompt)) {
166 // Only keep output up to the last prompt
167 int lastPromptIndex = sb.lastIndexOf(prompt);
168 if (lastPromptIndex >= 0) {
169 sb.delete(lastPromptIndex, sb.length());
173 toFile.write(sb.toString().trim());
180 } catch (UnknownHostException e) {
181 LOG.info("Unknown host exception occured while socket creation {} ", bgpSdncMip);
182 } catch (SocketTimeoutException e) {
183 LOG.info("Socket timeout Exception occured while socket creation");
184 } catch (IOException e) {
185 LOG.error("I/O error ip {} {}",bgpSdncMip, e.getMessage());
189 private static boolean validate(@NonNull final String ip, af_afi afi) {
193 int identifiedAFI = 0;
195 InetAddress address = InetAddress.getByName(ip);
196 if (address instanceof Inet6Address) {
197 identifiedAFI = af_afi.AFI_IPV6.getValue();
198 } else if (address instanceof Inet4Address) {
199 identifiedAFI = af_afi.AFI_IP.getValue();
201 } catch (java.net.UnknownHostException e) {
202 /*if exception is catched then the prefix is not an IPv6 and IPv4*/
203 LOG.error("Unrecognized ip address ipAddress: {}", ip);
205 return identifiedAFI == afi.getValue() ? true : false;
209 * The below function parses the output of "show ip bgp summary" saved in a file.
210 * Below is the snippet for the same :-
212 BGP router identifier 10.183.254.53, local AS number 101
214 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
215 10.183.254.76 4 100 3 4 0 0 0 00:01:27 0
217 Total number of neighbors 1
221 private void parseIpBgpSummary() {
222 File file = new File("cmd_ip_bgp_summary.txt");
224 try (Scanner scanner = new Scanner(file)) {
225 boolean startEntries = false;
226 while (scanner.hasNextLine()) {
227 String str = scanner.nextLine();
228 if (str.contains("State/PfxRcd")) {
230 } else if (startEntries) {
231 String[] result = str.split("\\s+");
232 if (result.length < 5) {
235 String strIp = result[0].trim();
236 if (!validate(strIp, af_afi.AFI_IP)) {
239 final String as = result[2];
240 final String rx = result[3];
241 final String tx = result[4];
243 Counter counter = getCounter(BgpConstants.BGP_COUNTER_NBR_PKTS_RX, as,
244 rx, null, strIp, null, "bgp-peer");
245 updateCounter(counter, Long.parseLong(rx));
247 counter = getCounter(BgpConstants.BGP_COUNTER_NBR_PKTS_TX, as,
248 null, tx, strIp, null, "bgp-peer");
249 updateCounter(counter, Long.parseLong(tx));
252 } catch (IOException e) {
253 LOG.error("Could not process the file {}", file.getAbsolutePath());
258 * The below function parses the output of "show ip bgp vpnv4 all" saved in a file.
259 * Below is the sample output for the same :-
260 * show ip bgp vpnv4 all
262 BGP table version is 0, local router ID is 10.183.181.21
264 Route Distinguisher: 100:1
265 *>i15.15.15.15/32 10.183.181.25 0 100 0 ?
266 *>i17.18.17.17/32 10.183.181.25 0 100 0 ?
267 *>i17.18.17.17/32 10.183.181.25 0 100 0 ?
268 *>i17.18.17.17/32 10.183.181.25 0 100 0 ?
269 Route Distinguisher: 100:2
270 *>i16.16.16.16/32 10.183.181.25 0 100 0 ?
271 *>i18.18.18.18/32 10.183.181.25 0 100 0 ?
272 *>i17.18.17.17/32 10.183.181.25 0 100 0 ?
275 private void parseIpBgpVpnv4All() {
276 File file = new File(BGP_VPNV4_FILE);
277 List<String> inputStrs = new ArrayList<>();
279 try (Scanner scanner = new Scanner(file)) {
280 while (scanner.hasNextLine()) {
281 inputStrs.add(scanner.nextLine());
283 } catch (IOException e) {
284 LOG.error("Could not process the file {}", file.getAbsolutePath());
287 for (int i = 0; i < inputStrs.size(); i++) {
288 String instr = inputStrs.get(i);
289 if (instr.contains("Route Distinguisher")) {
290 String[] result = instr.split(":");
291 String rd = result[1].trim() + "_" + result[2].trim();
292 i = processRouteCount(rd + "_VPNV4", i + 1, inputStrs);
295 long bgpIpv4Pfxs = calculateBgpIpv4Prefixes();
296 LOG.trace("BGP IPV4 Prefixes:{}",bgpIpv4Pfxs);
297 Counter counter = getCounter(BgpConstants.BGP_COUNTER_IPV4_PFX, null, null, null,
298 null, null, "bgp-peer");
299 updateCounter(counter, bgpIpv4Pfxs);
303 * The below function parses the output of "show ip bgp vpnv6 all" saved in a file.
304 * Below is the sample output for the same :-
305 * show ip bgp vpnv6 all
307 BGP table version is 0, local router ID is 10.183.181.21
309 Route Distinguisher: 100:1
310 *>i2001:db8:0:2::/128 10.183.181.25 0 100 0 ?
311 *>i2001:db8:0:2::/128 10.183.181.25 0 100 0 ?
312 *>i2001:db8:0:2::/128 10.183.181.25 0 100 0 ?
313 *>i2001:db8:0:2::/128 10.183.181.25 0 100 0 ?
314 Route Distinguisher: 100:2
315 *>i2001:db9:0:3::/128 10.183.181.25 0 100 0 ?
316 *>i2001:db9:0:3::/128 10.183.181.25 0 100 0 ?
317 *>i2001:db9:0:3::/128 10.183.181.25 0 100 0 ?
320 private void parseIpBgpVpnv6All() {
321 File file = new File(BGP_VPNV6_FILE);
322 List<String> inputStrs = new ArrayList<>();
324 try (Scanner scanner = new Scanner(file)) {
325 while (scanner.hasNextLine()) {
326 inputStrs.add(scanner.nextLine());
328 } catch (IOException e) {
329 LOG.error("Could not process the file {}", file.getAbsolutePath());
332 for (int i = 0; i < inputStrs.size(); i++) {
333 String instr = inputStrs.get(i);
334 if (instr.contains("Route Distinguisher")) {
335 String[] result = instr.split(":");
336 String rd = result[1].trim() + "_" + result[2].trim();
337 i = processRouteCount(rd + "_VPNV6", i + 1, inputStrs);
340 long bgpIpv6Pfxs = calculateBgpIpv6Prefixes();
341 LOG.trace("BGP IPV6 Prefixes:{}",bgpIpv6Pfxs);
342 Counter counter = getCounter(BgpConstants.BGP_COUNTER_IPV6_PFX, null, null, null,
343 null, null, "bgp-peer");
344 updateCounter(counter, bgpIpv6Pfxs);
347 private void parseBgpL2vpnEvpnAll() {
348 File file = new File(BGP_EVPN_FILE);
349 List<String> inputStrs = new ArrayList<>();
351 try (Scanner scanner = new Scanner(file)) {
352 while (scanner.hasNextLine()) {
353 inputStrs.add(scanner.nextLine());
355 } catch (IOException e) {
356 LOG.error("Could not process the file {}", file.getAbsolutePath());
359 for (int i = 0; i < inputStrs.size(); i++) {
360 String instr = inputStrs.get(i);
361 if (instr.contains("Route Distinguisher")) {
362 String[] result = instr.split(":");
363 String rd = result[1].trim() + "_" + result[2].trim();
364 i = processRouteCount(rd + "_EVPN", i + 1, inputStrs);
365 LOG.trace("BGP Total Prefixes:{}", i);
368 /*populate the "BgpTotalPrefixes" counter by combining
369 the prefixes that are calculated per RD basis*/
370 long bgpTotalPfxs = calculateBgpTotalPrefixes();
371 LOG.trace("BGP Total Prefixes:{}",bgpTotalPfxs);
372 Counter counter = getCounter(BgpConstants.BGP_COUNTER_TOTAL_PFX, null, null, null,
373 null, null, "bgp-peer");
374 updateCounter(counter, bgpTotalPfxs);
377 private void parseBfdNbrsDetails() {
378 File file = new File(BFD_NBR_DETAIL_FILE);
379 List<String> inputStrs = new ArrayList<>();
381 try (Scanner scanner = new Scanner(file)) {
382 while (scanner.hasNextLine()) {
383 inputStrs.add(scanner.nextLine());
385 } catch (IOException e) {
386 LOG.error("Could not process the file {}", file.getAbsolutePath());
389 String neighborIPstr = null;
390 for (int i = 0; i < inputStrs.size(); i++) {
391 String instr = inputStrs.get(i);
392 if (instr.contains("NeighAddr") && instr.contains("State")) {
393 neighborIPstr = inputStrs.get(i + LINE).split("\\s+")[NBR_IP_WORD_INDEX];
394 if (!validate(neighborIPstr, af_afi.AFI_IP)) {
395 LOG.error("Invalid neighbor IP {}", neighborIPstr);
399 if ((neighborIPstr != null) && inputStrs.get(i).contains("Rx Count:")
400 && inputStrs.get(i + 1).contains("Tx Count:")) {
404 rxCount = Long.parseLong(inputStrs.get(i).split(":")[RX_COUNT_WORD_INDEX].trim());
406 catch (NumberFormatException e) {
407 LOG.error("Rx count Number format exception: {}",
408 inputStrs.get(i + 1).split(":")[RX_COUNT_WORD_INDEX].trim());
415 txCount = Long.parseLong(inputStrs.get(i + 1).split(":")
416 [TX_COUNT_WORD_INDEX].trim());
417 } catch (NumberFormatException e) {
418 LOG.error("Tx count Number format exception: {}",
419 inputStrs.get(i + 1).split(":")[TX_COUNT_WORD_INDEX].trim());
422 Counter counter = getCounter(BgpConstants.BFD_COUNTER_NBR_PKTS_RX, null,
423 Long.toString(rxCount), null, neighborIPstr, null, "bfd-peer");
424 updateCounter(counter, rxCount);
426 counter = getCounter(BgpConstants.BFD_COUNTER_NBR_PKTS_TX, null,
427 null, Long.toString(txCount), neighborIPstr, null, "bfd-peer");
428 updateCounter(counter, txCount);
430 //Counter fetching is done, search for next BFD Neighbor IP
431 neighborIPstr = null;
436 private int processRouteCount(String rd, int startIndex, List<String> inputStrs) {
437 int num = startIndex;
440 String bgpRdRouteCountKey = BgpConstants.BGP_COUNTER_RD_ROUTE_COUNT + rd;
441 Counter counter = getCounter(BgpConstants.BGP_COUNTER_RD_ROUTE_COUNT, null, null, null,
442 null, rd, "bgp-peer");
443 for (String str = inputStrs.get(num); str != null && !str.trim().equals("")
444 && num < inputStrs.size();
445 str = inputStrs.get(num)) {
446 if (str.contains("Route Distinguisher")) {
447 totalPfxMap.put(bgpRdRouteCountKey, Long.toString(routeCount));
448 updateCounter(counter, routeCount);
451 else if (rd.contains("VPNV4")) {
452 ipv4PfxMap.put(bgpRdRouteCountKey, Long.toString(++routeCount));
453 updateCounter(counter, routeCount);
454 } else if (rd.contains("VPNV6")) {
455 ipv6PfxMap.put(bgpRdRouteCountKey, Long.toString(++routeCount));
456 updateCounter(counter, routeCount);
459 if (num == inputStrs.size()) {
463 if (routeCount == 0) {
464 // Erroneous condition, should never happen.
465 // Implies that the file contains marker for RD without routes.
466 // will form an infinite loop if not broken
467 // by sending a big number back.
468 return Integer.MAX_VALUE;
470 updateCounter(counter, routeCount);
474 private Long calculateBgpIpv4Prefixes() {
475 return ipv4PfxMap.entrySet().stream()
476 .map(Map.Entry::getValue).mapToLong(Long::parseLong).sum();
479 private Long calculateBgpIpv6Prefixes() {
480 return ipv6PfxMap.entrySet().stream()
481 .map(Map.Entry::getValue).mapToLong(Long::parseLong).sum();
484 private Long calculateBgpTotalPrefixes() {
485 return totalPfxMap.entrySet().stream()
486 .map(Map.Entry::getValue).mapToLong(Long::parseLong).sum();
489 private void resetCounters() {
493 resetFile("cmd_ip_bgp_summary.txt");
494 resetFile("cmd_bgp_ipv4_unicast_statistics.txt");
495 resetFile(BGP_VPNV4_FILE);
496 resetFile(BGP_VPNV6_FILE);
497 resetFile(BGP_EVPN_FILE);
498 resetFile(BFD_NBR_DETAIL_FILE);
501 static void resetFile(String fileName) {
502 File file = new File(fileName);
503 if (!file.delete()) {
504 try (PrintWriter pw = new PrintWriter(file)) {
506 } catch (FileNotFoundException e) {
512 static Map<String, String> parseIpBgpVpnAllSummary(Map<String, String> countMap,
515 File file = new File(cmdFile);
517 try (Scanner scanner = new Scanner(file)) {
518 boolean startEntries = false;
519 while (scanner.hasNextLine()) {
520 String str = scanner.nextLine();
521 LOG.trace("str is:: {}", str);
522 if (str.contains("State/PfxRcd")) {
524 } else if (startEntries) {
525 String[] result = str.split("\\s+");
526 if (result.length > 9) {
527 String strIp = result[0].trim();
528 LOG.trace("strIp {} ", strIp);
530 if (!validate(strIp, afi)) {
533 String statePfxRcvd = result[9];
534 countMap.put(strIp, statePfxRcvd);
538 } catch (IOException e) {
539 LOG.trace("Could not process the file {}", file.getAbsolutePath());
546 static Map<String, String> parseIpBgpVpnv4AllSummary(Map<String, String> countMap) {
547 return BgpCounters.parseIpBgpVpnAllSummary(countMap,
548 BGP_VPNV4_SUMMARY_FILE,
552 static Map<String, String> parseIpBgpVpnv6AllSummary(Map<String, String> countMap) {
553 return BgpCounters.parseIpBgpVpnAllSummary(countMap,
554 BGP_VPNV6_SUMMARY_FILE,
558 static Map<String, String> parseBgpL2vpnEvpnAllSummary(Map<String, String> countMap) {
559 return BgpCounters.parseIpBgpVpnAllSummary(countMap,
560 BGP_EVPN_SUMMARY_FILE,
565 * This method updates Counter values.
566 * @param counter object of the Counter
567 * @param counterValue value of Counter
569 private void updateCounter(Counter counter, long counterValue) {
571 /*Reset counter to zero*/
572 counter.decrement(counter.get());
573 /*Set counter to specified value*/
574 counter.increment(counterValue);
575 } catch (IllegalStateException e) {
576 LOG.error("Exception occured during updating the Counter {}", counter, e);
581 * Returns the counter.
582 * This method returns counter and also creates counter if does not exist.
584 * @param counterName name of the counter.
585 * @param asValue as value.
586 * @param rxValue rx value.
587 * @param txValue tx value.
588 * @param neighborIp neighbor Ipaddress.
589 * @param rdValue rd value.
590 * @return counter object.
592 private Counter getCounter(String counterName, String asValue,
593 String rxValue, String txValue, String neighborIp, String rdValue, String peerType) {
594 String counterTypeEntityCounter = "entitycounter";
595 String labelKeyEntityType = "entitytype";
597 String labelValEntityTypeBgpPeer = null;
598 String labelKeyAsId = "asid";
599 String labelKeyNeighborIp = "neighborip";
601 String labelValEntityTypeBgpRd = "bgp-rd";
602 String labelKeyRd = "rd";
604 String counterTypeAggregateCounter = "aggregatecounter";
605 String labelKeyCounterName = "name";
607 Counter counter = null;
609 if (peerType.equals("bgp-peer")) {
610 labelValEntityTypeBgpPeer = "bgp-peer";
611 } else if (peerType.equals("bfd-peer")) {
612 labelValEntityTypeBgpPeer = "bfd-peer";
614 //nothing defined, default to "bgp-peer"
615 labelValEntityTypeBgpPeer = "bgp-peer";
618 if (rxValue != null) {
620 * Following is the key pattern for Counter BgpNeighborPacketsReceived
621 * netvirt.bgpmanager.entitycounter{entitytype=bgp-peer, asid=value, neighborip=value, name=countername}
623 Labeled<Labeled<Labeled<Labeled<Counter>>>> labeledCounter =
624 metricProvider.newCounter(MetricDescriptor.builder().anchor(this).project("netvirt")
625 .module("bgpmanager").id(counterTypeEntityCounter).build(),
626 labelKeyEntityType, labelKeyAsId,
627 labelKeyNeighborIp, labelKeyCounterName);
628 counter = labeledCounter.label(labelValEntityTypeBgpPeer).label(asValue)
629 .label(neighborIp).label(counterName);
630 } else if (txValue != null) {
632 * Following is the key pattern for Counter BgpNeighborPacketsSent
633 * netvirt.bgpmanager.entitycounter{entitytype=bgp-peer, asid=value, neighborip=value, name=countername}
635 Labeled<Labeled<Labeled<Labeled<Counter>>>> labeledCounter =
636 metricProvider.newCounter(MetricDescriptor.builder().anchor(this).project("netvirt")
637 .module("bgpmanager").id(counterTypeEntityCounter).build(),
638 labelKeyEntityType, labelKeyAsId,
639 labelKeyNeighborIp, labelKeyCounterName);
640 counter = labeledCounter.label(labelValEntityTypeBgpPeer).label(asValue)
641 .label(neighborIp).label(counterName);
642 } else if (rdValue != null) {
644 * Following is the key pattern for Counter BgpRdRouteCount
645 * netvirt.bgpmanager.entitycounter{entitytype=bgp-rd, rd=value, name=countername}
647 Labeled<Labeled<Labeled<Counter>>> labeledCounter =
648 metricProvider.newCounter(MetricDescriptor.builder().anchor(this).project("netvirt")
649 .module("bgpmanager").id(counterTypeEntityCounter).build(),
650 labelKeyEntityType, labelKeyRd,
651 labelKeyCounterName);
652 counter = labeledCounter.label(labelValEntityTypeBgpRd).label(rdValue)
656 * Following is the key pattern for Counter BgpTotalPrefixes:Bgp_Total_Prefixes
657 * netvirt.bgpmanager.aggregatecounter{name=countername}
659 Labeled<Counter> labeledCounter =
660 metricProvider.newCounter(MetricDescriptor.builder().anchor(this).project("netvirt")
661 .module("bgpmanager").id(counterTypeAggregateCounter).build(),
662 labelKeyCounterName);
663 counter = labeledCounter.label(counterName);
668 public void clearBfdNbrCounters(String neighborIPstr) {
669 Counter bfdRxCounter = getCounter(BgpConstants.BFD_COUNTER_NBR_PKTS_RX, null,
670 Long.toString(0), null, neighborIPstr, null, "bfd-peer");
671 updateCounter(bfdRxCounter, 0);
673 Counter bfdTxCounter = getCounter(BgpConstants.BFD_COUNTER_NBR_PKTS_TX, null,
674 null, Long.toString(0), neighborIPstr, null, "bfd-peer");
675 updateCounter(bfdTxCounter, 0);