P1sec / pycrate

A Python library to ease the development of encoders and decoders for various protocols and file formats; contains ASN.1 and CSN.1 compilers.
GNU Lesser General Public License v2.1
382 stars 132 forks source link

Is it possible to convert IP address to readable format? #211

Open LuciferAlan opened 2 years ago

LuciferAlan commented 2 years ago

Some IP address type elements in NGAP and NAS message is not easy to read, like PDUAddress and TransportLayerAddress, is it possible to show it in readable format like 192.168.1.1? appreciate your reply

p1-bmu commented 2 years ago

Custom representation of IP addresses in NAS and ASN.1-based protocols (such as NGAP) is not implemented, they are just handled as bytes buffer. You can easily add it by just using socket.inet_ntoa or socket.inet_ntop however.