Deleted Added
sdiff udiff text old ( 11793:ef606668d247 ) new ( 13449:2f7efa89c58b )
full compact
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"
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 {
242 panic("Unrecognized IP packet format");
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 {
256 panic("Unrecognized IP packet format");
257 }
258 return 0;
259}
260
261bool
262IpHdr::options(vector<const IpOpt *> &vec) const
263{
264 vec.clear();

--- 146 unchanged lines hidden ---