首页 > 解决方案 > 如何作为中间节点访问分组数据

问题描述

A 想向 B 传输数据。C 是中间节点。发送数据如下:</p>

static void
send_packet(void *ptr)
{
  uint16_t packet_id;
 
  packet_id=(client_ipaddr.u8[sizeof(client_ipaddr.u8)-1])*100+panum;
  PRINTF("The sending packet id is %u\n",packet_id);
  uip_udp_packet_sendto(client_conn, &packet_id, sizeof(packet_id), &server_ipaddr, UIP_HTONS(UDP_SERVER_PORT));
  panum=panum+1;
}

现在,C 嗅探数据包并希望读取 packetdata(packet_id) 作为中间节点。怎么做?

标签: ccontiki

解决方案


推荐阅读