Skip to content

Commit

Permalink
Removed non-standard TLVs. Added extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargdd committed Jan 25, 2021
1 parent 55a30f6 commit 8b6944b
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 665 deletions.
8 changes: 6 additions & 2 deletions src/main/java/es/tid/ospf/ospfv2/lsa/tlv/LinkTLV.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,14 @@ public void setRemoteASNumber(RemoteASNumber remoteASNumber) {
//this.remoteASNumber = remoteASNumber;
}

public IPv4RemoteASBRID getiPv4RemoteASBRID() {

public IPv4RemoteASBRID getIPv4RemoteASBRID() {
return iPv4RemoteASBRID;
}


public void setIPv4RemoteASBRID(IPv4RemoteASBRID iPv4RemoteASBRID) {
//this.iPv4RemoteASBRID = iPv4RemoteASBRID;
this.iPv4RemoteASBRID = iPv4RemoteASBRID;
}

public String toString(){
Expand Down Expand Up @@ -571,4 +573,6 @@ public String printShort(){

return sb.toString();
}


}
35 changes: 35 additions & 0 deletions src/main/java/es/tid/ospf/ospfv2/lsa/tlv/OSPFTLV.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package es.tid.ospf.ospfv2.lsa.tlv;

import java.util.Arrays;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -40,6 +42,39 @@ length field (so a three octet value would have a length of three,
*/
public abstract class OSPFTLV {

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + TLVType;
result = prime * result + TLVValueLength;
result = prime * result + TotalTLVLength;
result = prime * result + Arrays.hashCode(tlv_bytes);
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
OSPFTLV other = (OSPFTLV) obj;
if (TLVType != other.TLVType)
return false;
if (TLVValueLength != other.TLVValueLength)
return false;
if (TotalTLVLength != other.TotalTLVLength)
return false;
if (!Arrays.equals(tlv_bytes, other.tlv_bytes))
return false;
return true;
}



/**
* Type of the OSPF TLV
*/
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/es/tid/pce/pcep/constructs/EndPoint.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
package es.tid.pce.pcep.constructs;

import es.tid.pce.pcep.PCEPProtocolViolationException;
import es.tid.pce.pcep.objects.MalformedPCEPObjectException;
import es.tid.pce.pcep.objects.ObjectParameters;
import es.tid.pce.pcep.objects.tlvs.EndPointDataPathTLV;
import es.tid.pce.pcep.objects.tlvs.EndPointUnnumberedDataPathTLV;
import es.tid.pce.pcep.objects.tlvs.EndPointIPv4TLV;
import es.tid.pce.pcep.objects.tlvs.PCEPTLV;
import es.tid.pce.pcep.objects.tlvs.UnnumberedEndpointTLV;
import es.tid.pce.pcep.objects.tlvs.XifiEndPointTLV;

public abstract class EndPoint extends PCEPConstruct {

public EndPoint() {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/es/tid/pce/pcep/constructs/UnnumIfEndPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import es.tid.pce.pcep.objects.ObjectParameters;
import es.tid.pce.pcep.objects.tlvs.EndPointDataPathTLV;
import es.tid.pce.pcep.objects.tlvs.EndPointIPv4TLV;
import es.tid.pce.pcep.objects.tlvs.EndPointUnnumberedDataPathTLV;
import es.tid.pce.pcep.objects.tlvs.PCEPTLV;
import es.tid.pce.pcep.objects.tlvs.UnnumberedEndpointTLV;
import es.tid.pce.pcep.objects.tlvs.XifiEndPointTLV;

public class UnnumIfEndPoint extends EndPoint {

Expand Down

This file was deleted.

Loading

0 comments on commit 8b6944b

Please sign in to comment.