Ejemplo n.º 1
0
 def __init__(self, msgType, connID, resultCode, errCode, errMsg):
     stopAvp = L2tpv3RFC3931AVPs.ControlMessageAVP(msgType)
     retcode = L2tpv3RFC3931AVPs.ResultCode(
         L2tpv3RFC3931AVPs.ControlMessageAVP.StopCCN, resultCode, errCode, errMsg)
     super(l2tpV3TerminatePkt, self).__init__(
         remoteConnID=connID, avps=(stopAvp, retcode))
Ejemplo n.º 2
0
iccn.ns = 3
iccn.nr = 2
iccn.connectionID = conntionID

for avp in iccn.avps:
    if isinstance(avp, L2tpv3RFC3931AVPs.RemoteSessionID):
        avp.sessionID = sessionID
# Change the AVPs
print iccn
buf = iccn.encode(True)
s.sendto(buf, ('127.0.0.1', 1))

cdnMsg = L2tpv3RFC3931AVPs.ControlMessageAVP(
    L2tpv3RFC3931AVPs.ControlMessageAVP.CDN)
retcode = L2tpv3RFC3931AVPs.ResultCode(
    L2tpv3RFC3931AVPs.ControlMessageAVP.StopCCN, 0, 0, "test")
# Get the lcoal session ID
localAvp = None
for avp in iccn.avps:
    if isinstance(avp, L2tpv3RFC3931AVPs.LocalSessionID):
        lcoalSessionID = avp.sessionID
        localAvp = L2tpv3RFC3931AVPs.LocalSessionID(lcoalSessionID)
remoteAvp = L2tpv3RFC3931AVPs.RemoteSessionID(sessionID)
cdn = L2tpv3ControlPacket.L2tpv3ControlPacket(conntionID,
                                              avps=(cdnMsg, retcode, localAvp,
                                                    remoteAvp))

cdn.ns = 4
cdn.nr = 2
cdn.connectionID = conntionID
print cdn