Skip to content
Snippets Groups Projects
Commit 558750cf authored by Oliver Herms's avatar Oliver Herms
Browse files

Cleanup

parent 3f9efae9
No related branches found
No related tags found
No related merge requests found
......@@ -114,11 +114,7 @@ func decodeNotificationMsg(buf *bytes.Buffer) (*BGPNotification, error) {
return invalidErrCode(msg)
}
case Cease:
<<<<<<< HEAD
if !(msg.ErrorSubcode == 0 || msg.ErrorSubcode == AdministrativeShutdown || msg.ErrorSubcode == AdministrativeReset) {
=======
if msg.ErrorSubcode == 0 || msg.ErrorSubcode > 8 {
>>>>>>> 453a853eeb0507c5e83706d9e3f251adba5b2484
return invalidErrCode(msg)
}
default:
......
This diff is collapsed.
......@@ -8,7 +8,6 @@ import (
"github.com/bio-routing/bio-rd/protocols/bgp/packet"
"github.com/bio-routing/bio-rd/routingtable"
"github.com/bio-routing/bio-rd/routingtable/locRIB"
log "github.com/sirupsen/logrus"
)
......@@ -63,7 +62,7 @@ type FSM2 struct {
ribsInitialized bool
adjRIBIn routingtable.RouteTableClient
adjRIBOut routingtable.RouteTableClient
rib *locRIB.LocRIB
rib routingtable.RouteTableClient
updateSender routingtable.RouteTableClient
neighborID uint32
......
......@@ -9,9 +9,6 @@ import (
"github.com/bio-routing/bio-rd/protocols/bgp/packet"
"github.com/bio-routing/bio-rd/routingtable"
"github.com/bio-routing/bio-rd/routingtable/filter"
"github.com/bio-routing/bio-rd/routingtable/locRIB"
"time"
)
type Peer struct {
......@@ -21,7 +18,7 @@ type Peer struct {
localASN uint32
fsms []*FSM2
fsmsMu sync.Mutex
rib *locRIB.LocRIB
rib routingtable.RouteTableClient
routerID uint32
addPathSend routingtable.ClientOptions
addPathRecv bool
......@@ -85,7 +82,7 @@ func isEstablishedState(s state) bool {
// NewPeer creates a new peer with the given config. If an connection is established, the adjRIBIN of the peer is connected
// to the given rib. To actually connect the peer, call Start() on the returned peer.
func NewPeer(c config.Peer, rib *locRIB.LocRIB, server *BGPServer) (*Peer, error) {
func NewPeer(c config.Peer, rib routingtable.RouteTableClient, server *BGPServer) (*Peer, error) {
p := &Peer{
server: server,
addr: c.PeerAddress,
......
......@@ -15,32 +15,20 @@ import (
// UpdateSender converts table changes into BGP update messages
type UpdateSender struct {
routingtable.ClientManager
<<<<<<< HEAD
fsm *FSM2
iBGP bool
=======
fsm *FSM2
>>>>>>> 453a853eeb0507c5e83706d9e3f251adba5b2484
}
func newUpdateSender(fsm *FSM2) *UpdateSender {
return &UpdateSender{
fsm: fsm,
iBGP: fsm.peer.localASN == fsm.peer.asn,
iBGP: fsm.peer.localASN == fsm.peer.peerASN,
}
}
// AddPath serializes a new path and sends out a BGP update message
func (u *UpdateSender) AddPath(pfx net.Prefix, p *route.Path) error {
<<<<<<< HEAD
<<<<<<< HEAD
pathAttrs, err := pathAttribues(p, u.fsm)
=======
asPathPA, err := packet.ParseASPathStr(fmt.Sprintf("%d %s", u.fsm.peer.localASN, p.BGPPath.ASPath))
>>>>>>> Replaced FSM
=======
asPathPA, err := packet.ParseASPathStr(fmt.Sprintf("%d %s", u.fsm.peer.localASN, p.BGPPath.ASPath))
>>>>>>> 453a853eeb0507c5e83706d9e3f251adba5b2484
if err != nil {
log.Errorf("Unable to create BGP Update: %v", err)
return nil
......
......@@ -19,7 +19,7 @@ type UpdateSenderAddPath struct {
func newUpdateSenderAddPath(fsm *FSM2) *UpdateSenderAddPath {
return &UpdateSenderAddPath{
fsm: fsm,
iBGP: fsm.peer.localASN == fsm.peer.asn,
iBGP: fsm.peer.localASN == fsm.peer.peerASN,
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment