diff options
author | Mark Stapp <mjs@voltanet.io> | 2020-10-22 19:41:51 +0200 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2020-10-22 19:41:51 +0200 |
commit | d0b0a2c545c2960df768e86a0bdb2e78610efc86 (patch) | |
tree | 87e008b796abfaa6284d96d9ad87c5cd5be54a92 /ospfclient | |
parent | zebra: replace inet_ntoa (diff) | |
download | frr-d0b0a2c545c2960df768e86a0bdb2e78610efc86.tar.xz frr-d0b0a2c545c2960df768e86a0bdb2e78610efc86.zip |
ospfclient: replace inet_ntoa
Replace all use of inet_ntoa; use pI4 (and printfrr).
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'ospfclient')
-rw-r--r-- | ospfclient/ospfclient.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/ospfclient/ospfclient.c b/ospfclient/ospfclient.c index f5f994517..3ca1e132b 100644 --- a/ospfclient/ospfclient.c +++ b/ospfclient/ospfclient.c @@ -30,6 +30,7 @@ #include "prefix.h" /* needed by ospf_asbr.h */ #include "privs.h" #include "log.h" +#include "lib/printfrr.h" /* work around gcc bug 69981, disable MTYPEs in libospf */ #define _QUAGGA_OSPF_MEMORY_H @@ -186,8 +187,8 @@ static void lsa_update_callback(struct in_addr ifaddr, struct in_addr area_id, struct lsa_header *lsa) { printf("lsa_update_callback: "); - printf("ifaddr: %s ", inet_ntoa(ifaddr)); - printf("area: %s\n", inet_ntoa(area_id)); + printfrr("ifaddr: %pI4 ", &ifaddr); + printfrr("area: %pI4\n", &area_id); printf("is_self_origin: %u\n", is_self_originated); /* It is important to note that lsa_header does indeed include the @@ -211,8 +212,8 @@ static void lsa_delete_callback(struct in_addr ifaddr, struct in_addr area_id, struct lsa_header *lsa) { printf("lsa_delete_callback: "); - printf("ifaddr: %s ", inet_ntoa(ifaddr)); - printf("area: %s\n", inet_ntoa(area_id)); + printf("ifaddr: %pI4 ", &ifaddr); + printf("area: %pI4\n", &area_id); printf("is_self_origin: %u\n", is_self_originated); ospf_lsa_header_dump(lsa); @@ -221,8 +222,8 @@ static void lsa_delete_callback(struct in_addr ifaddr, struct in_addr area_id, static void ready_callback(uint8_t lsa_type, uint8_t opaque_type, struct in_addr addr) { - printf("ready_callback: lsa_type: %d opaque_type: %d addr=%s\n", - lsa_type, opaque_type, inet_ntoa(addr)); + printfrr("ready_callback: lsa_type: %d opaque_type: %d addr=%pI4\n", + lsa_type, opaque_type, &addr); /* Schedule opaque LSA originate in 5 secs */ thread_add_timer(master, lsa_inject, oclient, 5, NULL); @@ -236,20 +237,20 @@ static void ready_callback(uint8_t lsa_type, uint8_t opaque_type, static void new_if_callback(struct in_addr ifaddr, struct in_addr area_id) { - printf("new_if_callback: ifaddr: %s ", inet_ntoa(ifaddr)); - printf("area_id: %s\n", inet_ntoa(area_id)); + printfrr("new_if_callback: ifaddr: %pI4 ", &ifaddr); + printfrr("area_id: %pI4\n", &area_id); } static void del_if_callback(struct in_addr ifaddr) { - printf("new_if_callback: ifaddr: %s\n ", inet_ntoa(ifaddr)); + printfrr("new_if_callback: ifaddr: %pI4\n ", &ifaddr); } static void ism_change_callback(struct in_addr ifaddr, struct in_addr area_id, uint8_t state) { - printf("ism_change: ifaddr: %s ", inet_ntoa(ifaddr)); - printf("area_id: %s\n", inet_ntoa(area_id)); + printfrr("ism_change: ifaddr: %pI4 ", &ifaddr); + printfrr("area_id: %pI4\n", &area_id); printf("state: %d [%s]\n", state, lookup_msg(ospf_ism_state_msg, state, NULL)); } @@ -257,9 +258,9 @@ static void ism_change_callback(struct in_addr ifaddr, struct in_addr area_id, static void nsm_change_callback(struct in_addr ifaddr, struct in_addr nbraddr, struct in_addr router_id, uint8_t state) { - printf("nsm_change: ifaddr: %s ", inet_ntoa(ifaddr)); - printf("nbraddr: %s\n", inet_ntoa(nbraddr)); - printf("router_id: %s\n", inet_ntoa(router_id)); + printfrr("nsm_change: ifaddr: %pI4 ", &ifaddr); + printfrr("nbraddr: %pI4\n", &nbraddr); + printfrr("router_id: %pI4\n", &router_id); printf("state: %d [%s]\n", state, lookup_msg(ospf_nsm_state_msg, state, NULL)); } |