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;
--- 103 unchanged lines hidden (view full) ---
112ostream &
113operator<<(ostream &stream, const EthAddr &ea)
114{
115 const uint8_t *a = ea.addr();
116 ccprintf(stream, "%x:%x:%x:%x:%x:%x", a[0], a[1], a[2], a[3], a[4], a[5]);
117 return stream;
118}
119
120uint16_t
121cksum(const IpPtr &ptr)
122{
123 int sum = ip_cksum_add(ptr->bytes(), ptr->hlen(), 0);
124 return ip_cksum_carry(sum);
125}
126
127uint16_t
--- 104 unchanged lines hidden ---
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;
--- 103 unchanged lines hidden (view full) ---
112ostream &
113operator<<(ostream &stream, const EthAddr &ea)
114{
115 const uint8_t *a = ea.addr();
116 ccprintf(stream, "%x:%x:%x:%x:%x:%x", a[0], a[1], a[2], a[3], a[4], a[5]);
117 return stream;
118}
119
120uint16_t
121cksum(const IpPtr &ptr)
122{
123 int sum = ip_cksum_add(ptr->bytes(), ptr->hlen(), 0);
124 return ip_cksum_carry(sum);
125}
126
127uint16_t
--- 104 unchanged lines hidden ---