summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2008-11-01 12:55:43 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2008-11-01 12:55:43 +0100
commita92fe607173b52cf28256f00399953c623788c35 (patch)
tree1cac35e1b4ea904b0c1e39409f20967bf582a924 /proto
parente16466b379be2b94c84b351a69e63b6de5be9dc5 (diff)
downloadbird-a92fe607173b52cf28256f00399953c623788c35.tar
bird-a92fe607173b52cf28256f00399953c623788c35.zip
Implementation of route server.
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/attrs.c2
-rw-r--r--proto/bgp/bgp.c4
-rw-r--r--proto/bgp/bgp.h2
-rw-r--r--proto/bgp/config.Y3
4 files changed, 9 insertions, 2 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 2210cbe..811d52e 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -828,7 +828,7 @@ bgp_update_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p
{
eattr *a;
- if (!p->is_internal)
+ if (!p->is_internal && !p->rs_client)
{
bgp_path_prepend(e, attrs, pool, p->local_as);
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 0d580be..a34545b 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -492,6 +492,8 @@ bgp_start_locked(struct object_lock *lock)
p->rr_client = cf->rr_client;
}
+ p->rs_client = cf->rs_client;
+
if (!p->neigh)
{
log(L_ERR "%s: Invalid next hop %I", p->p.name, p->next_hop);
@@ -644,6 +646,8 @@ bgp_check(struct bgp_config *c)
cf_error("Neighbor AS number out of range");
if ((c->local_as != c->remote_as) && (c->rr_client))
cf_error("Only internal neighbor can be RR client");
+ if ((c->local_as == c->remote_as) && (c->rs_client))
+ cf_error("Only external neighbor can be RS client");
}
static void
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index 1d67e33..ea64584 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -28,6 +28,7 @@ struct bgp_config {
int enable_as4; /* Enable local support for 4B AS numbers [RFC4893] */
u32 rr_cluster_id; /* Route reflector cluster ID, if different from local ID */
int rr_client; /* Whether neighbor is RR client of me */
+ int rs_client; /* Whether neighbor is RS client of me */
unsigned connect_retry_time;
unsigned hold_time, initial_hold_time;
unsigned keepalive_time;
@@ -66,6 +67,7 @@ struct bgp_proto {
u32 remote_id; /* BGP identifier of the neighbor */
u32 rr_cluster_id; /* Route reflector cluster ID */
int rr_client; /* Whether neighbor is RR client of me */
+ int rs_client; /* Whether neighbor is RS client of me */
struct bgp_conn *conn; /* Connection we have established */
struct bgp_conn outgoing_conn; /* Outgoing connection we're working with */
struct bgp_conn incoming_conn; /* Incoming connection we have neither accepted nor rejected yet */
diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y
index 8524b2d..73b584f 100644
--- a/proto/bgp/config.Y
+++ b/proto/bgp/config.Y
@@ -21,7 +21,7 @@ CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, HOLD, TIME, CONNECT, RETRY, KEEPALIVE,
ERROR, START, DELAY, FORGET, WAIT, ENABLE, DISABLE, AFTER,
BGP_PATH, BGP_LOCAL_PREF, BGP_MED, BGP_ORIGIN, BGP_NEXT_HOP,
BGP_ATOMIC_AGGR, BGP_AGGREGATOR, BGP_COMMUNITY, SOURCE, ADDRESS,
- PASSWORD, RR, CLIENT, CLUSTER, ID, AS4)
+ PASSWORD, RR, RS, CLIENT, CLUSTER, ID, AS4)
CF_GRAMMAR
@@ -55,6 +55,7 @@ bgp_proto:
}
| bgp_proto RR CLUSTER ID expr ';' { BGP_CFG->rr_cluster_id = $5; }
| bgp_proto RR CLIENT ';' { BGP_CFG->rr_client = 1; }
+ | bgp_proto RS CLIENT ';' { BGP_CFG->rs_client = 1; }
| bgp_proto HOLD TIME expr ';' { BGP_CFG->hold_time = $4; }
| bgp_proto STARTUP HOLD TIME expr ';' { BGP_CFG->initial_hold_time = $5; }
| bgp_proto CONNECT RETRY TIME expr ';' { BGP_CFG->connect_retry_time = $5; }