Function gnunet_sys::GNUNET_DNSPARSER_pack[][src]

pub unsafe extern "C" fn GNUNET_DNSPARSER_pack(
    p: *const GNUNET_DNSPARSER_Packet,
    max: u16,
    buf: *mut *mut c_char,
    buf_length: *mut usize
) -> c_int

Given a DNS packet @a p, generate the corresponding UDP payload. Note that we do not attempt to pack the strings with pointers as this would complicate the code and this is about being simple and secure, not fast, fancy and broken like bind.

@param p packet to pack @param max maximum allowed size for the resulting UDP payload @param buf set to a buffer with the packed message @param buf_length set to the length of @a buf @return #GNUNET_SYSERR if @a p is invalid #GNUNET_NO if @a p was truncated (but there is still a result in @a buf) #GNUNET_OK if @a p was packed completely into @a buf