gem5  v21.1.0.2
inet.hh
Go to the documentation of this file.
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
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2002-2005 The Regents of The University of Michigan
15  * Copyright (c) 2010 Advanced Micro Devices, Inc.
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #ifndef __BASE_INET_HH__
43 #define __BASE_INET_HH__
44 
45 #include <iosfwd>
46 #include <string>
47 #include <utility>
48 #include <vector>
49 
50 #include "base/compiler.hh"
51 #include "base/types.hh"
52 #include "dev/net/etherpkt.hh"
53 #include "dnet/os.h"
54 #include "dnet/eth.h"
55 #include "dnet/ip.h"
56 #include "dnet/ip6.h"
57 #include "dnet/addr.h"
58 #include "dnet/arp.h"
59 #include "dnet/icmp.h"
60 #include "dnet/tcp.h"
61 #include "dnet/udp.h"
62 #include "dnet/intf.h"
63 #include "dnet/route.h"
64 #include "dnet/fw.h"
65 #include "dnet/blob.h"
66 #include "dnet/rand.h"
67 
68 namespace gem5
69 {
70 
71 GEM5_DEPRECATED_NAMESPACE(Net, networking);
72 namespace networking
73 {
74 
75 /*
76  * Ethernet Stuff
77  */
78 struct EthAddr : protected eth_addr
79 {
80  protected:
81  void parse(const std::string &addr);
82 
83  public:
88  EthAddr();
89  EthAddr(const uint8_t ea[ETH_ADDR_LEN]);
90  EthAddr(const eth_addr &ea);
91  EthAddr(const std::string &addr);
92  const EthAddr &operator=(const eth_addr &ea);
93  const EthAddr &operator=(const std::string &addr); // end of api_inet
95 
99  int size() const { return sizeof(eth_addr); }
100 
101 
106  const uint8_t *bytes() const { return &data[0]; }
107  uint8_t *bytes() { return &data[0]; } // end of api_inet
109 
114  const uint8_t *addr() const { return &data[0]; }
115  bool unicast() const { return !(data[0] & 0x01); }
116  bool multicast() const { return !unicast() && !broadcast(); }
117  bool broadcast() const
118  {
119  bool isBroadcast = true;
120  for (int i = 0; i < ETH_ADDR_LEN; ++i) {
121  isBroadcast = isBroadcast && data[i] == 0xff;
122  }
123 
124  return isBroadcast;
125  } // end of api_inet
127 
131  std::string string() const;
132 
136  operator uint64_t() const
137  {
138  uint64_t reg = 0;
139  reg |= ((uint64_t)data[0]) << 40;
140  reg |= ((uint64_t)data[1]) << 32;
141  reg |= ((uint64_t)data[2]) << 24;
142  reg |= ((uint64_t)data[3]) << 16;
143  reg |= ((uint64_t)data[4]) << 8;
144  reg |= ((uint64_t)data[5]) << 0;
145  return reg;
146  }
147 
148 };
149 
154 std::ostream &operator<<(std::ostream &stream, const EthAddr &ea);
155 bool operator==(const EthAddr &left, const EthAddr &right); // end of api_inet
157 
158 struct EthHdr : public eth_hdr
159 {
160  bool isVlan() const { return (ntohs(eth_type) == ETH_TYPE_8021Q); }
161  uint16_t type() const {
162  if (!isVlan())
163  return ntohs(eth_type);
164  else
165  // L3 type is now 16 bytes into the hdr with 802.1Q
166  // instead of 12. dnet/eth.h only supports 802.1
167  return ntohs(*((uint16_t*)(((uint8_t *)this) + 16)));
168  }
169  uint16_t vlanId() const {
170  if (isVlan())
171  return ntohs(*((uint16_t*)(((uint8_t *)this) + 14)));
172  else
173  return 0x0000;
174  }
175 
176  const EthAddr &src() const { return *(EthAddr *)&eth_src; }
177  const EthAddr &dst() const { return *(EthAddr *)&eth_dst; }
178 
179  int size() const {
180  if (!isVlan())
181  return sizeof(eth_hdr);
182  else
183  return (sizeof(eth_hdr)+4);
184  }
185 
186  const uint8_t *bytes() const { return (const uint8_t *)this; }
187  const uint8_t *payload() const { return bytes() + size(); }
188  uint8_t *bytes() { return (uint8_t *)this; }
189  uint8_t *payload() { return bytes() + size(); }
190 };
191 
192 class EthPtr
193 {
194  protected:
195  friend class IpPtr;
196  friend class Ip6Ptr;
198 
199  public:
204  EthPtr() {}
205  EthPtr(const EthPacketPtr &ptr) : p(ptr) { } // end of api_inet
207 
208  EthHdr *operator->() { return (EthHdr *)p->data; }
209  EthHdr &operator*() { return *(EthHdr *)p->data; }
210  operator EthHdr *() { return (EthHdr *)p->data; }
211 
212  const EthHdr *operator->() const { return (const EthHdr *)p->data; }
213  const EthHdr &operator*() const { return *(const EthHdr *)p->data; }
214  operator const EthHdr *() const { return (const EthHdr *)p->data; }
215 
219  const EthPtr &operator=(const EthPacketPtr &ptr) { p = ptr; return *this; }
220 
225  const EthPacketPtr packet() const { return p; }
226  EthPacketPtr packet() { return p; }
227  bool operator!() const { return !p; }
228  operator bool() const { return (p != nullptr); }
229  int off() const { return 0; }
230  int pstart() const { return off() + ((const EthHdr*)p->data)->size(); } // end of api_inet
232 };
233 
234 /*
235  * IP Stuff
236  */
237 struct IpAddress
238 {
239  protected:
240  uint32_t _ip;
241 
242  public:
247  IpAddress() : _ip(0)
248  {}
249  IpAddress(const uint32_t __ip) : _ip(__ip)
250  {} // end of api_net
252 
256  uint32_t ip() const { return _ip; }
257 
261  std::string string() const;
262 };
263 
268 std::ostream &operator<<(std::ostream &stream, const IpAddress &ia);
269 bool operator==(const IpAddress &left, const IpAddress &right); // end of api_inet
271 
272 struct IpNetmask : public IpAddress
273 {
274  protected:
275  uint8_t _netmask;
276 
277  public:
279  {}
280  IpNetmask(const uint32_t __ip, const uint8_t __netmask) :
281  IpAddress(__ip), _netmask(__netmask)
282  {}
283 
287  uint8_t netmask() const { return _netmask; }
288 
289  std::string string() const;
290 };
291 
296 std::ostream &operator<<(std::ostream &stream, const IpNetmask &in);
297 bool operator==(const IpNetmask &left, const IpNetmask &right); // end of api_inet
299 
300 struct IpWithPort : public IpAddress
301 {
302  protected:
303  uint16_t _port;
304 
305  public:
307  {}
308  IpWithPort(const uint32_t __ip, const uint16_t __port) :
309  IpAddress(__ip), _port(__port)
310  {}
311 
315  uint8_t port() const { return _port; }
316 
317  std::string string() const;
318 };
319 
324 std::ostream &operator<<(std::ostream &stream, const IpWithPort &iwp);
325 bool operator==(const IpWithPort &left, const IpWithPort &right); // end of api_inet
327 
328 struct IpOpt;
329 struct IpHdr : public ip_hdr
330 {
331  uint8_t version() const { return ip_v; }
332  uint8_t hlen() const { return ip_hl * 4; }
333  uint8_t tos() const { return ip_tos; }
334  uint16_t len() const { return ntohs(ip_len); }
335  uint16_t id() const { return ntohs(ip_id); }
336  uint16_t frag_flags() const { return ntohs(ip_off) >> 13; }
337  uint16_t frag_off() const { return ntohs(ip_off) & 0x1fff; }
338  uint8_t ttl() const { return ip_ttl; }
339  uint8_t proto() const { return ip_p; }
340  uint16_t sum() const { return ip_sum; }
341  uint32_t src() const { return ntohl(ip_src); }
342  uint32_t dst() const { return ntohl(ip_dst); }
343 
344  void sum(uint16_t sum) { ip_sum = sum; }
345  void id(uint16_t _id) { ip_id = htons(_id); }
346  void len(uint16_t _len) { ip_len = htons(_len); }
347 
349 
350  int size() const { return hlen(); }
351  const uint8_t *bytes() const { return (const uint8_t *)this; }
352  const uint8_t *payload() const { return bytes() + size(); }
353  uint8_t *bytes() { return (uint8_t *)this; }
354  uint8_t *payload() { return bytes() + size(); }
355 };
356 
357 class IpPtr
358 {
359  protected:
360  friend class TcpPtr;
361  friend class UdpPtr;
364 
365  void set(const EthPacketPtr &ptr)
366  {
367  p = 0;
368  eth_hdr_vlan = false;
369 
370  if (ptr) {
371  EthHdr *eth = (EthHdr *)ptr->data;
372  if (eth->type() == ETH_TYPE_IP)
373  p = ptr;
374  if (eth->isVlan())
375  eth_hdr_vlan = true;
376  }
377  }
378 
379  public:
384  IpPtr() : p(0), eth_hdr_vlan(false) {}
385  IpPtr(const EthPacketPtr &ptr) : p(0), eth_hdr_vlan(false) { set(ptr); }
386  IpPtr(const EthPtr &ptr) : p(0), eth_hdr_vlan(false) { set(ptr.p); }
387  IpPtr(const IpPtr &ptr) : p(ptr.p), eth_hdr_vlan(ptr.eth_hdr_vlan) { } // end of api_inet
389 
390  IpHdr *get() { return (IpHdr *)(p->data + sizeof(eth_hdr) +
391  ((eth_hdr_vlan) ? 4 : 0)); }
392  IpHdr *operator->() { return get(); }
393  IpHdr &operator*() { return *get(); }
394 
399  const IpHdr *get() const
400  { return (const IpHdr *)(p->data + sizeof(eth_hdr) +
401  ((eth_hdr_vlan) ? 4 : 0)); }
402  const IpHdr *operator->() const { return get(); }
403  const IpHdr &operator*() const { return *get(); } // end of api_inet
405 
406  const IpPtr &operator=(const EthPacketPtr &ptr) { set(ptr); return *this; }
407  const IpPtr &operator=(const EthPtr &ptr) { set(ptr.p); return *this; }
408  const IpPtr &operator=(const IpPtr &ptr) { p = ptr.p; return *this; }
409 
414  const EthPacketPtr packet() const { return p; }
415  EthPacketPtr packet() { return p; }
416  bool operator!() const { return !p; }
417  operator bool() const { return (p != nullptr); }
418  int off() const { return (sizeof(eth_hdr) + ((eth_hdr_vlan) ? 4 : 0)); }
419  int pstart() const { return (off() + get()->size()); } // end of api_inet
421 };
422 
426 uint16_t cksum(const IpPtr &ptr);
427 
428 struct IpOpt : public ip_opt
429 {
430  uint8_t type() const { return opt_type; }
431  uint8_t typeNumber() const { return IP_OPT_NUMBER(opt_type); }
432  uint8_t typeClass() const { return IP_OPT_CLASS(opt_type); }
433  uint8_t typeCopied() const { return IP_OPT_COPIED(opt_type); }
434  uint8_t len() const { return IP_OPT_TYPEONLY(type()) ? 1 : opt_len; }
435 
436  bool isNumber(int num) const { return typeNumber() == IP_OPT_NUMBER(num); }
437  bool isClass(int cls) const { return typeClass() == IP_OPT_CLASS(cls); }
438  bool isCopied(int cpy) const { return typeCopied() == IP_OPT_COPIED(cpy); }
439 
440  const uint8_t *data() const { return opt_data.data8; }
441  void sec(ip_opt_data_sec &sec) const;
442  void lsrr(ip_opt_data_rr &rr) const;
443  void ssrr(ip_opt_data_rr &rr) const;
444  void ts(ip_opt_data_ts &ts) const;
445  uint16_t satid() const { return ntohs(opt_data.satid); }
446  uint16_t mtup() const { return ntohs(opt_data.mtu); }
447  uint16_t mtur() const { return ntohs(opt_data.mtu); }
448  void tr(ip_opt_data_tr &tr) const;
449  uint16_t rtralt() const { return ntohs(opt_data.rtralt); }
450  void sdb(std::vector<uint32_t> &vec) const;
451 };
452 
453 /*
454  * Ip6 Classes
455  */
456 struct Ip6Opt;
457 struct Ip6Hdr : public ip6_hdr
458 {
459  uint8_t version() const { return ip6_vfc; }
460  uint32_t flow() const { return ntohl(ip6_flow); }
461  uint16_t plen() const { return ntohs(ip6_plen); }
462  uint16_t hlen() const { return IP6_HDR_LEN; }
463  uint8_t nxt() const { return ip6_nxt; }
464  uint8_t hlim() const { return ip6_hlim; }
465 
466  const uint8_t* src() const { return ip6_src.data; }
467  const uint8_t* dst() const { return ip6_dst.data; }
468 
469  int extensionLength() const;
470  const Ip6Opt* getExt(uint8_t ext) const;
471  const Ip6Opt* fragmentExt() const { return getExt(IP_PROTO_FRAGMENT); }
472  const Ip6Opt* rtTypeExt() const { return getExt(IP_PROTO_ROUTING); }
473  const Ip6Opt* dstOptExt() const { return getExt(IP_PROTO_DSTOPTS); }
474  uint8_t proto() const;
475 
476  void plen(uint16_t _plen) { ip6_plen = htons(_plen); }
477 
478  int size() const { return IP6_HDR_LEN + extensionLength(); }
479  const uint8_t *bytes() const { return (const uint8_t *)this; }
480  const uint8_t *payload() const { return bytes() + IP6_HDR_LEN
481  + extensionLength(); }
482  uint8_t *bytes() { return (uint8_t *)this; }
483  uint8_t *payload() { return bytes() + IP6_HDR_LEN
484  + extensionLength(); }
485 };
486 
487 class Ip6Ptr
488 {
489  protected:
490  friend class TcpPtr;
491  friend class UdpPtr;
494 
495  void set(const EthPacketPtr &ptr)
496  {
497  p = 0;
498  eth_hdr_vlan = false;
499 
500  if (ptr) {
501  EthHdr *eth = (EthHdr *)ptr->data;
502  if (eth->type() == ETH_TYPE_IPV6)
503  p = ptr;
504  if (eth->isVlan())
505  eth_hdr_vlan = true;
506  }
507  }
508 
509  public:
514  Ip6Ptr() : p(0), eth_hdr_vlan(false) {}
515  Ip6Ptr(const EthPacketPtr &ptr) : p(0), eth_hdr_vlan(false) { set(ptr); }
516  Ip6Ptr(const EthPtr &ptr) : p(0), eth_hdr_vlan(false) { set(ptr.p); }
517  Ip6Ptr(const Ip6Ptr &ptr) : p(ptr.p), eth_hdr_vlan(ptr.eth_hdr_vlan) { } // end of api_inet
519 
520  Ip6Hdr *get() { return (Ip6Hdr *)(p->data + sizeof(eth_hdr)
521  + ((eth_hdr_vlan) ? 4 : 0)); }
522  Ip6Hdr *operator->() { return get(); }
523  Ip6Hdr &operator*() { return *get(); }
524 
525  const Ip6Hdr *get() const
526  { return (const Ip6Hdr *)(p->data + sizeof(eth_hdr)
527  + ((eth_hdr_vlan) ? 4 : 0)); }
528  const Ip6Hdr *operator->() const { return get(); }
529  const Ip6Hdr &operator*() const { return *get(); }
530 
535  const Ip6Ptr &operator=(const EthPacketPtr &ptr)
536  { set(ptr); return *this; }
537  const Ip6Ptr &operator=(const EthPtr &ptr)
538  { set(ptr.p); return *this; }
539  const Ip6Ptr &operator=(const Ip6Ptr &ptr)
540  { p = ptr.p; return *this; } // end of api_inet
542 
547  const EthPacketPtr packet() const { return p; }
548  EthPacketPtr packet() { return p; }
549  bool operator!() const { return !p; }
550  operator bool() const { return (p != nullptr); }
551  int off() const { return sizeof(eth_hdr) + ((eth_hdr_vlan) ? 4 : 0); }
552  int pstart() const { return off() + get()->size(); } // end of api_inet
554 };
555 
556 // Dnet supplied ipv6 opt header is incomplete and
557 // newer NIC card filters expect a more robust
558 // ipv6 header option declaration.
560 {
561  uint16_t offlg;
562  uint32_t ident;
563 };
564 
566 {
567  uint8_t type;
568  uint8_t segleft;
569  uint32_t reserved;
570  ip6_addr_t addr;
571 };
572 
573 struct GEM5_PACKED ip6_opt_dstopts
574 {
575  uint8_t type;
576  uint8_t length;
577  ip6_addr_t addr;
578 };
579 
580 struct GEM5_PACKED ip6_opt_hdr
581 {
582  uint8_t ext_nxt;
583  uint8_t ext_len;
584  union
585  {
586  struct ip6_opt_fragment fragment;
587  struct ip6_opt_routing_type2 rtType2;
588  struct ip6_opt_dstopts dstOpts;
589  } ext_data;
590 };
591 
592 struct Ip6Opt : public ip6_opt_hdr
593 {
594  uint8_t nxt() const { return ext_nxt; }
595  uint8_t extlen() const { return ext_len; }
596  uint8_t len() const { return extlen() + 8; }
597 
598  // Supporting the types of header extensions likely to be encountered:
599  // fragment, routing type 2 and dstopts.
600 
601  // Routing type 2
602  uint8_t rtType2Type() const { return ext_data.rtType2.type; }
603  uint8_t rtType2SegLft() const { return ext_data.rtType2.segleft; }
604  const uint8_t* rtType2Addr() const { return ext_data.rtType2.addr.data; }
605 
606  // Fragment
607  uint16_t fragmentOfflg() const { return ntohs(ext_data.fragment.offlg); }
608  uint32_t fragmentIdent() const { return ntohl(ext_data.fragment.ident); }
609 
610  // Dst Options/Home Address Option
611  uint8_t dstOptType() const { return ext_data.dstOpts.type; }
612  uint8_t dstOptLength() const { return ext_data.dstOpts.length; }
613  const uint8_t* dstOptAddr() const { return ext_data.dstOpts.addr.data; }
614 };
615 
616 
617 /*
618  * TCP Stuff
619  */
620 struct TcpOpt;
621 struct TcpHdr : public tcp_hdr
622 {
623  uint16_t sport() const { return ntohs(th_sport); }
624  uint16_t dport() const { return ntohs(th_dport); }
625  uint32_t seq() const { return ntohl(th_seq); }
626  uint32_t ack() const { return ntohl(th_ack); }
627  uint8_t off() const { return th_off*4; }
628  uint8_t flags() const { return th_flags & 0x3f; }
629  uint16_t win() const { return ntohs(th_win); }
630  uint16_t sum() const { return th_sum; }
631  uint16_t urp() const { return ntohs(th_urp); }
632 
633  void sum(uint16_t sum) { th_sum = sum; }
634  void seq(uint32_t _seq) { th_seq = htonl(_seq); }
635  void flags(uint8_t _flags) { th_flags = _flags; }
636 
638 
639  int size() const { return off(); }
640  const uint8_t *bytes() const { return (const uint8_t *)this; }
641  const uint8_t *payload() const { return bytes() + size(); }
642  uint8_t *bytes() { return (uint8_t *)this; }
643  uint8_t *payload() { return bytes() + size(); }
644 };
645 
646 class TcpPtr
647 {
648  protected:
650  int _off;
651 
652  void set(const EthPacketPtr &ptr, int offset) { p = ptr; _off = offset; }
653  void set(const IpPtr &ptr)
654  {
655  if (ptr && ptr->proto() == IP_PROTO_TCP)
656  set(ptr.p, ptr.pstart());
657  else
658  set(0, 0);
659  }
660  void set(const Ip6Ptr &ptr)
661  {
662  if (ptr && ptr->proto() == IP_PROTO_TCP)
663  set(ptr.p, ptr.pstart());
664  else
665  set(0, 0);
666  }
667 
668  public:
673  TcpPtr() : p(0), _off(0) {}
674  TcpPtr(const IpPtr &ptr) : p(0), _off(0) { set(ptr); }
675  TcpPtr(const Ip6Ptr &ptr) : p(0), _off(0) { set(ptr); }
676  TcpPtr(const TcpPtr &ptr) : p(ptr.p), _off(ptr._off) {} // end of api_inet
678 
679  TcpHdr *get() { return (TcpHdr *)(p->data + _off); }
680  TcpHdr *operator->() { return get(); }
681  TcpHdr &operator*() { return *get(); }
682 
683  const TcpHdr *get() const { return (const TcpHdr *)(p->data + _off); }
684  const TcpHdr *operator->() const { return get(); }
685  const TcpHdr &operator*() const { return *get(); }
686 
691  const TcpPtr &operator=(const IpPtr &i)
692  { set(i); return *this; }
693  const TcpPtr &operator=(const TcpPtr &t)
694  { set(t.p, t._off); return *this; } // end of api_inet
696 
701  const EthPacketPtr packet() const { return p; }
702  EthPacketPtr packet() { return p; }
703  bool operator!() const { return !p; }
704  operator bool() const { return (p != nullptr); }
705  int off() const { return _off; }
706  int pstart() const { return off() + get()->size(); } // end of api_inet
708 };
709 
713 uint16_t cksum(const TcpPtr &ptr);
714 
715 struct TcpOpt : public tcp_opt
716 {
717  uint8_t type() const { return opt_type; }
718  uint8_t len() const { return TCP_OPT_TYPEONLY(type()) ? 1 : opt_len; }
719 
720  bool isopt(int opt) const { return type() == opt; }
721 
722  const uint8_t *data() const { return opt_data.data8; }
723 
724  uint16_t mss() const { return ntohs(opt_data.mss); }
725  uint8_t wscale() const { return opt_data.wscale; }
726  uint32_t echo() const { return ntohl(opt_data.echo); }
727  uint32_t tsval() const { return ntohl(opt_data.timestamp[0]); }
728  uint32_t tsecr() const { return ntohl(opt_data.timestamp[1]); }
729  uint32_t cc() const { return ntohl(opt_data.cc); }
730  uint8_t cksum() const{ return opt_data.cksum; }
731  const uint8_t *md5() const { return opt_data.md5; }
732 
733  int size() const { return len(); }
734  const uint8_t *bytes() const { return (const uint8_t *)this; }
735  const uint8_t *payload() const { return bytes() + size(); }
736  uint8_t *bytes() { return (uint8_t *)this; }
737  uint8_t *payload() { return bytes() + size(); }
738 };
739 
740 /*
741  * UDP Stuff
742  */
743 struct UdpHdr : public udp_hdr
744 {
745  uint16_t sport() const { return ntohs(uh_sport); }
746  uint16_t dport() const { return ntohs(uh_dport); }
747  uint16_t len() const { return ntohs(uh_ulen); }
748  uint16_t sum() const { return uh_sum; }
749 
750  void sum(uint16_t sum) { uh_sum = sum; }
751  void len(uint16_t _len) { uh_ulen = htons(_len); }
752 
753  int size() const { return sizeof(udp_hdr); }
754  const uint8_t *bytes() const { return (const uint8_t *)this; }
755  const uint8_t *payload() const { return bytes() + size(); }
756  uint8_t *bytes() { return (uint8_t *)this; }
757  uint8_t *payload() { return bytes() + size(); }
758 };
759 
760 class UdpPtr
761 {
762  protected:
764  int _off;
765 
766  void set(const EthPacketPtr &ptr, int offset) { p = ptr; _off = offset; }
767  void set(const IpPtr &ptr)
768  {
769  if (ptr && ptr->proto() == IP_PROTO_UDP)
770  set(ptr.p, ptr.pstart());
771  else
772  set(0, 0);
773  }
774  void set(const Ip6Ptr &ptr)
775  {
776  if (ptr && ptr->proto() == IP_PROTO_UDP)
777  set(ptr.p, ptr.pstart());
778  else
779  set(0, 0);
780  }
781 
782  public:
786  UdpPtr() : p(0), _off(0) {}
787  UdpPtr(const IpPtr &ptr) : p(0), _off(0) { set(ptr); }
788  UdpPtr(const Ip6Ptr &ptr) : p(0), _off(0) { set(ptr); }
789  UdpPtr(const UdpPtr &ptr) : p(ptr.p), _off(ptr._off) {} // end of api_inet
791 
792  UdpHdr *get() { return (UdpHdr *)(p->data + _off); }
793  UdpHdr *operator->() { return get(); }
794  UdpHdr &operator*() { return *get(); }
795 
796  const UdpHdr *get() const { return (const UdpHdr *)(p->data + _off); }
797  const UdpHdr *operator->() const { return get(); }
798  const UdpHdr &operator*() const { return *get(); }
799 
804  const UdpPtr &operator=(const IpPtr &i) { set(i); return *this; }
805  const UdpPtr &operator=(const UdpPtr &t)
806  { set(t.p, t._off); return *this; } // end of api_inet
808 
813  const EthPacketPtr packet() const { return p; }
814  EthPacketPtr packet() { return p; }
815  bool operator!() const { return !p; }
816  operator bool() const { return (p != nullptr); }
817  int off() const { return _off; }
818  int pstart() const { return off() + get()->size(); } // end of api_inet
820 };
821 
826 uint16_t __tu_cksum6(const Ip6Ptr &ip6);
827 uint16_t __tu_cksum(const IpPtr &ip);
828 uint16_t cksum(const UdpPtr &ptr); // end of api_inet
830 
834 int hsplit(const EthPacketPtr &ptr);
835 
836 } // namespace networking
837 } // namespace gem5
838 
839 #endif // __BASE_INET_HH__
gem5::networking::EthHdr::type
uint16_t type() const
Definition: inet.hh:161
gem5::networking::Ip6Hdr::dstOptExt
const Ip6Opt * dstOptExt() const
Definition: inet.hh:473
gem5::networking::IpHdr::bytes
const uint8_t * bytes() const
Definition: inet.hh:351
gem5::MipsISA::ip6
Bitfield< 14 > ip6
Definition: pra_constants.hh:190
gem5::networking::TcpOpt::echo
uint32_t echo() const
Definition: inet.hh:726
gem5::networking::IpAddress
Definition: inet.hh:237
gem5::networking::Ip6Ptr::set
void set(const EthPacketPtr &ptr)
Definition: inet.hh:495
gem5::networking::TcpHdr::dport
uint16_t dport() const
Definition: inet.hh:624
gem5::networking::IpHdr::id
void id(uint16_t _id)
Definition: inet.hh:345
gem5::networking::TcpPtr::p
EthPacketPtr p
Definition: inet.hh:649
gem5::networking::TcpOpt::cc
uint32_t cc() const
Definition: inet.hh:729
gem5::networking::Ip6Opt::extlen
uint8_t extlen() const
Definition: inet.hh:595
gem5::networking::UdpHdr::sum
void sum(uint16_t sum)
Definition: inet.hh:750
gem5::networking::IpOpt::satid
uint16_t satid() const
Definition: inet.hh:445
gem5::networking::TcpHdr
Definition: inet.hh:621
gem5::networking::UdpPtr::operator->
const UdpHdr * operator->() const
Definition: inet.hh:797
gem5::networking::IpPtr::operator*
IpHdr & operator*()
Definition: inet.hh:393
gem5::networking::UdpPtr::off
int off() const
Definition: inet.hh:817
gem5::networking::TcpPtr::packet
EthPacketPtr packet()
Definition: inet.hh:702
gem5::networking::ip6_opt_dstopts::type
uint8_t type
Definition: inet.hh:575
gem5::networking::TcpPtr::TcpPtr
TcpPtr(const IpPtr &ptr)
Definition: inet.hh:674
gem5::networking::UdpPtr::get
UdpHdr * get()
Definition: inet.hh:792
gem5::networking::TcpHdr::sum
void sum(uint16_t sum)
Definition: inet.hh:633
gem5::networking::Ip6Opt::rtType2Type
uint8_t rtType2Type() const
Definition: inet.hh:602
gem5::networking::TcpOpt::mss
uint16_t mss() const
Definition: inet.hh:724
gem5::networking::TcpOpt
Definition: inet.hh:715
gem5::networking::IpPtr::operator!
bool operator!() const
Definition: inet.hh:416
gem5::networking::UdpHdr::size
int size() const
Definition: inet.hh:753
gem5::networking::IpOpt::ts
void ts(ip_opt_data_ts &ts) const
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::networking::UdpPtr::_off
int _off
Definition: inet.hh:764
gem5::networking::Ip6Hdr::extensionLength
int extensionLength() const
Definition: inet.cc:299
gem5::networking::Ip6Opt::fragmentOfflg
uint16_t fragmentOfflg() const
Definition: inet.hh:607
gem5::networking::EthAddr::string
std::string string() const
Definition: inet.cc:119
gem5::networking::operator<<
std::ostream & operator<<(std::ostream &stream, const EthAddr &ea)
Definition: inet.cc:133
gem5::networking::IpHdr::proto
uint8_t proto() const
Definition: inet.hh:339
gem5::networking::IpAddress::IpAddress
IpAddress(const uint32_t __ip)
Definition: inet.hh:249
gem5::networking::IpWithPort::_port
uint16_t _port
Definition: inet.hh:303
gem5::networking::IpHdr::len
uint16_t len() const
Definition: inet.hh:334
gem5::networking::IpOpt::tr
void tr(ip_opt_data_tr &tr) const
gem5::networking::EthPtr::operator*
const EthHdr & operator*() const
Definition: inet.hh:213
gem5::networking::Ip6Hdr::version
uint8_t version() const
Definition: inet.hh:459
gem5::networking::IpHdr::src
uint32_t src() const
Definition: inet.hh:341
gem5::networking::TcpHdr::seq
uint32_t seq() const
Definition: inet.hh:625
gem5::networking::IpHdr::payload
uint8_t * payload()
Definition: inet.hh:354
gem5::networking::TcpOpt::tsval
uint32_t tsval() const
Definition: inet.hh:727
gem5::networking::cksum
uint16_t cksum(const IpPtr &ptr)
Definition: inet.cc:208
gem5::networking::Ip6Hdr::payload
uint8_t * payload()
Definition: inet.hh:483
gem5::networking::TcpHdr::ack
uint32_t ack() const
Definition: inet.hh:626
gem5::networking::Ip6Hdr::proto
uint8_t proto() const
Definition: inet.cc:348
gem5::networking::EthHdr::isVlan
bool isVlan() const
Definition: inet.hh:160
gem5::networking::Ip6Hdr::getExt
const Ip6Opt * getExt(uint8_t ext) const
Definition: inet.cc:322
gem5::networking::hsplit
int hsplit(const EthPacketPtr &ptr)
Definition: inet.cc:386
gem5::networking::ip6_opt_dstopts
Definition: inet.hh:573
gem5::networking::EthAddr::unicast
bool unicast() const
Definition: inet.hh:115
gem5::networking::IpHdr::frag_flags
uint16_t frag_flags() const
Definition: inet.hh:336
gem5::networking::ip6_opt_fragment::offlg
uint16_t offlg
Definition: inet.hh:561
gem5::networking::IpOpt::typeNumber
uint8_t typeNumber() const
Definition: inet.hh:431
gem5::networking::Ip6Ptr::operator->
Ip6Hdr * operator->()
Definition: inet.hh:522
gem5::networking::IpPtr::eth_hdr_vlan
bool eth_hdr_vlan
Definition: inet.hh:363
gem5::networking::UdpPtr::operator*
const UdpHdr & operator*() const
Definition: inet.hh:798
gem5::networking::UdpHdr
Definition: inet.hh:743
gem5::networking::Ip6Ptr::get
Ip6Hdr * get()
Definition: inet.hh:520
gem5::networking::IpPtr::operator=
const IpPtr & operator=(const IpPtr &ptr)
Definition: inet.hh:408
gem5::networking::EthHdr
Definition: inet.hh:158
gem5::networking::TcpHdr::sum
uint16_t sum() const
Definition: inet.hh:630
gem5::networking::Ip6Ptr
Definition: inet.hh:487
gem5::networking::IpOpt::lsrr
void lsrr(ip_opt_data_rr &rr) const
gem5::networking::ip6_opt_routing_type2
Definition: inet.hh:565
gem5::networking::EthPtr::pstart
int pstart() const
Definition: inet.hh:230
gem5::networking::UdpPtr::operator=
const UdpPtr & operator=(const IpPtr &i)
Definition: inet.hh:804
gem5::networking::IpHdr::options
bool options(std::vector< const IpOpt * > &vec) const
Definition: inet.cc:262
gem5::networking::EthHdr::bytes
const uint8_t * bytes() const
Definition: inet.hh:186
gem5::networking::Ip6Opt::dstOptType
uint8_t dstOptType() const
Definition: inet.hh:611
gem5::networking::TcpPtr::get
TcpHdr * get()
Definition: inet.hh:679
gem5::networking::UdpPtr::packet
const EthPacketPtr packet() const
Definition: inet.hh:813
gem5::networking::IpNetmask
Definition: inet.hh:272
gem5::networking::IpHdr::version
uint8_t version() const
Definition: inet.hh:331
gem5::networking::IpHdr::ttl
uint8_t ttl() const
Definition: inet.hh:338
gem5::networking::TcpPtr::operator*
const TcpHdr & operator*() const
Definition: inet.hh:685
gem5::networking::IpWithPort
Definition: inet.hh:300
gem5::networking::Ip6Ptr::operator->
const Ip6Hdr * operator->() const
Definition: inet.hh:528
std::vector
STL vector class.
Definition: stl.hh:37
gem5::networking::Ip6Hdr::flow
uint32_t flow() const
Definition: inet.hh:460
gem5::networking::Ip6Ptr::operator*
const Ip6Hdr & operator*() const
Definition: inet.hh:529
gem5::networking::Ip6Ptr::operator=
const Ip6Ptr & operator=(const EthPtr &ptr)
Definition: inet.hh:537
gem5::networking::TcpPtr::set
void set(const Ip6Ptr &ptr)
Definition: inet.hh:660
gem5::networking::Ip6Ptr::Ip6Ptr
Ip6Ptr()
Definition: inet.hh:514
gem5::networking::Ip6Ptr::eth_hdr_vlan
bool eth_hdr_vlan
Definition: inet.hh:493
gem5::networking::UdpHdr::bytes
uint8_t * bytes()
Definition: inet.hh:756
gem5::networking::TcpOpt::payload
uint8_t * payload()
Definition: inet.hh:737
gem5::networking::EthHdr::dst
const EthAddr & dst() const
Definition: inet.hh:177
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:66
gem5::networking::EthAddr::size
int size() const
Definition: inet.hh:99
gem5::networking::TcpPtr::off
int off() const
Definition: inet.hh:705
gem5::networking::operator==
bool operator==(const EthAddr &left, const EthAddr &right)
Definition: inet.cc:127
gem5::networking::TcpOpt::type
uint8_t type() const
Definition: inet.hh:717
gem5::networking::UdpPtr::set
void set(const Ip6Ptr &ptr)
Definition: inet.hh:774
gem5::networking::IpPtr::IpPtr
IpPtr(const EthPtr &ptr)
Definition: inet.hh:386
gem5::networking::Ip6Ptr::off
int off() const
Definition: inet.hh:551
gem5::networking::TcpOpt::len
uint8_t len() const
Definition: inet.hh:718
gem5::networking::TcpPtr::packet
const EthPacketPtr packet() const
Definition: inet.hh:701
gem5::networking::IpOpt::mtup
uint16_t mtup() const
Definition: inet.hh:446
gem5::networking::TcpOpt::size
int size() const
Definition: inet.hh:733
gem5::networking::IpPtr::get
IpHdr * get()
Definition: inet.hh:390
gem5::networking::TcpOpt::bytes
const uint8_t * bytes() const
Definition: inet.hh:734
gem5::networking::IpPtr::set
void set(const EthPacketPtr &ptr)
Definition: inet.hh:365
gem5::networking::EthPtr::p
EthPacketPtr p
Definition: inet.hh:197
gem5::networking::IpOpt::typeCopied
uint8_t typeCopied() const
Definition: inet.hh:433
gem5::networking::Ip6Hdr::payload
const uint8_t * payload() const
Definition: inet.hh:480
gem5::MipsISA::ia
Bitfield< 18, 16 > ia
Definition: pra_constants.hh:237
gem5::networking::EthAddr::multicast
bool multicast() const
Definition: inet.hh:116
gem5::networking::Ip6Hdr::src
const uint8_t * src() const
Definition: inet.hh:466
gem5::networking::EthAddr::parse
void parse(const std::string &addr)
Definition: inet.cc:97
gem5::networking::Ip6Ptr::p
EthPacketPtr p
Definition: inet.hh:492
gem5::networking::IpHdr::sum
void sum(uint16_t sum)
Definition: inet.hh:344
gem5::networking::IpOpt::sec
void sec(ip_opt_data_sec &sec) const
gem5::networking::UdpPtr::get
const UdpHdr * get() const
Definition: inet.hh:796
gem5::networking::TcpHdr::options
bool options(std::vector< const TcpOpt * > &vec) const
Definition: inet.cc:365
gem5::networking::IpOpt::isCopied
bool isCopied(int cpy) const
Definition: inet.hh:438
gem5::networking::IpOpt
Definition: inet.hh:428
gem5::networking::UdpPtr::operator=
const UdpPtr & operator=(const UdpPtr &t)
Definition: inet.hh:805
gem5::networking::UdpPtr::pstart
int pstart() const
Definition: inet.hh:818
gem5::networking::Ip6Ptr::operator!
bool operator!() const
Definition: inet.hh:549
gem5::networking::TcpOpt::cksum
uint8_t cksum() const
Definition: inet.hh:730
gem5::networking::TcpPtr::_off
int _off
Definition: inet.hh:650
gem5::networking::EthHdr::vlanId
uint16_t vlanId() const
Definition: inet.hh:169
gem5::networking::IpNetmask::netmask
uint8_t netmask() const
Definition: inet.hh:287
gem5::networking::IpPtr::operator->
const IpHdr * operator->() const
Definition: inet.hh:402
gem5::networking::UdpPtr::UdpPtr
UdpPtr(const IpPtr &ptr)
Definition: inet.hh:787
gem5::networking::IpNetmask::IpNetmask
IpNetmask(const uint32_t __ip, const uint8_t __netmask)
Definition: inet.hh:280
gem5::networking::TcpOpt::md5
const uint8_t * md5() const
Definition: inet.hh:731
gem5::networking::IpNetmask::string
std::string string() const
Definition: inet.cc:165
gem5::networking::EthHdr::bytes
uint8_t * bytes()
Definition: inet.hh:188
gem5::networking::TcpOpt::payload
const uint8_t * payload() const
Definition: inet.hh:735
gem5::EthPacketPtr
std::shared_ptr< EthPacketData > EthPacketPtr
Definition: etherpkt.hh:90
gem5::networking::EthAddr::EthAddr
EthAddr()
Definition: inet.cc:60
gem5::networking::TcpPtr::operator=
const TcpPtr & operator=(const IpPtr &i)
Definition: inet.hh:691
gem5::networking::Ip6Hdr::rtTypeExt
const Ip6Opt * rtTypeExt() const
Definition: inet.hh:472
gem5::networking::IpHdr::payload
const uint8_t * payload() const
Definition: inet.hh:352
gem5::networking::IpOpt::len
uint8_t len() const
Definition: inet.hh:434
gem5::networking::IpPtr::operator*
const IpHdr & operator*() const
Definition: inet.hh:403
gem5::networking::__tu_cksum6
uint16_t __tu_cksum6(const Ip6Ptr &ip6)
Definition: inet.cc:225
gem5::networking::IpPtr::operator=
const IpPtr & operator=(const EthPacketPtr &ptr)
Definition: inet.hh:406
gem5::networking::IpPtr
Definition: inet.hh:357
gem5::networking::UdpPtr::UdpPtr
UdpPtr(const Ip6Ptr &ptr)
Definition: inet.hh:788
gem5::networking::IpHdr::frag_off
uint16_t frag_off() const
Definition: inet.hh:337
gem5::networking::Ip6Hdr::bytes
const uint8_t * bytes() const
Definition: inet.hh:479
gem5::networking::EthAddr
Definition: inet.hh:78
gem5::networking::UdpPtr::operator!
bool operator!() const
Definition: inet.hh:815
gem5::networking::EthAddr::broadcast
bool broadcast() const
Definition: inet.hh:117
gem5::networking::ip6_opt_hdr::ext_len
uint8_t ext_len
Definition: inet.hh:583
gem5::networking::TcpHdr::payload
uint8_t * payload()
Definition: inet.hh:643
gem5::networking::Ip6Opt::fragmentIdent
uint32_t fragmentIdent() const
Definition: inet.hh:608
gem5::networking::TcpPtr::TcpPtr
TcpPtr()
Definition: inet.hh:673
gem5::networking::EthHdr::payload
const uint8_t * payload() const
Definition: inet.hh:187
gem5::networking::ip6_opt_routing_type2::segleft
uint8_t segleft
Definition: inet.hh:568
gem5::networking::UdpPtr::UdpPtr
UdpPtr(const UdpPtr &ptr)
Definition: inet.hh:789
gem5::networking::IpPtr::get
const IpHdr * get() const
Definition: inet.hh:399
gem5::networking::EthPtr::operator*
EthHdr & operator*()
Definition: inet.hh:209
gem5::networking::EthPtr::packet
EthPacketPtr packet()
Definition: inet.hh:226
gem5::networking::ip6_opt_hdr::ext_nxt
uint8_t ext_nxt
Definition: inet.hh:582
gem5::networking::EthHdr::payload
uint8_t * payload()
Definition: inet.hh:189
gem5::networking::TcpPtr::TcpPtr
TcpPtr(const TcpPtr &ptr)
Definition: inet.hh:676
gem5::networking::IpHdr
Definition: inet.hh:329
gem5::networking::IpNetmask::_netmask
uint8_t _netmask
Definition: inet.hh:275
gem5::networking::TcpHdr::flags
void flags(uint8_t _flags)
Definition: inet.hh:635
gem5::networking::UdpPtr::p
EthPacketPtr p
Definition: inet.hh:763
gem5::networking::Ip6Ptr::operator*
Ip6Hdr & operator*()
Definition: inet.hh:523
gem5::networking::EthPtr::operator!
bool operator!() const
Definition: inet.hh:227
gem5::ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:144
gem5::networking::EthAddr::operator=
const EthAddr & operator=(const eth_addr &ea)
Definition: inet.cc:83
gem5::networking::IpPtr::IpPtr
IpPtr(const IpPtr &ptr)
Definition: inet.hh:387
gem5::networking::UdpPtr::set
void set(const EthPacketPtr &ptr, int offset)
Definition: inet.hh:766
gem5::networking::IpOpt::data
const uint8_t * data() const
Definition: inet.hh:440
compiler.hh
gem5::networking::TcpOpt::wscale
uint8_t wscale() const
Definition: inet.hh:725
gem5::networking::IpAddress::_ip
uint32_t _ip
Definition: inet.hh:240
gem5::networking::Ip6Ptr::Ip6Ptr
Ip6Ptr(const Ip6Ptr &ptr)
Definition: inet.hh:517
gem5::networking::EthPtr::operator->
const EthHdr * operator->() const
Definition: inet.hh:212
gem5::networking::IpNetmask::IpNetmask
IpNetmask()
Definition: inet.hh:278
gem5::networking::Ip6Opt::dstOptAddr
const uint8_t * dstOptAddr() const
Definition: inet.hh:613
gem5::networking::IpPtr::operator->
IpHdr * operator->()
Definition: inet.hh:392
gem5::ArmISA::ext
Bitfield< 12 > ext
Definition: misc_types.hh:427
gem5::networking::Ip6Ptr::operator=
const Ip6Ptr & operator=(const EthPacketPtr &ptr)
Definition: inet.hh:535
gem5::networking::Ip6Opt::rtType2Addr
const uint8_t * rtType2Addr() const
Definition: inet.hh:604
gem5::ArmISA::t
Bitfield< 5 > t
Definition: misc_types.hh:70
gem5::networking::UdpPtr::operator*
UdpHdr & operator*()
Definition: inet.hh:794
gem5::networking::UdpHdr::len
uint16_t len() const
Definition: inet.hh:747
gem5::networking::TcpOpt::isopt
bool isopt(int opt) const
Definition: inet.hh:720
gem5::networking::IpHdr::len
void len(uint16_t _len)
Definition: inet.hh:346
gem5::networking::TcpHdr::sport
uint16_t sport() const
Definition: inet.hh:623
gem5::networking::TcpHdr::bytes
uint8_t * bytes()
Definition: inet.hh:642
gem5::networking::EthPtr::off
int off() const
Definition: inet.hh:229
gem5::networking::EthPtr::operator=
const EthPtr & operator=(const EthPacketPtr &ptr)
Definition: inet.hh:219
gem5::networking::IpPtr::operator=
const IpPtr & operator=(const EthPtr &ptr)
Definition: inet.hh:407
gem5::networking::ip6_opt_dstopts::addr
ip6_addr_t addr
Definition: inet.hh:577
gem5::igbreg::txd_op::ip
bool ip(TxDesc *d)
Definition: i8254xGBe_defs.hh:277
gem5::networking::IpOpt::mtur
uint16_t mtur() const
Definition: inet.hh:447
gem5::networking::UdpHdr::dport
uint16_t dport() const
Definition: inet.hh:746
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::networking::TcpHdr::urp
uint16_t urp() const
Definition: inet.hh:631
gem5::networking::Ip6Hdr::hlen
uint16_t hlen() const
Definition: inet.hh:462
gem5::networking::EthPtr::EthPtr
EthPtr()
Definition: inet.hh:204
gem5::networking::TcpHdr::win
uint16_t win() const
Definition: inet.hh:629
gem5::networking::UdpHdr::payload
uint8_t * payload()
Definition: inet.hh:757
gem5::networking::Ip6Ptr::packet
const EthPacketPtr packet() const
Definition: inet.hh:547
gem5::networking::Ip6Hdr::size
int size() const
Definition: inet.hh:478
gem5::networking::Ip6Opt::dstOptLength
uint8_t dstOptLength() const
Definition: inet.hh:612
gem5::ArmISA::rr
Bitfield< 14 > rr
Definition: misc_types.hh:368
gem5::networking::Ip6Hdr::fragmentExt
const Ip6Opt * fragmentExt() const
Definition: inet.hh:471
gem5::networking::IpOpt::isNumber
bool isNumber(int num) const
Definition: inet.hh:436
gem5::networking::ip6_opt_routing_type2::type
uint8_t type
Definition: inet.hh:567
gem5::networking::Ip6Ptr::get
const Ip6Hdr * get() const
Definition: inet.hh:525
gem5::X86ISA::reg
Bitfield< 5, 3 > reg
Definition: types.hh:92
gem5::networking::UdpPtr::UdpPtr
UdpPtr()
Definition: inet.hh:786
gem5::networking::IpWithPort::string
std::string string() const
Definition: inet.cc:187
gem5::networking::IpPtr::packet
EthPacketPtr packet()
Definition: inet.hh:415
gem5::networking::IpWithPort::IpWithPort
IpWithPort()
Definition: inet.hh:306
gem5::networking::TcpHdr::off
uint8_t off() const
Definition: inet.hh:627
gem5::networking::TcpPtr::operator!
bool operator!() const
Definition: inet.hh:703
gem5::networking::IpPtr::IpPtr
IpPtr(const EthPacketPtr &ptr)
Definition: inet.hh:385
gem5::networking::IpPtr::IpPtr
IpPtr()
Definition: inet.hh:384
gem5::networking::Ip6Opt::nxt
uint8_t nxt() const
Definition: inet.hh:594
gem5::networking::Ip6Opt::rtType2SegLft
uint8_t rtType2SegLft() const
Definition: inet.hh:603
gem5::networking::IpOpt::ssrr
void ssrr(ip_opt_data_rr &rr) const
gem5::networking::IpHdr::tos
uint8_t tos() const
Definition: inet.hh:333
gem5::networking::IpOpt::isClass
bool isClass(int cls) const
Definition: inet.hh:437
gem5::networking::Ip6Hdr::hlim
uint8_t hlim() const
Definition: inet.hh:464
gem5::networking::IpAddress::IpAddress
IpAddress()
Definition: inet.hh:247
gem5::networking::EthAddr::bytes
const uint8_t * bytes() const
Definition: inet.hh:106
gem5::networking::UdpPtr::packet
EthPacketPtr packet()
Definition: inet.hh:814
types.hh
gem5::networking::TcpPtr::operator->
const TcpHdr * operator->() const
Definition: inet.hh:684
gem5::networking::IpOpt::rtralt
uint16_t rtralt() const
Definition: inet.hh:449
gem5::networking::UdpPtr::operator->
UdpHdr * operator->()
Definition: inet.hh:793
gem5::networking::UdpHdr::bytes
const uint8_t * bytes() const
Definition: inet.hh:754
gem5::PowerISA::vec
Bitfield< 25 > vec
Definition: misc.hh:108
gem5::networking::TcpPtr::get
const TcpHdr * get() const
Definition: inet.hh:683
gem5::networking::EthPtr::packet
const EthPacketPtr packet() const
Definition: inet.hh:225
gem5::networking::TcpHdr::flags
uint8_t flags() const
Definition: inet.hh:628
gem5::networking::Ip6Hdr
Definition: inet.hh:457
gem5::networking::EthPtr::operator->
EthHdr * operator->()
Definition: inet.hh:208
gem5::networking::EthAddr::bytes
uint8_t * bytes()
Definition: inet.hh:107
gem5::networking::ip6_opt_fragment
Definition: inet.hh:559
gem5::networking::__tu_cksum
uint16_t __tu_cksum(const IpPtr &ip)
Definition: inet.cc:215
gem5::networking::TcpPtr::pstart
int pstart() const
Definition: inet.hh:706
gem5::networking::TcpPtr::set
void set(const IpPtr &ptr)
Definition: inet.hh:653
gem5::networking::IpHdr::dst
uint32_t dst() const
Definition: inet.hh:342
gem5::networking::TcpPtr::operator*
TcpHdr & operator*()
Definition: inet.hh:681
gem5::networking::TcpHdr::payload
const uint8_t * payload() const
Definition: inet.hh:641
gem5::networking::IpPtr::pstart
int pstart() const
Definition: inet.hh:419
gem5::networking::Ip6Opt::len
uint8_t len() const
Definition: inet.hh:596
gem5::networking::TcpPtr::TcpPtr
TcpPtr(const Ip6Ptr &ptr)
Definition: inet.hh:675
gem5::networking::Ip6Hdr::bytes
uint8_t * bytes()
Definition: inet.hh:482
gem5::networking::IpHdr::sum
uint16_t sum() const
Definition: inet.hh:340
gem5::networking::UdpHdr::len
void len(uint16_t _len)
Definition: inet.hh:751
etherpkt.hh
gem5::networking::IpAddress::string
std::string string() const
Definition: inet.cc:141
gem5::networking::IpHdr::hlen
uint8_t hlen() const
Definition: inet.hh:332
gem5::networking::EthPtr
Definition: inet.hh:192
gem5::networking::Ip6Hdr::dst
const uint8_t * dst() const
Definition: inet.hh:467
gem5::networking::UdpHdr::sum
uint16_t sum() const
Definition: inet.hh:748
gem5::networking::TcpPtr::operator=
const TcpPtr & operator=(const TcpPtr &t)
Definition: inet.hh:693
gem5::networking::TcpHdr::bytes
const uint8_t * bytes() const
Definition: inet.hh:640
gem5::networking::Ip6Hdr::plen
void plen(uint16_t _plen)
Definition: inet.hh:476
gem5::networking::IpPtr::packet
const EthPacketPtr packet() const
Definition: inet.hh:414
gem5::networking::TcpHdr::size
int size() const
Definition: inet.hh:639
gem5::networking::EthHdr::size
int size() const
Definition: inet.hh:179
gem5::networking::Ip6Ptr::operator=
const Ip6Ptr & operator=(const Ip6Ptr &ptr)
Definition: inet.hh:539
gem5::ArmISA::ea
Bitfield< 3 > ea
Definition: misc_types.hh:328
gem5::networking::EthAddr::addr
const uint8_t * addr() const
Definition: inet.hh:114
gem5::networking::TcpOpt::data
const uint8_t * data() const
Definition: inet.hh:722
gem5::networking::IpWithPort::port
uint8_t port() const
Definition: inet.hh:315
gem5::networking::IpPtr::off
int off() const
Definition: inet.hh:418
gem5::networking::UdpHdr::sport
uint16_t sport() const
Definition: inet.hh:745
gem5::networking::ip6_opt_dstopts::length
uint8_t length
Definition: inet.hh:576
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::networking::ip6_opt_fragment::ident
uint32_t ident
Definition: inet.hh:562
gem5::networking::EthHdr::src
const EthAddr & src() const
Definition: inet.hh:176
gem5::networking::Ip6Ptr::pstart
int pstart() const
Definition: inet.hh:552
gem5::networking::Ip6Hdr::plen
uint16_t plen() const
Definition: inet.hh:461
gem5::networking::TcpOpt::bytes
uint8_t * bytes()
Definition: inet.hh:736
gem5::networking::IpHdr::id
uint16_t id() const
Definition: inet.hh:335
gem5::networking::TcpPtr::operator->
TcpHdr * operator->()
Definition: inet.hh:680
gem5::networking::Ip6Ptr::Ip6Ptr
Ip6Ptr(const EthPacketPtr &ptr)
Definition: inet.hh:515
gem5::networking::ip6_opt_hdr::ext_data
union gem5::networking::ip6_opt_hdr::@23 ext_data
gem5::networking::IpPtr::p
EthPacketPtr p
Definition: inet.hh:362
gem5::networking::EthPtr::EthPtr
EthPtr(const EthPacketPtr &ptr)
Definition: inet.hh:205
gem5::networking::TcpOpt::tsecr
uint32_t tsecr() const
Definition: inet.hh:728
gem5::networking::UdpPtr
Definition: inet.hh:760
gem5::networking::ip6_opt_hdr
Definition: inet.hh:580
gem5::networking::IpWithPort::IpWithPort
IpWithPort(const uint32_t __ip, const uint16_t __port)
Definition: inet.hh:308
gem5::networking::ip6_opt_routing_type2::addr
ip6_addr_t addr
Definition: inet.hh:570
gem5::networking::ip6_opt_routing_type2::reserved
uint32_t reserved
Definition: inet.hh:569
gem5::networking::Ip6Ptr::Ip6Ptr
Ip6Ptr(const EthPtr &ptr)
Definition: inet.hh:516
gem5::networking::IpHdr::size
int size() const
Definition: inet.hh:350
gem5::networking::IpOpt::type
uint8_t type() const
Definition: inet.hh:430
gem5::networking::TcpPtr::set
void set(const EthPacketPtr &ptr, int offset)
Definition: inet.hh:652
gem5::networking::Ip6Hdr::nxt
uint8_t nxt() const
Definition: inet.hh:463
gem5::networking::UdpPtr::set
void set(const IpPtr &ptr)
Definition: inet.hh:767
gem5::networking::IpOpt::sdb
void sdb(std::vector< uint32_t > &vec) const
gem5::networking::TcpPtr
Definition: inet.hh:646
gem5::networking::IpAddress::ip
uint32_t ip() const
Definition: inet.hh:256
gem5::networking::Ip6Ptr::packet
EthPacketPtr packet()
Definition: inet.hh:548
gem5::networking::UdpHdr::payload
const uint8_t * payload() const
Definition: inet.hh:755
gem5::networking::TcpHdr::seq
void seq(uint32_t _seq)
Definition: inet.hh:634
gem5::networking::IpOpt::typeClass
uint8_t typeClass() const
Definition: inet.hh:432
gem5::networking::IpHdr::bytes
uint8_t * bytes()
Definition: inet.hh:353
gem5::networking::Ip6Opt
Definition: inet.hh:592

Generated on Tue Sep 21 2021 12:24:57 for gem5 by doxygen 1.8.17