import es.tid.pce.pcep.constructs.UpdateRequest; //导入依赖的package包/类
private void sendUpdate(LSPTEInfo val) throws UnknownHostException
{
SRP rsp = new SRP();
rsp.setSRP_ID_number(1);
SymbolicPathNameTLV symPathName= new SymbolicPathNameTLV();
symPathName.setSymbolicPathNameID(ObjectParameters.redundancyID);
rsp.setSymPathName(symPathName);
//tedb.getDomainReachabilityIPv4Prefix();
PCEPUpdate m_update = new PCEPUpdate();
UpdateRequest state_report = new UpdateRequest();
LSP lsp = new LSP();
//Delegate the LSP
lsp.setDFlag(true);
//No sync
lsp.setSFlag(false);
//Is LSP operational?
lsp.setOpFlags(ObjectParameters.LSP_OPERATIONAL_UP);
lsp.setLspId(1);
IPv4LSPIdentifiersTLV lspIdTLV = new IPv4LSPIdentifiersTLV();
//lspIdTLV.setLspID((lspte.getIdLSP().intValue()));
lspIdTLV.setTunnelID(1234);
lspIdTLV.setTunnelSenderIPAddress((Inet4Address)Inet4Address.getLocalHost());
//FIXME
//lspIdTLV.setExtendedTunnelID(extendedTunnelID);
lsp.setLspIdentifiers_tlv(lspIdTLV);
SymbolicPathNameTLV symbPathName = new SymbolicPathNameTLV();
/*This id should be unique within the PCC*/
symbPathName.setSymbolicPathNameID(ByteBuffer.allocate(8).putLong(lsp.getLspId()).array());
lsp.setSymbolicPathNameTLV_tlv(symbPathName);
LSPDatabaseVersionTLV lspdDTLV = new LSPDatabaseVersionTLV();
/*A change has been made so the database version is aumented*/
lspdDTLV.setLSPStateDBVersion(2);
state_report.setLsp(lsp);
state_report.setSrp(rsp);
//Do the Path thing well.
Path path = new Path();
ExplicitRouteObject auxERO = new ExplicitRouteObject();
path.setEro(auxERO);
BandwidthRequested bw = new BandwidthRequested();
bw.setBw(1);
path.setBandwidth(bw);
/*
LinkedList metricList = new LinkedList();
Metric metric = new Metric();
metric.setPbit(false);
metric.setBoundBit(false);
*/
state_report.setPath(path);
m_update.addStateReport(state_report);
out.println("Sending First PCEPUpdate message");
//oneSession.sendPCEPMessage(m_update);
}