5
5
exit 0
6
6
fi
7
7
8
+ # # @fn gobgp_toml_config()
9
+ # # @brief returns a minimum GoBGP config (in TOML format) for a BGP server
10
+ function gobgp_toml_config() {
11
+ local local_asn=$1
12
+ local remote_asn=$2
13
+ local local_router_ip=$3
14
+ local remote_router_ip=$4
15
+
16
+ local BGP_CONF=
17
+
18
+ read -r -d ' ' BGP_CONF << - BGP_CONF_MARKER
19
+ [global.config]
20
+ as = "$local_asn "
21
+ router-id = "$local_router_ip "
22
+ [[neighbors]]
23
+ [neighbors.config]
24
+ neighbor-address = "$remote_router_ip "
25
+ peer-as = "$remote_asn "
26
+ [[neighbors.afi-safis]]
27
+ [neighbors.afi-safis.config]
28
+ afi-safi-name = "l2vpn-evpn"
29
+ BGP_CONF_MARKER
30
+
31
+ echo " $BGP_CONF "
32
+ }
33
+
8
34
# # @fn frr_bgp_config()
9
35
# # @brief returns minimum FRR config for BGP server
10
36
function frr_bgp_config() {
@@ -17,7 +43,7 @@ function frr_bgp_config() {
17
43
adv_ip=" 10.0.0.100/32"
18
44
fi
19
45
20
- local BGP_CONF=
46
+ local BGP_CONF=
21
47
22
48
read -r -d ' ' BGP_CONF << - BGP_CONF_MARKER
23
49
log syslog informational
@@ -35,7 +61,23 @@ read -r -d '' BGP_CONF <<- BGP_CONF_MARKER
35
61
!
36
62
BGP_CONF_MARKER
37
63
64
+ }
38
65
66
+ # # @fn run_gobgpd
67
+ # # @brief runs gobgpd daemon on the specified machine
68
+ function run_gobgpd() {
69
+ local local_asn=$1 # where GoBGP is installed
70
+ local remote_asn=$2
71
+ local local_router_ip=$3 # where GoBGP is installed
72
+ local remote_router_ip=$4
73
+ gobgp_toml_config $local_asn $remote_asn \
74
+ $local_router_ip $remote_router_ip > ./gobgpd.toml.conf
75
+
76
+ ssh root@$local_router_ip " pkill gobgpd"
77
+ ssh root@$local_router_ip " mkdir -p /etc/gobgp.d"
78
+ ssh root@$local_router_ip " rm -rf /etc/gobgp.d/gobgpd.toml.conf"
79
+ scp ./gobgpd.toml.conf root@$local_router_ip :/etc/gobgp.d/gobgpd.toml.conf
80
+ ssh root@$local_router_ip " gobgpd -f /etc/gobgp.d/gobgpd.toml.conf" &
39
81
}
40
82
41
83
# # @fn clean_results()
@@ -434,7 +476,7 @@ function aggregate_over_list() {
434
476
}
435
477
436
478
# # @fn query_task_stats
437
- # # @brief gather task stats for a given OpenSDN module
479
+ # # @brief Gathers task stats for a given OpenSDN module
438
480
function query_task_stats() {
439
481
local module_ip=$1
440
482
local module_port=$2
@@ -482,7 +524,7 @@ function query_task_stats() {
482
524
t_task_state.xml \
483
525
" //task_group_list/list/SandeshTaskGroup[$i_task ]/task_entry_list/list" \
484
526
" SandeshTaskEntry" \
485
- " tasks_completed " `
527
+ " total_tasks_completed " `
486
528
487
529
tasks_running=` \
488
530
aggregate_over_list \
@@ -516,3 +558,6 @@ export AUXILIARY_FUNCTIONS=
516
558
# END-OF-FILE
517
559
#
518
560
561
+
562
+
563
+
0 commit comments