twampy.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:twampy 作者: nokia 项目源码 文件源码
def connectionSetup(self):
        log.info("CTRL.RX <<Server Greeting>>")
        data = self.receive()
        self.smode = struct.unpack('!I', data[12:16])[0]
        log.info("TWAMP modes supported: %d", self.smode)
        if self.smode & 1 == 0:
            log.critical('*** TWAMPY only supports unauthenticated mode(1)')

        log.info("CTRL.TX <<Setup Response>>")
        self.send(struct.pack('!I', 1) + zeros(160))

        log.info("CTRL.RX <<Server Start>>")
        data = self.receive()

        rval = ord(data[15])
        if rval != 0:
            # TWAMP setup request not accepted by server
            log.critical("*** ERROR CODE %d in <<Server Start>>", rval)

        self.nbrSessions = 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号