1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 225 unchanged lines hidden (view full) --- 234 DPRINTF(Ethernet, "Received data from peer: len=%d buffer_offset=%d " 235 "data_len=%d\n", len, buffer_offset, data_len); 236 } 237 238 while (data_len != 0 && buffer_offset >= data_len + sizeof(uint32_t)) { 239 EthPacketPtr packet; 240 packet = make_shared<EthPacketData>(data_len); 241 packet->length = data_len; |
242 packet->simLength = data_len; |
243 memcpy(packet->data, data, data_len); 244 245 assert(buffer_offset >= data_len + sizeof(uint32_t)); 246 buffer_offset -= data_len + sizeof(uint32_t); 247 if (buffer_offset > 0) { 248 memmove(buffer, data + data_len, buffer_offset); 249 data_len = ntohl(*(uint32_t *)buffer); 250 } else --- 99 unchanged lines hidden --- |