inet.cc (11793:ef606668d247) | inet.cc (13449:2f7efa89c58b) |
---|---|
1/* 2 * Copyright (c) 2013 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 37 unchanged lines hidden (view full) --- 46#include "base/inet.hh" 47 48#include <cstddef> 49#include <cstdio> 50#include <sstream> 51#include <string> 52 53#include "base/cprintf.hh" | 1/* 2 * Copyright (c) 2013 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 37 unchanged lines hidden (view full) --- 46#include "base/inet.hh" 47 48#include <cstddef> 49#include <cstdio> 50#include <sstream> 51#include <string> 52 53#include "base/cprintf.hh" |
54#include "base/logging.hh" |
|
54#include "base/types.hh" 55 56using namespace std; 57namespace Net { 58 59EthAddr::EthAddr() 60{ 61 memset(data, 0, ETH_ADDR_LEN); --- 171 unchanged lines hidden (view full) --- 233uint16_t 234cksum(const TcpPtr &tcp) 235{ 236 if (IpPtr(tcp.packet())) { 237 return __tu_cksum(IpPtr(tcp.packet())); 238 } else if (Ip6Ptr(tcp.packet())) { 239 return __tu_cksum6(Ip6Ptr(tcp.packet())); 240 } else { | 55#include "base/types.hh" 56 57using namespace std; 58namespace Net { 59 60EthAddr::EthAddr() 61{ 62 memset(data, 0, ETH_ADDR_LEN); --- 171 unchanged lines hidden (view full) --- 234uint16_t 235cksum(const TcpPtr &tcp) 236{ 237 if (IpPtr(tcp.packet())) { 238 return __tu_cksum(IpPtr(tcp.packet())); 239 } else if (Ip6Ptr(tcp.packet())) { 240 return __tu_cksum6(Ip6Ptr(tcp.packet())); 241 } else { |
241 assert(0); | 242 panic("Unrecognized IP packet format"); |
242 } 243 // Should never reach here 244 return 0; 245} 246 247uint16_t 248cksum(const UdpPtr &udp) 249{ 250 if (IpPtr(udp.packet())) { 251 return __tu_cksum(IpPtr(udp.packet())); 252 } else if (Ip6Ptr(udp.packet())) { 253 return __tu_cksum6(Ip6Ptr(udp.packet())); 254 } else { | 243 } 244 // Should never reach here 245 return 0; 246} 247 248uint16_t 249cksum(const UdpPtr &udp) 250{ 251 if (IpPtr(udp.packet())) { 252 return __tu_cksum(IpPtr(udp.packet())); 253 } else if (Ip6Ptr(udp.packet())) { 254 return __tu_cksum6(Ip6Ptr(udp.packet())); 255 } else { |
255 assert(0); | 256 panic("Unrecognized IP packet format"); |
256 } 257 return 0; 258} 259 260bool 261IpHdr::options(vector<const IpOpt *> &vec) const 262{ 263 vec.clear(); --- 146 unchanged lines hidden --- | 257 } 258 return 0; 259} 260 261bool 262IpHdr::options(vector<const IpOpt *> &vec) const 263{ 264 vec.clear(); --- 146 unchanged lines hidden --- |