networktools.py 文件源码

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

项目:packet_analysis 作者: tanjiti 项目源码 文件源码
def getPortNumHostByteOrder(st_network):
    """
    Convert 16-bit positive integers from network to host byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation
    :param st_network:
    :return: 20480 - 80
    """
    try:
        st_network = int(st_network)
        return socket.ntohs(st_network)
    except Exception as e:
        logging.error("[NetworkByteOrderPortFalse]: %f %s" % (st_network, repr(e)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号