From 7dd0c7ae20be47125ff72c9789dc9e0c0e0df445 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Mon, 26 Apr 2004 01:43:14 +0000 Subject: announce multiprotocol capabilities - IPv4 multicast for now this implies ourgoing capabilities annoucnement is there and just needs the values to be filled in for other shitz we'll support soonish --- usr.sbin/bgpd/session.c | 18 ++++++++++++++++-- usr.sbin/bgpd/session.h | 8 +++++++- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index c636d2073ec..e8c65192ff6 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.150 2004/04/25 23:36:15 henning Exp $ */ +/* $OpenBSD: session.c,v 1.151 2004/04/26 01:43:13 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -969,9 +969,16 @@ session_open(struct peer *p) u_int16_t len; int errs = 0, n; u_int8_t op_type, op_len = 0, optparamlen = 0; + u_int8_t capa_code, capa_len; + struct capa_mp capa_mp_v4; if (p->capa.announce) { /* multiprotocol extensions, RFC 2858 */ + bzero(&capa_mp_v4, sizeof(capa_mp_v4)); + capa_mp_v4.afi = AFI_IPv4; + capa_mp_v4.safi = SAFI_UNICAST; + op_len += 6; /* 1 code + 1 len + 4 data */ + /* route refresh, RFC 2918 */ if (op_len > 0) @@ -1010,7 +1017,14 @@ session_open(struct peer *p) errs += buf_add(buf, &op_type, sizeof(op_type)); errs += buf_add(buf, &op_len, sizeof(op_len)); - /* multiprotocol extensions, RFC 2858 */ + /* multiprotocol extensions, RFC 2858 */ + capa_code = CAPA_MP; + capa_len = 4; + errs += buf_add(buf, &capa_code, sizeof(capa_code)); + errs += buf_add(buf, &capa_len, sizeof(capa_len)); + errs += buf_add(buf, &capa_mp_v4.afi, sizeof(capa_mp_v4.afi)); + errs += buf_add(buf, &capa_mp_v4.pad, sizeof(capa_mp_v4.pad)); + errs += buf_add(buf, &capa_mp_v4.safi, sizeof(capa_mp_v4.safi)); /* route refresh, RFC 2918 */ } diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index d464373baaf..03dd6d52976 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.43 2004/04/25 17:34:39 claudio Exp $ */ +/* $OpenBSD: session.h,v 1.44 2004/04/26 01:43:13 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -115,6 +115,12 @@ struct msg_open { u_int8_t optparamlen; }; +struct capa_mp { + u_int16_t afi; + u_int8_t pad; + u_int8_t safi; +}; + struct ctl_conn { TAILQ_ENTRY(ctl_conn) entries; struct imsgbuf ibuf; -- cgit v1.2.3