Skip to content
Snippets Groups Projects
Unverified Commit ea3b7b59 authored by Daniel Czerwonk's avatar Daniel Czerwonk Committed by GitHub
Browse files

Merge branch 'master' into feature/nlri_refactoring

parents 8f49c1aa dfde7423
No related branches found
No related tags found
No related merge requests found
Showing with 53 additions and 53 deletions
......@@ -59,7 +59,7 @@ func IPFromBytes(b []byte) (IP, error) {
uint16(b[14])<<8+uint16(b[15])), nil
}
return IP{}, fmt.Errorf("byte slice has an invalid legth. Expected either 4 (IPv4) or 16 (IPv6) bytes but got: %d", len(b))
return IP{}, fmt.Errorf("byte slice has an invalid length. Expected either 4 (IPv4) or 16 (IPv6) bytes but got: %d", len(b))
}
// IPFromString returns an IP address for a given string
......
......@@ -48,7 +48,7 @@ const (
// Update Msg Errors
MalformedAttributeList = 1
UnrecognizedWellKnownAttr = 2
MissingWellKnonAttr = 3
MissingWellKnownAttr = 3
AttrFlagsError = 4
AttrLengthError = 5
InvalidOriginAttr = 6
......@@ -90,7 +90,7 @@ const (
ConnectionRejected = 5
OtherConfigChange = 8
ConnectionCollisionResolution = 7
OutOfResoutces = 8
OutOfResources = 8
IPv4AFI = 1
IPv6AFI = 2
......
......@@ -186,7 +186,7 @@ func decodeOptParams(buf *bytes.Buffer, optParmLen uint8) ([]OptParam, error) {
case CapabilitiesParamType:
caps, err := decodeCapabilities(buf, o.Length)
if err != nil {
return nil, fmt.Errorf("Unable to decode capabilites: %v", err)
return nil, fmt.Errorf("Unable to decode capabilities: %v", err)
}
o.Value = caps
......
......@@ -34,11 +34,11 @@ func BenchmarkDecodeUpdateMsg(b *testing.B) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......@@ -483,7 +483,7 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
6, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
},
......@@ -540,7 +540,7 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
6, // Length
1, // Type = AS_SET
0, // Path Segement Length
0, // Path Segment Length
},
wantFail: true,
},
......@@ -559,7 +559,7 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
6, // Length
3, // Type = INVALID
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
},
......@@ -580,11 +580,11 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
},
......@@ -648,11 +648,11 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......@@ -732,11 +732,11 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......@@ -829,11 +829,11 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......@@ -939,11 +939,11 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......@@ -1061,11 +1061,11 @@ func TestDecodeUpdateMsg(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......
......@@ -25,10 +25,10 @@ func SerializeNotificationMsg(msg *BGPNotification) []byte {
}
func SerializeOpenMsg(msg *BGPOpen) []byte {
optParmsBuf := bytes.NewBuffer(make([]byte, 0))
serializeOptParams(optParmsBuf, msg.OptParams)
optParms := optParmsBuf.Bytes()
openLen := uint16(len(optParms) + MinOpenLen)
optParamsBuf := bytes.NewBuffer(make([]byte, 0))
serializeOptParams(optParamsBuf, msg.OptParams)
optParams := optParamsBuf.Bytes()
openLen := uint16(len(optParams) + MinOpenLen)
buf := bytes.NewBuffer(make([]byte, 0, openLen))
serializeHeader(buf, openLen, OpenMsg)
......@@ -38,8 +38,8 @@ func SerializeOpenMsg(msg *BGPOpen) []byte {
buf.Write(convert.Uint16Byte(msg.HoldTime))
buf.Write(convert.Uint32Byte(msg.BGPIdentifier))
buf.WriteByte(uint8(len(optParms)))
buf.Write(optParms)
buf.WriteByte(uint8(len(optParams)))
buf.Write(optParams)
return buf.Bytes()
}
......
......@@ -76,11 +76,11 @@ func TestFSM255UpdatesIPv4(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......@@ -188,11 +188,11 @@ func TestFSM255UpdatesIPv6(t *testing.T) {
2, // Attribute Type code (AS Path)
12, // Length
2, // Type = AS_SEQUENCE
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
1, // Type = AS_SET
2, // Path Segement Length
2, // Path Segment Length
59, 65, // AS15169
12, 248, // AS3320
......
......@@ -121,7 +121,7 @@ func (b *BGPPath) Compare(c *BGPPath) int8 {
return 1
}
// e) TODO: interiour cost (hello IS-IS and OSPF)
// e) TODO: interior cost (hello IS-IS and OSPF)
// f) + RFC4456 9. (Route Reflection)
bgpIdentifierC := c.BGPIdentifier
......
......@@ -70,7 +70,7 @@ func TestPathsDiff(t *testing.T) {
},
},
{
name: "Disjunkt",
name: "Disjunct",
any: []*Path{
{
Type: 10,
......
......@@ -219,7 +219,7 @@ func getBestProtocol(paths []*Path) uint8 {
return best
}
// Print returns a prinatble representation of route `r`
// Print returns a printable representation of route `r`
func (r *Route) Print() string {
ret := fmt.Sprintf("%s:\n", r.pfx.String())
ret += fmt.Sprintf("All Paths:\n")
......
......@@ -861,7 +861,7 @@ func TestBestPathOnlyRRClient(t *testing.T) {
}
/*
* Test for AddPath capabale peer / AdjRIBOut
* Test for AddPath capable peer / AdjRIBOut
*/
func TestAddPathIBGP(t *testing.T) {
......
......@@ -39,7 +39,7 @@ func NewClientManager(master RouteTableClient) ClientManager {
}
}
// GetOptions gets the options for a registred client
// GetOptions gets the options for a registered client
func (c *ClientManager) GetOptions(client RouteTableClient) ClientOptions {
c.mu.RLock()
defer c.mu.RUnlock()
......
......@@ -36,7 +36,7 @@ func (c *ContributingASNs) Add(asn uint32) {
cASN.count++
if cASN.count == math.MaxUint32 {
panic(fmt.Sprintf("Contributing ASNs counter overflow triggered for AS %d. Dyning of shame.", asn))
panic(fmt.Sprintf("Contributing ASNs counter overflow triggered for AS %d. Dying of shame.", asn))
}
return
......
......@@ -15,7 +15,7 @@ func TestProcessTerms(t *testing.T) {
prefix net.Prefix
path *route.Path
term *Term
exptectAccept bool
expectAccept bool
expectModified bool
}{
{
......@@ -27,7 +27,7 @@ func TestProcessTerms(t *testing.T) {
&actions.AcceptAction{},
},
},
exptectAccept: true,
expectAccept: true,
expectModified: false,
},
{
......@@ -39,7 +39,7 @@ func TestProcessTerms(t *testing.T) {
&actions.RejectAction{},
},
},
exptectAccept: false,
expectAccept: false,
expectModified: false,
},
{
......@@ -52,7 +52,7 @@ func TestProcessTerms(t *testing.T) {
&actions.RejectAction{},
},
},
exptectAccept: true,
expectAccept: true,
expectModified: false,
},
{
......@@ -65,7 +65,7 @@ func TestProcessTerms(t *testing.T) {
&actions.AcceptAction{},
},
},
exptectAccept: true,
expectAccept: true,
expectModified: true,
},
}
......@@ -75,7 +75,7 @@ func TestProcessTerms(t *testing.T) {
f := NewFilter([]*Term{test.term})
p, reject := f.ProcessTerms(test.prefix, test.path)
assert.Equal(t, test.exptectAccept, !reject)
assert.Equal(t, test.expectAccept, !reject)
if test.expectModified {
assert.NotEqual(t, test.path, p)
......
......@@ -33,9 +33,9 @@ func NewTermConditionWithPrefixLists(filters ...*PrefixList) *TermCondition {
func (f *TermCondition) Matches(p net.Prefix, pa *route.Path) bool {
return f.matchesPrefixListFilters(p) &&
f.machtchesRouteFilters(p) &&
f.machtchesCommunityFilters(pa) &&
f.machtchesLargeCommunityFilters(pa)
f.matchesRouteFilters(p) &&
f.matchesCommunityFilters(pa) &&
f.matchesLargeCommunityFilters(pa)
}
func (t *TermCondition) matchesPrefixListFilters(p net.Prefix) bool {
......@@ -52,7 +52,7 @@ func (t *TermCondition) matchesPrefixListFilters(p net.Prefix) bool {
return false
}
func (t *TermCondition) machtchesRouteFilters(p net.Prefix) bool {
func (t *TermCondition) matchesRouteFilters(p net.Prefix) bool {
if len(t.routeFilters) == 0 {
return true
}
......@@ -66,7 +66,7 @@ func (t *TermCondition) machtchesRouteFilters(p net.Prefix) bool {
return false
}
func (t *TermCondition) machtchesCommunityFilters(pa *route.Path) bool {
func (t *TermCondition) matchesCommunityFilters(pa *route.Path) bool {
if len(t.communityFilters) == 0 {
return true
}
......@@ -84,7 +84,7 @@ func (t *TermCondition) machtchesCommunityFilters(pa *route.Path) bool {
return false
}
func (t *TermCondition) machtchesLargeCommunityFilters(pa *route.Path) bool {
func (t *TermCondition) matchesLargeCommunityFilters(pa *route.Path) bool {
if len(t.largeCommunityFilters) == 0 {
return true
}
......
......@@ -19,7 +19,7 @@ type Neighbor struct {
// Local ASN of session
LocalASN uint32
// RouteServerClient incicates if the peer is a route server client
// RouteServerClient indicates if the peer is a route server client
RouteServerClient bool
// RouteReflectorClient indicates if the peer is a route reflector client
......
......@@ -114,7 +114,7 @@ func (rt *RoutingTable) LPM(pfx net.Prefix) (res []*route.Route) {
return res
}
// Get get's the route for pfx from the LPM
// Get gets the route for pfx from the LPM
func (rt *RoutingTable) Get(pfx net.Prefix) *route.Route {
rt.mu.RLock()
defer rt.mu.RUnlock()
......@@ -134,7 +134,7 @@ func (rt *RoutingTable) get(pfx net.Prefix) *route.Route {
return res.route
}
// GetLonger get's prefix pfx and all it's more specifics from the LPM
// GetLonger gets prefix pfx and all it's more specifics from the LPM
func (rt *RoutingTable) GetLonger(pfx net.Prefix) (res []*route.Route) {
rt.mu.RLock()
defer rt.mu.RUnlock()
......
......@@ -8,7 +8,7 @@ import (
type MockConn struct {
net.Conn
// Bytes are the bytes writen
// Bytes are the bytes written
Bytes []byte
}
......
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