Deleted Added
sdiff udiff text old ( 5484:dc6a459769a1 ) new ( 5761:94d56a48d7e3 )
full compact
1/*
2 * Copyright (c) 2002-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;

--- 148 unchanged lines hidden (view full) ---

157 uint16_t frag_off() const { return ntohs(ip_off) & 0x1fff; }
158 uint8_t ttl() const { return ip_ttl; }
159 uint8_t proto() const { return ip_p; }
160 uint16_t sum() const { return ip_sum; }
161 uint32_t src() const { return ntohl(ip_src); }
162 uint32_t dst() const { return ntohl(ip_dst); }
163
164 void sum(uint16_t sum) { ip_sum = sum; }
165
166 bool options(std::vector<const IpOpt *> &vec) const;
167
168 int size() const { return hlen(); }
169 const uint8_t *bytes() const { return (const uint8_t *)this; }
170 const uint8_t *payload() const { return bytes() + size(); }
171 uint8_t *bytes() { return (uint8_t *)this; }
172 uint8_t *payload() { return bytes() + size(); }
173};

--- 81 unchanged lines hidden (view full) ---

255 uint32_t ack() const { return ntohl(th_ack); }
256 uint8_t off() const { return th_off; }
257 uint8_t flags() const { return th_flags & 0x3f; }
258 uint16_t win() const { return ntohs(th_win); }
259 uint16_t sum() const { return th_sum; }
260 uint16_t urp() const { return ntohs(th_urp); }
261
262 void sum(uint16_t sum) { th_sum = sum; }
263
264 bool options(std::vector<const TcpOpt *> &vec) const;
265
266 int size() const { return off(); }
267 const uint8_t *bytes() const { return (const uint8_t *)this; }
268 const uint8_t *payload() const { return bytes() + size(); }
269 uint8_t *bytes() { return (uint8_t *)this; }
270 uint8_t *payload() { return bytes() + size(); }

--- 72 unchanged lines hidden (view full) ---

343struct UdpHdr : public udp_hdr
344{
345 uint16_t sport() const { return ntohs(uh_sport); }
346 uint16_t dport() const { return ntohs(uh_dport); }
347 uint16_t len() const { return ntohs(uh_ulen); }
348 uint16_t sum() const { return uh_sum; }
349
350 void sum(uint16_t sum) { uh_sum = sum; }
351
352 int size() const { return sizeof(udp_hdr); }
353 const uint8_t *bytes() const { return (const uint8_t *)this; }
354 const uint8_t *payload() const { return bytes() + size(); }
355 uint8_t *bytes() { return (uint8_t *)this; }
356 uint8_t *payload() { return bytes() + size(); }
357};
358

--- 42 unchanged lines hidden ---