es.tid.pce.pcep.objects.P2MPGeneralizedEndPoints Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of network-protocols Show documentation
Show all versions of network-protocols Show documentation
BGP-LS,OSPF-TE,PCEP and RSVP-TE protocol encodings.
The newest version!
package es.tid.pce.pcep.objects;
import java.util.LinkedList;
import es.tid.pce.pcep.PCEPProtocolViolationException;
import es.tid.pce.pcep.constructs.EndPoint;
import es.tid.pce.pcep.constructs.EndPointAndRestrictions;
import es.tid.pce.pcep.constructs.EndpointRestriction;
import es.tid.pce.pcep.constructs.IPv4AddressEndPoint;
import es.tid.pce.pcep.constructs.UnnumIfEndPoint;
import es.tid.pce.pcep.objects.tlvs.EndPointIPv4TLV;
import es.tid.pce.pcep.objects.tlvs.PCEPTLV;
import es.tid.pce.pcep.objects.tlvs.UnnumberedEndpointTLV;
/**
* GeneralizedEndPoints Object of Type P2P End Points
* @author ogondio
*
*/
public class P2MPGeneralizedEndPoints extends GeneralizedEndPoints {
private EndPointAndRestrictions EndpointAndRestrictions;
private LinkedList EndpointAndRestrictionsList;
public P2MPGeneralizedEndPoints() {
super();
this.setGeneralizedEndPointsType(1);
EndpointAndRestrictionsList= new LinkedList ();
}
public P2MPGeneralizedEndPoints(byte[] bytes, int offset)
throws MalformedPCEPObjectException, PCEPProtocolViolationException {
super(bytes, offset);
EndpointAndRestrictionsList= new LinkedList ();
decode();
}
public void encode() {
try {
int len=8;
if (EndpointAndRestrictionsList.size()>0){
for (int i=0;i=max_offset){
log.warn("Empty P2MPEndpoints !!!");
throw new PCEPProtocolViolationException();
}
EndpointAndRestrictions = new EndPointAndRestrictions(this.object_bytes, offset);
offset = offset + EndpointAndRestrictions.getLength();
while (offset < max_offset)
{
EndPointAndRestrictions EndpointAndRestrictions = new EndPointAndRestrictions(this.object_bytes, offset);
EndpointAndRestrictionsList.add(EndpointAndRestrictions);
offset = offset + EndpointAndRestrictions.getLength();
}
} catch (PCEPProtocolViolationException e) {
// TODO Auto-generated catch block
throw new MalformedPCEPObjectException();
}
}
public EndPointAndRestrictions getEndpointAndRestrictions() {
return EndpointAndRestrictions;
}
public void setEndpointAndRestrictions(EndPointAndRestrictions endpointAndRestrictions) {
EndpointAndRestrictions = endpointAndRestrictions;
}
public LinkedList getEndpointAndRestrictionsList() {
return EndpointAndRestrictionsList;
}
public void setEndpointAndRestrictionsList(LinkedList endpointAndRestrictionsList) {
EndpointAndRestrictionsList = endpointAndRestrictionsList;
}
}