]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: create a single registry of daemons' default port values 15276/head
authorMark Stapp <mjs@labn.net>
Thu, 1 Feb 2024 16:40:02 +0000 (11:40 -0500)
committerMark Stapp <mjs@labn.net>
Thu, 1 Feb 2024 16:40:02 +0000 (11:40 -0500)
Create a single registry of default port values that daemons
are using. Most of these are vty ports, but there are some
others for features like ospfapi and zebra FPM.

Signed-off-by: Mark Stapp <mjs@labn.net>
25 files changed:
babeld/babeld.h
bfdd/bfdd.c
bgpd/bgpd.h
eigrpd/eigrp_const.h
fpm/fpm.h
isisd/isis_main.c
ldpd/ldpd.c
lib/libfrr.c
lib/libfrr.h
lib/zebra.h
mgmtd/mgmt.h
nhrpd/nhrpd.h
ospf6d/ospf6_main.c
ospfd/ospf_api.h
ospfd/ospfd.h
pathd/path_main.c
pbrd/pbr_main.c
pimd/pimd.h
ripd/ripd.h
ripngd/ripngd.h
sharpd/sharp_main.c
staticd/static_main.c
vrrpd/vrrp_main.c
zebra/dplane_fpm_nl.c
zebra/zserv.h

index 619550f651f7579669240e85f8fb324ccb206866..5573719ab3ef548ab5db22a358f587afcfcc8d6b 100644 (file)
@@ -53,7 +53,6 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
 #endif
 
 
-#define BABEL_VTY_PORT 2609
 #define BABEL_DEFAULT_CONFIG "babeld.conf"
 
 /* Values in milliseconds */
index 1a89b9b351510f3d94667028d6e538cb98700434..243cf5c12903abc1aced390377d354b2d5d5a004 100644 (file)
@@ -119,7 +119,7 @@ static const struct frr_yang_module_info *const bfdd_yang_modules[] = {
 
 /* clang-format off */
 FRR_DAEMON_INFO(bfdd, BFD,
-       .vty_port = 2617,
+       .vty_port = BFDD_VTY_PORT,
        .proghelp = "Implementation of the BFD protocol.",
 
        .signals = bfd_signals,
index a1593421beb6238af783f903469fcddc889f65c5..d4dd67b850c195dbb74bbc934005bf1c8e959073 100644 (file)
@@ -2064,7 +2064,6 @@ struct bgp_nlri {
 #define BGP_UPTIME_LEN 25
 
 /* Default configuration settings for bgpd.  */
-#define BGP_VTY_PORT                          2605
 #define BGP_DEFAULT_CONFIG             "bgpd.conf"
 
 /* BGP Dynamic Neighbors feature */
index 607719d4f136d08a623aa56cd5a5e8a8d698f0eb..05fbae32af5516324d6e4f8df878150372f13c81 100644 (file)
@@ -61,9 +61,6 @@
 /* IP TTL for EIGRP protocol. */
 #define EIGRP_IP_TTL             1
 
-/* VTY port number. */
-#define EIGRP_VTY_PORT          2613
-
 /* Default configuration file name for eigrp. */
 #define EIGRP_DEFAULT_CONFIG   "eigrpd.conf"
 
index b08310f675be46fb12be919121e77cd9d2539e0c..70c0df57157e2e1522051403f5fb3175e994927e 100644 (file)
--- a/fpm/fpm.h
+++ b/fpm/fpm.h
  */
 #define FPM_DEFAULT_IP              (htonl (INADDR_LOOPBACK))
 
-/*
- * default port for fpm connections
- */
-#define FPM_DEFAULT_PORT 2620
-
 /*
  * Largest message that can be sent to or received from the FPM.
  */
index 47e5f6dc933abbcb763d7973c877ef6e26ab0c28..60ec8cdad480994fa5ba0ff72f895beaeec0b62d 100644 (file)
@@ -51,9 +51,6 @@
 
 /* Default configuration file name */
 #define ISISD_DEFAULT_CONFIG "isisd.conf"
-/* Default vty port */
-#define ISISD_VTY_PORT       2608
-#define FABRICD_VTY_PORT     2618
 
 #define FABRICD_STATE_NAME "%s/fabricd.json", frr_libstatedir
 #define ISISD_STATE_NAME   "%s/isisd.json", frr_libstatedir
index 0d66fc70e785cec13c50563da5960b01ea99e24b..da29a4f20ddf05cc23244f3b4099da61084af568 100644 (file)
@@ -104,7 +104,6 @@ void ldp_agentx_enabled(void)
 enum ldpd_process ldpd_process;
 
 #define LDP_DEFAULT_CONFIG     "ldpd.conf"
-#define LDP_VTY_PORT           2612
 
 /* Master of threads. */
 struct event_loop *master;
index d904f6f8bb0478b28cba67f6b44906318949a419..9e472054dd5ae9b18c0e505c356b492f83b7c8a3 100644 (file)
@@ -208,7 +208,7 @@ bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len,
        if (!strncmp(path, ZAPI_TCP_PATHNAME, strlen(ZAPI_TCP_PATHNAME))) {
                /* note: this functionality is disabled at bottom */
                int af;
-               int port = ZEBRA_PORT;
+               int port = ZEBRA_TCP_PORT;
                char *err = NULL;
                struct sockaddr_in *sin = NULL;
                struct sockaddr_in6 *sin6 = NULL;
index 27b877da18b13045ab3650fd3ba2059964263197..ee436d9f8f88cc5ae93c975456dd70beb52d3bfe 100644 (file)
@@ -55,6 +55,49 @@ struct log_arg {
 };
 DECLARE_DLIST(log_args, struct log_arg, itm);
 
+/* Registry of daemons' port defaults. Many of these are VTY ports; some
+ * daemons have default ports for other features such as ospfapi, or zebra's
+ * FPM.
+ */
+
+/* default zebra TCP port for zapi; this is currently disabled for security
+ * reasons.
+ */
+#define ZEBRA_TCP_PORT 2600
+
+#define ZEBRA_VTY_PORT 2601
+#define RIP_VTY_PORT 2602
+#define RIPNG_VTY_PORT 2603
+#define OSPF_VTY_PORT 2604
+#define BGP_VTY_PORT 2605
+#define OSPF6_VTY_PORT 2606
+
+/* Default API server port to accept connection request from client-side.
+ * This value could be overridden by "ospfapi" entry in "/etc/services".
+ */
+#define OSPF_API_SYNC_PORT 2607
+
+#define ISISD_VTY_PORT 2608
+#define BABEL_VTY_PORT 2609
+#define NHRP_VTY_PORT 2610
+#define PIMD_VTY_PORT 2611
+#define LDP_VTY_PORT 2612
+#define EIGRP_VTY_PORT 2613
+#define SHARP_VTY_PORT 2614
+#define PBR_VTY_PORT 2615
+#define STATIC_VTY_PORT 2616
+#define BFDD_VTY_PORT 2617
+#define FABRICD_VTY_PORT 2618
+#define VRRP_VTY_PORT 2619
+
+/* default port for FPM connections */
+#define FPM_DEFAULT_PORT 2620
+
+#define PATH_VTY_PORT 2621
+#define PIM6D_VTY_PORT 2622
+#define MGMTD_VTY_PORT 2623
+/* Registry of daemons' port defaults */
+
 enum frr_cli_mode {
        FRR_CLI_CLASSIC = 0,
        FRR_CLI_TRANSACTIONAL,
index 8b0800c25751a6fc0aa0bd05b821b5cbb085f47f..15a54f6cdf618c72cd71294b5f92c5de8c0f04b7 100644 (file)
@@ -221,9 +221,6 @@ struct in_pktinfo {
 #define IN6_ARE_ADDR_EQUAL IN6_IS_ADDR_EQUAL
 #endif /* IN6_ARE_ADDR_EQUAL */
 
-/* default zebra TCP port for zclient */
-#define ZEBRA_PORT                     2600
-
 /* Zebra route's types are defined in route_types.h */
 #include "lib/route_types.h"
 
index d46b1341ec963c110e4f137ecae60cd53a5cb249..665e8d8fd8535661219aacaafb4802d30e32c496 100644 (file)
@@ -20,7 +20,6 @@
 #include "mgmtd/mgmt_txn.h"
 #include "mgmtd/mgmt_ds.h"
 
-#define MGMTD_VTY_PORT 2623
 #define MGMTD_SOCKET_BUF_SIZE 65535
 #define MGMTD_MAX_COMMIT_LIST 10
 
index 50653c784acce3c95a1cf6f94667265c7dad2c20..e389b7489d3618a67d62dcee6e014037c88afa77 100644 (file)
@@ -16,7 +16,6 @@ DECLARE_MGROUP(NHRPD);
 
 #define NHRPD_DEFAULT_HOLDTIME 7200
 
-#define NHRP_VTY_PORT          2610
 #define NHRP_DEFAULT_CONFIG    "nhrpd.conf"
 
 extern struct event_loop *master;
index 6449d6845326961b3a724733db41fb0ad8ff76c4..17966e741e37eef937e84905647d1350fbba80ac 100644 (file)
@@ -46,9 +46,6 @@
  * is excessive for just supporting a legacy compatibility file location
  */
 
-/* Default port values. */
-#define OSPF6_VTY_PORT             2606
-
 /* ospf6d privileges */
 zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_SYS_ADMIN};
 
index 6c8bed3d8fc5181174accfb96d5e01fae31df378..6160a0f1fa03facf3170ab66d16f7a2e72470ced 100644 (file)
 #define MTYPE_OSPF_API_MSG      MTYPE_TMP
 #define MTYPE_OSPF_API_FIFO     MTYPE_TMP
 
-/* Default API server port to accept connection request from client-side. */
-/* This value could be overridden by "ospfapi" entry in "/etc/services". */
-#define OSPF_API_SYNC_PORT      2607
-
 /* -----------------------------------------------------------
  * Generic messages
  * -----------------------------------------------------------
index 2ab7db119e466150707d98f81ea8d176847ea8c1..6051dff7095cae93b26a5089d96b14acb53579e2 100644 (file)
@@ -22,9 +22,6 @@
 
 #define OSPF_VERSION            2
 
-/* VTY port number. */
-#define OSPF_VTY_PORT          2604
-
 /* IP TTL for OSPF protocol. */
 #define OSPF_IP_TTL             1
 #define OSPF_VL_IP_TTL          100
index c3409522e2f41bbaf06130babcdbaf6eedffdba5..fe636c51beef8a90334ff4a53509126c53b2f170 100644 (file)
@@ -95,8 +95,6 @@ static const struct frr_yang_module_info *pathd_yang_modules[] = {
        &frr_pathd_info,
 };
 
-#define PATH_VTY_PORT 2621
-
 /* clang-format off */
 FRR_DAEMON_INFO(pathd, PATH,
        .vty_port = PATH_VTY_PORT,
index 8cddf87a27ea975faa06cccd5540f9281067f716..6695b537a80c4b2c68f6fb5c638f54be38323491 100644 (file)
@@ -103,8 +103,6 @@ struct frr_signal_t pbr_signals[] = {
        },
 };
 
-#define PBR_VTY_PORT 2615
-
 static const struct frr_yang_module_info *const pbrd_yang_modules[] = {
        &frr_filter_info,
        &frr_interface_info,
index 9ec84fc0a685dddedb7d4ac4c57f9dc0b3913328..3d9318953bb7a08aabf944d81f4f83e7dbe632cb 100644 (file)
@@ -19,9 +19,6 @@
 #include "pim_memory.h"
 #include "pim_assert.h"
 
-#define PIMD_VTY_PORT       2611
-#define PIM6D_VTY_PORT      2622
-
 #define PIM_IP_PROTO_IGMP             (2)
 #define PIM_IP_PROTO_PIM              (103)
 #define PIM_IGMP_MIN_LEN              (8)
index b7e79332fed4ff9dece2ef5564634d70c47ffb60..08f7a2442d08d6ca84bb862bca6898896192257f 100644 (file)
@@ -51,7 +51,6 @@
 
 /* RIP port number. */
 #define RIP_PORT_DEFAULT               520
-#define RIP_VTY_PORT                  2602
 
 /* Default configuration file name. */
 #define RIPD_DEFAULT_CONFIG    "ripd.conf"
index b4f7b4e52da7341e18b338a4a82db4527e616686..a316f2b4b5eb7e2a126a407ac33232bd4ab5d216 100644 (file)
@@ -16,7 +16,6 @@
 /* RIPng version and port number. */
 #define RIPNG_V1                         1
 #define RIPNG_PORT_DEFAULT             521
-#define RIPNG_VTY_PORT                2603
 #define RIPNG_MAX_PACKET_SIZE         1500
 #define RIPNG_PRIORITY_DEFAULT           0
 
index 57948388b24a67054c1f8f63fa1f7010f5049e1e..f4ce147978095a9dbe50cdfa3c2832ea77a730f5 100644 (file)
@@ -120,8 +120,6 @@ struct frr_signal_t sharp_signals[] = {
        },
 };
 
-#define SHARP_VTY_PORT 2614
-
 static const struct frr_yang_module_info *const sharpd_yang_modules[] = {
        &frr_filter_info,
        &frr_interface_info,
index 1953701fbb80d27d3a7d3fee8af962aff62fc5c4..2fd174194841e057ba37f6876d83edea5f7d8cec 100644 (file)
@@ -113,8 +113,6 @@ static const struct frr_yang_module_info *const staticd_yang_modules[] = {
        &frr_staticd_info,
 };
 
-#define STATIC_VTY_PORT 2616
-
 /*
  * NOTE: .flags == FRR_NO_SPLIT_CONFIG to avoid reading split config, mgmtd will
  * do this for us now
index 7f859ca6d2958bcb497131de827991eb819abb94..e9af3d92f5d81a01f7def0d8e70ce759dd940234 100644 (file)
@@ -107,8 +107,6 @@ static const struct frr_yang_module_info *const vrrp_yang_modules[] = {
        &frr_vrrpd_info,
 };
 
-#define VRRP_VTY_PORT 2619
-
 /* clang-format off */
 FRR_DAEMON_INFO(vrrpd, VRRP,
        .vty_port = VRRP_VTY_PORT,
index 0931cc788f6649d3bac2bd25f32d150db67949a6..7ae1b2a0901a63efb89dcdb34cc96d38e8d60567 100644 (file)
@@ -45,7 +45,6 @@
 #include "fpm/fpm.h"
 
 #define SOUTHBOUND_DEFAULT_ADDR INADDR_LOOPBACK
-#define SOUTHBOUND_DEFAULT_PORT 2620
 
 /*
  * Time in seconds that if the other end is not responding
@@ -217,7 +216,7 @@ DEFUN(fpm_set_address, fpm_set_address_cmd,
                memset(sin, 0, sizeof(*sin));
                sin->sin_family = AF_INET;
                sin->sin_port =
-                       port ? htons(port) : htons(SOUTHBOUND_DEFAULT_PORT);
+                       port ? htons(port) : htons(FPM_DEFAULT_PORT);
 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
                sin->sin_len = sizeof(*sin);
 #endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
@@ -235,7 +234,7 @@ DEFUN(fpm_set_address, fpm_set_address_cmd,
        sin6 = (struct sockaddr_in6 *)&gfnc->addr;
        memset(sin6, 0, sizeof(*sin6));
        sin6->sin6_family = AF_INET6;
-       sin6->sin6_port = port ? htons(port) : htons(SOUTHBOUND_DEFAULT_PORT);
+       sin6->sin6_port = port ? htons(port) : htons(FPM_DEFAULT_PORT);
 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
        sin6->sin6_len = sizeof(*sin6);
 #endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
@@ -402,7 +401,7 @@ static int fpm_write_config(struct vty *vty)
                written = 1;
                sin = (struct sockaddr_in *)&gfnc->addr;
                vty_out(vty, "fpm address %pI4", &sin->sin_addr);
-               if (sin->sin_port != htons(SOUTHBOUND_DEFAULT_PORT))
+               if (sin->sin_port != htons(FPM_DEFAULT_PORT))
                        vty_out(vty, " port %d", ntohs(sin->sin_port));
 
                vty_out(vty, "\n");
@@ -411,7 +410,7 @@ static int fpm_write_config(struct vty *vty)
                written = 1;
                sin6 = (struct sockaddr_in6 *)&gfnc->addr;
                vty_out(vty, "fpm address %pI6", &sin6->sin6_addr);
-               if (sin6->sin6_port != htons(SOUTHBOUND_DEFAULT_PORT))
+               if (sin6->sin6_port != htons(FPM_DEFAULT_PORT))
                        vty_out(vty, " port %d", ntohs(sin6->sin6_port));
 
                vty_out(vty, "\n");
index 4ab201b5ea15f124cd23378c611adb9c58c15413..e1c990fb05cb6140f5f1966509841f39da333182 100644 (file)
@@ -31,9 +31,6 @@ extern "C" {
 
 struct zebra_vrf;
 
-/* Default port information. */
-#define ZEBRA_VTY_PORT                2601
-
 /* Default configuration filename. */
 #define DEFAULT_CONFIG_FILE "zebra.conf"