Tiny DNS Server.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
#include "conf_tinyservices.h"
#include "tinyservices.h"
#include "wifi_private.h"
#include <string.h>
Functions | |
uint32_t | pbuf_read16be (struct pbuf *pbuf, uint32_t offset, uint16_t *pval) |
Read two bytes (big-endian) from a pbuf. More... | |
uint32_t | pbuf_read32le (struct pbuf *pbuf, uint32_t offset, uint32_t *pval) |
Read four bytes (little-endian) from a pbuf. More... | |
uint32_t | pbuf_read8 (struct pbuf *pbuf, uint32_t offset, uint8_t *pval) |
Read a byte from a pbuf. More... | |
err_t | pbuf_take_partial (struct pbuf *pbuf, uint32_t offset, const void *dataptr, u16_t len) |
Copy application supplied data into a pbuf. More... | |
uint32_t | pbuf_write16be (struct pbuf *pbuf, uint32_t offset, uint16_t val) |
Write two bytes (big-endian) to a pbuf. More... | |
uint32_t | pbuf_write32be (struct pbuf *pbuf, uint32_t offset, uint32_t val) |
Write four bytes (big-endian) to a pbuf. More... | |
uint32_t | pbuf_write32le (struct pbuf *pbuf, uint32_t offset, uint32_t val) |
Write four bytes (little-endian) to a pbuf. More... | |
uint32_t | pbuf_write8 (struct pbuf *pbuf, uint32_t offset, uint8_t val) |
Write a byte to a pbuf. More... | |
uint32_t pbuf_read16be | ( | struct pbuf * | pbuf, |
uint32_t | offset, | ||
uint16_t * | pval | ||
) |
Read two bytes (big-endian) from a pbuf.
If the read is beyond the end of the pbuf chain's payload, then return an error instead.
buf | pbuf to read data from. |
offset | logical offset into pbuf to start reading from |
pval | memory to place the read bytes into. |
References _wifi_get16_be(), pbuf_copy_partial(), and pbuf::tot_len.
uint32_t pbuf_read32le | ( | struct pbuf * | pbuf, |
uint32_t | offset, | ||
uint32_t * | pval | ||
) |
Read four bytes (little-endian) from a pbuf.
If the requested read is beyond the * end of the pbuf chain's payload, then this function does not perform the read. It returns an error instead.
buf | pbuf to read data from. |
offset | logical offset into pbuf to start reading from. |
val | the data to read from the pbuf. |
References _wifi_get32_le(), pbuf_copy_partial(), and pbuf::tot_len.
Referenced by pbuf_read_ip().
uint32_t pbuf_read8 | ( | struct pbuf * | pbuf, |
uint32_t | offset, | ||
uint8_t * | pval | ||
) |
Read a byte from a pbuf.
If the read is beyond the end of the pbuf chain's payload, then return an error instead.
buf | pbuf to read data from. |
offset | logical offset into pbuf to start reading from |
pval | memory to place the read byte into. |
References pbuf_get_at(), and pbuf::tot_len.
Copy application supplied data into a pbuf.
This function can only be used to copy the equivalent of buf->tot_len data.
buf | pbuf to fill with data |
offset | logical offset into pbuf to start writing data into |
dataptr | application supplied data buffer |
len | length of the application supplied data buffer |
References Assert, ERR_ARG, ERR_OK, pbuf::len, pbuf::next, NULL, and pbuf::payload.
Referenced by pbuf_write16be(), pbuf_write32be(), pbuf_write32le(), and pbuf_write8().
uint32_t pbuf_write16be | ( | struct pbuf * | pbuf, |
uint32_t | offset, | ||
uint16_t | val | ||
) |
Write two bytes (big-endian) to a pbuf.
If the requested write is beyond the * end of the pbuf chain's payload, then this function does not perform the write. It returns an error instead.
buf | pbuf to write data to. |
offset | logical offset into pbuf to start writing to. |
val | the data to write to the pbuf. |
References _wifi_put16_be(), ERR_OK, pbuf_take_partial(), and pbuf::tot_len.
uint32_t pbuf_write32be | ( | struct pbuf * | pbuf, |
uint32_t | offset, | ||
uint32_t | val | ||
) |
Write four bytes (big-endian) to a pbuf.
If the requested write is beyond the * end of the pbuf chain's payload, then this function does not perform the write. It returns an error instead.
buf | pbuf to write data to. |
offset | logical offset into pbuf to start writing to. |
val | the data to write to the pbuf. |
References _wifi_put32_be(), ERR_OK, pbuf_take_partial(), and pbuf::tot_len.
uint32_t pbuf_write32le | ( | struct pbuf * | pbuf, |
uint32_t | offset, | ||
uint32_t | val | ||
) |
Write four bytes (little-endian) to a pbuf.
If the requested write is beyond the * end of the pbuf chain's payload, then this function does not perform the write. It returns an error instead.
buf | pbuf to write data to. |
offset | logical offset into pbuf to start writing to. |
val | the data to write to the pbuf. |
References _wifi_put32_le(), ERR_OK, pbuf_take_partial(), and pbuf::tot_len.
Referenced by pbuf_write_ip().
uint32_t pbuf_write8 | ( | struct pbuf * | pbuf, |
uint32_t | offset, | ||
uint8_t | val | ||
) |
Write a byte to a pbuf.
If the requested write is beyond the end of the pbuf chain's payload, then this function does not perform the write. It returns an error instead.
buf | pbuf to write data to. |
offset | logical offset into pbuf to start writing to. |
val | the data to write to the pbuf. |
References ERR_OK, pbuf_take_partial(), and pbuf::tot_len.