Example #1
0
 def get_delay_time(self):
     """
     长度: 6(固定)
     描述: 用户记录报文的发送延时
     属性值6字节,用于REQ_LOGOUT(Type=5)和NTF_LOGOUT(Type=8)报文中,表示报文发送时间与实际发生时间的间隔。目前没有实现。
     """
     for attr in self.attrs:
         if attr[0] == 0x0c:
             return pktutils.DecodeOctets(attr[1])
Example #2
0
 def get_bas_ipv6(self):
     """
     长度: 16
     描述: 用于标识BAS设备的IPv6地址,所有BAS设备发送的报文都应该携带该属性。
     属性值16字节。只有在REQ_INFO、REQ_CHALLENGE报文中不含此属性,其他报文必须包含此属性。IPv4环境时,其值为0。
     """
     for attr in self.attrs:
         if attr[0] == 0x64:
             return pktutils.DecodeOctets(attr[1])
Example #3
0
 def get_chap_pwd(self):
     """
     长度: 16(固定)
     描述: 该属性表示由ppp chap用户通过MD5算法加密后的密码。
     当出现此属性时,其chap challenge在Challenge(03)属性中。当采用chap方式认证时,必须出现在REQ_AUTH(03)报文中。
     """
     for attr in self.attrs:
         if attr[0] == 0x04:
             return pktutils.DecodeOctets(attr[1])
Example #4
0
 def get_challenge(self):
     """
     长度: 16(固定)
     描述: 表示设备传送给CHAP认证的用户的chap challenge。
     它只能用在chap方式认证的REQ_AUTH(03)报文中,当是CHAP认证方式时,必须出现在REQ_AUTH报文中。
     """
     for t, v in self.attrs:
         if t == 0x03:
             return pktutils.DecodeOctets(v)
Example #5
0
 def get_user_list(self):
     """
     长度: >=6,<=254
     描述: 属性值最短4个字节,最长252个字节,
     用于用户心跳报文(NTF_USER_HEARTBEAT(Type=0x010))和用户心跳回应报文(ACK_NTF_USER_HEARTBEAT(Type=0x11))。
     属性值中包含了用户IP地址列表,每个用户IP地址占用4个字节,中间没有分隔符。
     """
     for attr in self.attrs:
         if attr[0] == 0x0d:
             return pktutils.DecodeOctets(attr[1])
Example #6
0
 def get_session_id(self):
     """
     长度: 6(固定)
     描述: 此属性用来标识用户,建议取用户的mac地址。
     属性值6字节。当BAS关心用户的mac地址时,
     必须出现在ACK_AUTH,ACK_LOGOUT,NTF_LOGOUT和NTF_USERIPCHAN报文中,否则可以不出现。
     """
     for attr in self.attrs:
         if attr[0] == 0x0b:
             return pktutils.DecodeOctets(attr[1])
Example #7
0
 def get_useripv6_list(self):
     """
     长度: >=18,<=252
     描述: 用于标识接入用户的IPv6地址,其值由Portal Server根据用户获得的IPv6地址填写。
     属性值最短16个字节,最长252个字节,用于用户心跳报文(NTF_USER_HEARTBEAT(Type=0x010))
     和用户心跳回应报文(ACK_NTF_USER_HEARTBEAT(Type=0x11))。属性值中包含了用户IPv6地址列表,
     每个用户IPv6地址占用16个字节,中间没有分隔符。
     """
     for attr in self.attrs:
         if attr[0] == 0x65:
             return pktutils.DecodeOctets(attr[1])
Example #8
0
 def get_user_notify(self):
     """
     长度: <=254
     描述: 此属性主要用于透传的Radius计费回应报文中的hw_User_Notify内容。
     属性值最长255个字节,用于用户消息通知报文(NTF_USER_NOTIFY(Type=0x013)),
     将Radius服务器的计费开始回应报文中的hw_User_Notify内容透传给客户端。
     可以实现Portal认证通过后提示帐号余额等重要信息。
     """
     for attr in self.attrs:
         if attr[0] == 0x0f:
             return pktutils.DecodeOctets(attr[1])