• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/zebra/bgpd/

Lines Matching refs:peer

579 bgp_attr_origin (struct peer *peer, bgp_size_t length, 
594 zlog (peer->log, LOG_ERR,
596 bgp_notify_send_with_data (peer,
610 zlog (peer->log, LOG_ERR, "Origin attribute length is not one %d",
612 bgp_notify_send_with_data (peer, BGP_NOTIFY_UPDATE_ERR,
619 attr->origin = stream_getc (BGP_INPUT (peer));
628 zlog (peer->log, LOG_ERR, "Origin attribute value is invalid %d",
631 bgp_notify_send_with_data (peer,
647 bgp_attr_aspath (struct peer *peer, bgp_size_t length,
660 zlog (peer->log, LOG_ERR,
662 bgp_notify_send_with_data (peer,
670 attr->aspath = aspath_parse (stream_pnt (peer->ibuf), length);
673 zlog (peer->log, LOG_ERR, "Malformed AS path length is %d", length);
674 bgp_notify_send (peer,
680 bgp = peer->bgp;
685 if (peer_sort (peer) == BGP_PEER_EBGP
686 && ! aspath_firstas_check (attr->aspath, peer->as))
688 zlog (peer->log, LOG_ERR,
689 "%s incorrect first AS (must be %d)", peer->host, peer->as);
690 bgp_notify_send (peer,
698 if (peer->change_local_as &&
699 ! CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND))
702 aspath = aspath_add_seq (aspath, peer->change_local_as);
708 stream_forward (peer->ibuf, length);
718 bgp_attr_nexthop (struct peer *peer, bgp_size_t length,
729 zlog (peer->log, LOG_ERR,
731 bgp_notify_send_with_data (peer,
741 zlog (peer->log, LOG_ERR, "Nexthop attribute length isn't four [%d]",
744 bgp_notify_send_with_data (peer,
751 attr->nexthop.s_addr = stream_get_ipv4 (peer->ibuf);
759 bgp_attr_med (struct peer *peer, bgp_size_t length,
769 zlog (peer->log, LOG_ERR,
772 bgp_notify_send_with_data (peer,
779 attr->med = stream_getl (peer->ibuf);
788 bgp_attr_local_pref (struct peer *peer, bgp_size_t length,
792 external peer, then this attribute MUST be ignored by the
794 if (peer_sort (peer) == BGP_PEER_EBGP)
796 stream_forward (peer->ibuf, length);
801 attr->local_pref = stream_getl (peer->ibuf);
813 bgp_attr_atomic (struct peer *peer, bgp_size_t length,
818 zlog (peer->log, LOG_ERR, "Bad atomic aggregate length %d", length);
820 bgp_notify_send (peer,
834 bgp_attr_aggregator (struct peer *peer, bgp_size_t length,
839 zlog (peer->log, LOG_ERR, "Aggregator length is not 6 [%d]", length);
841 bgp_notify_send (peer,
846 attr->aggregator_as = stream_getw (peer->ibuf);
847 attr->aggregator_addr.s_addr = stream_get_ipv4 (peer->ibuf);
857 bgp_attr_community (struct peer *peer, bgp_size_t length,
864 attr->community = community_parse (stream_pnt (peer->ibuf), length);
865 stream_forward (peer->ibuf, length);
875 bgp_attr_originator_id (struct peer *peer, bgp_size_t length,
880 zlog (peer->log, LOG_ERR, "Bad originator ID length %d", length);
882 bgp_notify_send (peer,
888 attr->originator_id.s_addr = stream_get_ipv4 (peer->ibuf);
897 bgp_attr_cluster_list (struct peer *peer, bgp_size_t length,
903 zlog (peer->log, LOG_ERR, "Bad cluster list length %d", length);
905 bgp_notify_send (peer,
911 attr->cluster = cluster_parse (stream_pnt (peer->ibuf), length);
913 stream_forward (peer->ibuf, length);;
922 bgp_mp_reach_parse (struct peer *peer, bgp_size_t length, struct attr *attr,
935 s = peer->ibuf;
974 zlog_warn ("%s got two nexthop %s %s but second one is not a link-local nexthop", peer->host,
999 /* If peer is based on old draft-00. I read NLRI length from the
1001 if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
1011 ret = bgp_nlri_sanity_check (peer, afi, stream_pnt (s), nlri_len);
1028 bgp_mp_unreach_parse (struct peer *peer, int length,
1038 s = peer->ibuf;
1048 ret = bgp_nlri_sanity_check (peer, afi, stream_pnt (s), withdraw_len);
1065 bgp_attr_ext_communities (struct peer *peer, bgp_size_t length,
1072 attr->ecommunity = ecommunity_parse (stream_pnt (peer->ibuf), length);
1073 stream_forward (peer->ibuf, length);
1082 bgp_attr_unknown (struct peer *peer, struct attr *attr, u_char flag,
1089 zlog (peer->log, LOG_INFO,
1093 stream_forward (peer->ibuf, length);
1105 bgp_notify_send_with_data (peer,
1147 bgp_attr_parse (struct peer *peer, struct attr *attr, bgp_size_t size,
1162 endp = BGP_INPUT_PNT (peer) + size;
1165 while (BGP_INPUT_PNT (peer) < endp)
1168 if (endp - BGP_INPUT_PNT (peer) < BGP_ATTR_MIN_LEN)
1170 zlog (peer->log, LOG_WARNING,
1172 peer->host, endp - STREAM_PNT (BGP_INPUT (peer)));
1174 bgp_notify_send (peer,
1181 startp = BGP_INPUT_PNT (peer);
1182 flag = stream_getc (BGP_INPUT (peer));
1183 type = stream_getc (BGP_INPUT (peer));
1187 length = stream_getw (BGP_INPUT (peer));
1189 length = stream_getc (BGP_INPUT (peer));
1197 zlog (peer->log, LOG_WARNING,
1199 peer->host, type);
1201 bgp_notify_send (peer,
1213 attr_endp = BGP_INPUT_PNT (peer) + length;
1217 zlog (peer->log, LOG_WARNING,
1218 "%s BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p", peer->host, type, length, size, attr_endp, endp);
1219 bgp_notify_send (peer,
1229 ret = bgp_attr_origin (peer, length, attr, flag, startp);
1232 ret = bgp_attr_aspath (peer, length, attr, flag, startp);
1235 ret = bgp_attr_nexthop (peer, length, attr, flag, startp);
1238 ret = bgp_attr_med (peer, length, attr, flag, startp);
1241 ret = bgp_attr_local_pref (peer, length, attr, flag);
1244 ret = bgp_attr_atomic (peer, length, attr, flag);
1247 ret = bgp_attr_aggregator (peer, length, attr, flag);
1250 ret = bgp_attr_community (peer, length, attr, flag);
1253 ret = bgp_attr_originator_id (peer, length, attr, flag);
1256 ret = bgp_attr_cluster_list (peer, length, attr, flag);
1259 ret = bgp_mp_reach_parse (peer, length, attr, mp_update);
1262 ret = bgp_mp_unreach_parse (peer, length, mp_withdraw);
1265 ret = bgp_attr_ext_communities (peer, length, attr, flag);
1268 ret = bgp_attr_unknown (peer, attr, flag, type, length, startp);
1277 if (BGP_INPUT_PNT (peer) != attr_endp)
1279 zlog (peer->log, LOG_WARNING,
1280 "%s BGP attribute fetch error", peer->host);
1281 bgp_notify_send (peer,
1289 if (BGP_INPUT_PNT (peer) != endp)
1291 zlog (peer->log, LOG_WARNING,
1292 "%s BGP attribute length mismatch", peer->host);
1293 bgp_notify_send (peer,
1308 bgp_attr_check (struct peer *peer, struct attr *attr)
1321 if (peer_sort (peer) == BGP_PEER_IBGP
1327 zlog (peer->log, LOG_WARNING,
1329 peer->host, type);
1330 bgp_notify_send_with_data (peer,
1344 bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
1346 afi_t afi, safi_t safi, struct peer *from,
1366 /* If remote-peer is EBGP */
1367 if (peer_sort (peer) == BGP_PEER_EBGP
1368 && (! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED)
1371 && CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)))
1384 aspath = aspath_add_seq (aspath, peer->local_as);
1385 if (peer->change_local_as)
1386 aspath = aspath_add_seq (aspath, peer->change_local_as);
1389 else if (peer_sort (peer) == BGP_PEER_CONFED)
1393 aspath = aspath_add_confed_seq (aspath, peer->local_as);
1425 stream_put_ipv4 (s, peer->nexthop.v4.s_addr);
1443 if (peer_sort (peer) == BGP_PEER_IBGP ||
1444 peer_sort (peer) == BGP_PEER_CONFED)
1471 if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
1490 if (peer_sort (peer) == BGP_PEER_IBGP
1516 /* If this peer configuration's parent BGP has cluster_id. */
1526 /* If this peer configuration's parent BGP has cluster_id. */
1562 if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
1575 if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
1599 if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
1612 if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
1637 if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
1653 if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
1658 if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
1685 bgp_packet_withdraw (struct peer *peer, struct stream *s, struct prefix *p,