msantos / pkt

Erlang network protocol library
http://blog.listincomprehension.com/search/label/epcap
BSD 3-Clause "New" or "Revised" License
150 stars 44 forks source link

Enhancement request #47

Closed vasu-dasari closed 6 years ago

vasu-dasari commented 6 years ago

Currently, there is an API pkt:decode(Data) to decode binary to various records provided by pkt library. It would be good to have an API for pkt:encode(Data) as well to convert records in pkt to binary data. This way, a caller can fill the required records and have the list encoded to a binary as a single API. Also, the encode function would give symmetricity to the APIs you have provided.

vasu-dasari commented 6 years ago

I made some changes to this effect. Please look at my PR https://github.com/msantos/pkt/pull/48 which addresses this enhancement.