首页 / AMD-FPGA / 帖子

关于tcp接收网络调试助手数据

作者 江苏-天文 2019-07-12 11228 次浏览 2 条回复 论坛存档
江
江苏-天文
2019-07-12
楼主

tcp接收的数据信息主要是pbuf结构体提供的,但是我不知道如何利用指针将数据读出来,比如读到一个数组中,并对其进行判断?

struct pbuf {

/** next pbuf in singly linked pbuf chain */

struct pbuf *next;

/** pointer to the actual data in the buffer */

void *payload;

/**

* total length of this buffer and all next buffers in chain

* belonging to the same packet.

*

* For non-queue packet chains this is the invariant:

* p->tot_len == p->len + (p->next? p->next->tot_len: 0)

*/

u16_t tot_len;

/** length of this buffer */

u16_t len;

/** pbuf_type as u8_t instead of enum to save space */

u8_t /*pbuf_type*/ type;

/** misc flags */

u8_t flags;

/**

* the reference count always equals the number of pointers

* that refer to this pbuf. This can be pointers from an application,

* the stack itself, or pbuf->next pointers from a chain.

*/

u16_t ref;

};

江
江苏-天文
2019-07-12
#1

主要是c语言没有学好,和我遇到一样问题的同学建议去百度一些memcpy()函数,其实就是一个内存拷贝的函数。

路漫漫其修远兮,吾将上下而求索!

uisrc
uisrc
2019-07-12
#2

{:1_143:}搞定就好{:1_144:}

这是论坛时期的原帖存档,只读。新的讨论请到 提问, 沉淀下来的内容会进 知识库 和 方案库。