Changeset ee603c4 in mainline for uspace/srv/udp/udp_inet.c
- Timestamp:
- 2012-04-04T21:10:22Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 92b42442
- Parents:
- 4794417
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/udp/udp_inet.c
r4794417 ree603c4 43 43 #include <task.h> 44 44 45 /*46 #include "pdu.h"47 #include "rqueue.h"48 */49 45 #include "std.h" 50 46 #include "udp_inet.h" 47 #include "udp_type.h" 51 48 52 49 static int udp_inet_ev_recv(inet_dgram_t *dgram); … … 123 120 124 121 /** Transmit PDU over network layer. */ 125 /*void tcp_transmit_pdu(tcp_pdu_t *pdu)122 int udp_transmit_pdu(udp_pdu_t *pdu) 126 123 { 127 124 int rc; 128 uint8_t *pdu_raw;129 size_t pdu_raw_size;130 125 inet_dgram_t dgram; 131 126 132 pdu_raw_size = pdu->header_size + pdu->text_size; 133 pdu_raw = malloc(pdu_raw_size); 134 if (pdu_raw == NULL) { 135 log_msg(LVL_ERROR, "Failed to transmit PDU. Out of memory."); 136 return; 137 } 138 139 memcpy(pdu_raw, pdu->header, pdu->header_size); 140 memcpy(pdu_raw + pdu->header_size, pdu->text, 141 pdu->text_size); 142 143 dgram.src.ipv4 = pdu->src_addr.ipv4; 144 dgram.dest.ipv4 = pdu->dest_addr.ipv4; 127 dgram.src.ipv4 = pdu->src.ipv4; 128 dgram.dest.ipv4 = pdu->dest.ipv4; 145 129 dgram.tos = 0; 146 dgram.data = pdu _raw;147 dgram.size = pdu _raw_size;130 dgram.data = pdu->data; 131 dgram.size = pdu->data_size; 148 132 149 133 rc = inet_send(&dgram, INET_TTL_MAX, 0); 150 134 if (rc != EOK) 151 135 log_msg(LVL_ERROR, "Failed to transmit PDU."); 136 137 return rc; 152 138 } 153 */ 139 154 140 /** Process received PDU. */ 155 141 /*
Note:
See TracChangeset
for help on using the changeset viewer.