packet: add helper functions for bgp speaker

The helper functions allows bgp speaker to easily read a header from a
socket, get the body length, read the body data, and parse it.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>