1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00
* reserved to empty in serial frames
This commit is contained in:
mlenders 2011-08-05 15:45:38 +02:00
parent c6c5eaae70
commit 19dc26b496
5 changed files with 11 additions and 11 deletions

View File

@ -79,7 +79,7 @@ void multiplex_send_ipv6_over_uart(struct ipv6_hdr_t *packet) {
border_l3_header_t *serial_buf;
serial_buf = (border_l3_header_t *)get_serial_out_buffer(0);
serial_buf->reserved = 0;
serial_buf->empty = 0;
serial_buf->type = BORDER_PACKET_L3_TYPE;
serial_buf->ethertype = BORDER_ETHERTYPE_IPV6;
memcpy(get_serial_in_buffer(0)+sizeof (border_l3_header_t), packet, IPV6_HDR_LEN + packet->length);
@ -94,7 +94,7 @@ void multiplex_send_addr_over_uart(ipv6_addr_t *addr) {
border_addr_packet_t *serial_buf;
serial_buf = (border_addr_packet_t *)get_serial_in_buffer(0);
serial_buf->reserved = 0;
serial_buf->empty = 0;
serial_buf->type = BORDER_PACKET_CONF_TYPE;
serial_buf->conftype = BORDER_CONF_IPADDR;
memcpy(

View File

@ -19,27 +19,27 @@
#define BORDER_ETHERTYPE_IPV6 0x86DD
typedef struct __attribute__ ((packed)) border_packet_t {
uint8_t reserved;
uint8_t empty;
uint8_t type;
uint8_t seq_num;
} border_packet_t;
typedef struct __attribute__ ((packed)) border_l3_header_t {
uint8_t reserved;
uint8_t empty;
uint8_t type;
uint8_t seq_num;
uint16_t ethertype;
} border_l3_header_t;
typedef struct __attribute__ ((packed)) border_conf_header_t {
uint8_t reserved;
uint8_t empty;
uint8_t type;
uint8_t seq_num;
uint8_t conftype;
} border_conf_header_t;
typedef struct __attribute__ ((packed)) border_addr_packet_t {
uint8_t reserved;
uint8_t empty;
uint8_t type;
uint8_t seq_num;
uint8_t conftype;
@ -48,7 +48,7 @@ typedef struct __attribute__ ((packed)) border_addr_packet_t {
} border_addr_packet_t;
typedef struct __attribute__ ((packed)) border_context_packet_t {
uint8_t reserved;
uint8_t empty;
uint8_t type;
uint8_t seq_num;
uint8_t conftype;

View File

@ -29,7 +29,7 @@ ipv6_addr_t init_threeway_handshake() {
slwin_stat.last_frame = syn->next_exp - 1;
slwin_stat.last_ack = slwin_stat.last_frame;
synack->reserved = 0;
synack->empty = 0;
synack->type = BORDER_PACKET_CONF_TYPE;
synack->conftype = BORDER_CONF_SYNACK;
@ -109,7 +109,7 @@ void flowcontrol_send_over_uart(border_packet_t *packet, int len) {
void send_ack(uint8_t seq_num) {
border_packet_t *packet = (border_packet_t *)get_serial_out_buffer(0);
packet->reserved = 0;
packet->empty = 0;
packet->type = BORDER_PACKET_ACK_TYPE;
packet->seq_num = seq_num;
writepacket((uint8_t *)packet, sizeof (border_packet_t));

View File

@ -41,7 +41,7 @@ typedef struct flowcontrol_stat_t {
} flowcontrol_stat_t;
typedef struct __attribute__ ((packed)) border_syn_packet_t {
uint8_t reserved;
uint8_t empty;
uint8_t type;
uint8_t next_seq_num;
uint8_t conftype;

View File

@ -76,7 +76,7 @@ void serial_reader_f(void) {
}
uart_buf = (border_packet_t*)get_serial_in_buffer(0);
if (uart_buf->reserved == 0) {
if (uart_buf->empty == 0) {
if (uart_buf->type == BORDER_PACKET_CONF_TYPE) {
border_conf_header_t *conf_packet = (border_conf_header_t*)uart_buf;
if (conf_packet->conftype == BORDER_CONF_SYN) {