1*cfb92d14SAndroid Build Coastguard Worker /* 2*cfb92d14SAndroid Build Coastguard Worker * Copyright (c) 2016, The OpenThread Authors. 3*cfb92d14SAndroid Build Coastguard Worker * All rights reserved. 4*cfb92d14SAndroid Build Coastguard Worker * 5*cfb92d14SAndroid Build Coastguard Worker * Redistribution and use in source and binary forms, with or without 6*cfb92d14SAndroid Build Coastguard Worker * modification, are permitted provided that the following conditions are met: 7*cfb92d14SAndroid Build Coastguard Worker * 1. Redistributions of source code must retain the above copyright 8*cfb92d14SAndroid Build Coastguard Worker * notice, this list of conditions and the following disclaimer. 9*cfb92d14SAndroid Build Coastguard Worker * 2. Redistributions in binary form must reproduce the above copyright 10*cfb92d14SAndroid Build Coastguard Worker * notice, this list of conditions and the following disclaimer in the 11*cfb92d14SAndroid Build Coastguard Worker * documentation and/or other materials provided with the distribution. 12*cfb92d14SAndroid Build Coastguard Worker * 3. Neither the name of the copyright holder nor the 13*cfb92d14SAndroid Build Coastguard Worker * names of its contributors may be used to endorse or promote products 14*cfb92d14SAndroid Build Coastguard Worker * derived from this software without specific prior written permission. 15*cfb92d14SAndroid Build Coastguard Worker * 16*cfb92d14SAndroid Build Coastguard Worker * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17*cfb92d14SAndroid Build Coastguard Worker * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18*cfb92d14SAndroid Build Coastguard Worker * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19*cfb92d14SAndroid Build Coastguard Worker * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20*cfb92d14SAndroid Build Coastguard Worker * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21*cfb92d14SAndroid Build Coastguard Worker * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22*cfb92d14SAndroid Build Coastguard Worker * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23*cfb92d14SAndroid Build Coastguard Worker * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24*cfb92d14SAndroid Build Coastguard Worker * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25*cfb92d14SAndroid Build Coastguard Worker * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26*cfb92d14SAndroid Build Coastguard Worker * POSSIBILITY OF SUCH DAMAGE. 27*cfb92d14SAndroid Build Coastguard Worker */ 28*cfb92d14SAndroid Build Coastguard Worker 29*cfb92d14SAndroid Build Coastguard Worker #ifndef TEST_LOWPAN_HPP 30*cfb92d14SAndroid Build Coastguard Worker #define TEST_LOWPAN_HPP 31*cfb92d14SAndroid Build Coastguard Worker 32*cfb92d14SAndroid Build Coastguard Worker #include <stdint.h> 33*cfb92d14SAndroid Build Coastguard Worker 34*cfb92d14SAndroid Build Coastguard Worker #include "common/code_utils.hpp" 35*cfb92d14SAndroid Build Coastguard Worker #include "instance/instance.hpp" 36*cfb92d14SAndroid Build Coastguard Worker #include "mac/mac.hpp" 37*cfb92d14SAndroid Build Coastguard Worker #include "net/ip6_headers.hpp" 38*cfb92d14SAndroid Build Coastguard Worker #include "thread/lowpan.hpp" 39*cfb92d14SAndroid Build Coastguard Worker #include "thread/thread_netif.hpp" 40*cfb92d14SAndroid Build Coastguard Worker 41*cfb92d14SAndroid Build Coastguard Worker namespace ot { 42*cfb92d14SAndroid Build Coastguard Worker 43*cfb92d14SAndroid Build Coastguard Worker class TestIphcVector 44*cfb92d14SAndroid Build Coastguard Worker { 45*cfb92d14SAndroid Build Coastguard Worker public: 46*cfb92d14SAndroid Build Coastguard Worker enum 47*cfb92d14SAndroid Build Coastguard Worker { 48*cfb92d14SAndroid Build Coastguard Worker kContextUnused = 255, 49*cfb92d14SAndroid Build Coastguard Worker kPayloadMaxLength = 512 50*cfb92d14SAndroid Build Coastguard Worker }; 51*cfb92d14SAndroid Build Coastguard Worker 52*cfb92d14SAndroid Build Coastguard Worker struct Payload 53*cfb92d14SAndroid Build Coastguard Worker { 54*cfb92d14SAndroid Build Coastguard Worker uint8_t mData[kPayloadMaxLength]; 55*cfb92d14SAndroid Build Coastguard Worker uint16_t mLength; 56*cfb92d14SAndroid Build Coastguard Worker }; 57*cfb92d14SAndroid Build Coastguard Worker 58*cfb92d14SAndroid Build Coastguard Worker /** 59*cfb92d14SAndroid Build Coastguard Worker * Default constructor for the object. 60*cfb92d14SAndroid Build Coastguard Worker * 61*cfb92d14SAndroid Build Coastguard Worker */ TestIphcVector(const char * aTestName)62*cfb92d14SAndroid Build Coastguard Worker explicit TestIphcVector(const char *aTestName) 63*cfb92d14SAndroid Build Coastguard Worker { 64*cfb92d14SAndroid Build Coastguard Worker memset(reinterpret_cast<void *>(this), 0, sizeof(TestIphcVector)); 65*cfb92d14SAndroid Build Coastguard Worker mTestName = aTestName; 66*cfb92d14SAndroid Build Coastguard Worker mSrcContext.mContextId = kContextUnused; 67*cfb92d14SAndroid Build Coastguard Worker mDstContext.mContextId = kContextUnused; 68*cfb92d14SAndroid Build Coastguard Worker } 69*cfb92d14SAndroid Build Coastguard Worker 70*cfb92d14SAndroid Build Coastguard Worker /** 71*cfb92d14SAndroid Build Coastguard Worker * Sets long MAC source address. 72*cfb92d14SAndroid Build Coastguard Worker * 73*cfb92d14SAndroid Build Coastguard Worker * @param aAddress Pointer to the long MAC address. 74*cfb92d14SAndroid Build Coastguard Worker * 75*cfb92d14SAndroid Build Coastguard Worker */ SetMacSource(const uint8_t * aAddress)76*cfb92d14SAndroid Build Coastguard Worker void SetMacSource(const uint8_t *aAddress) { mMacAddrs.mSource.SetExtended(aAddress); } 77*cfb92d14SAndroid Build Coastguard Worker 78*cfb92d14SAndroid Build Coastguard Worker /** 79*cfb92d14SAndroid Build Coastguard Worker * Sets short MAC source address. 80*cfb92d14SAndroid Build Coastguard Worker * 81*cfb92d14SAndroid Build Coastguard Worker * @param aAddress Short MAC address. 82*cfb92d14SAndroid Build Coastguard Worker * 83*cfb92d14SAndroid Build Coastguard Worker */ SetMacSource(uint16_t aAddress)84*cfb92d14SAndroid Build Coastguard Worker void SetMacSource(uint16_t aAddress) { mMacAddrs.mSource.SetShort(aAddress); } 85*cfb92d14SAndroid Build Coastguard Worker 86*cfb92d14SAndroid Build Coastguard Worker /** 87*cfb92d14SAndroid Build Coastguard Worker * Sets long MAC destination address. 88*cfb92d14SAndroid Build Coastguard Worker * 89*cfb92d14SAndroid Build Coastguard Worker * @param aAddress Pointer to the long MAC address. 90*cfb92d14SAndroid Build Coastguard Worker * 91*cfb92d14SAndroid Build Coastguard Worker */ SetMacDestination(const uint8_t * aAddress)92*cfb92d14SAndroid Build Coastguard Worker void SetMacDestination(const uint8_t *aAddress) { mMacAddrs.mDestination.SetExtended(aAddress); } 93*cfb92d14SAndroid Build Coastguard Worker 94*cfb92d14SAndroid Build Coastguard Worker /** 95*cfb92d14SAndroid Build Coastguard Worker * Sets short MAC destination address. 96*cfb92d14SAndroid Build Coastguard Worker * 97*cfb92d14SAndroid Build Coastguard Worker * @param aAddress Short MAC address. 98*cfb92d14SAndroid Build Coastguard Worker * 99*cfb92d14SAndroid Build Coastguard Worker */ SetMacDestination(uint16_t aAddress)100*cfb92d14SAndroid Build Coastguard Worker void SetMacDestination(uint16_t aAddress) { mMacAddrs.mDestination.SetShort(aAddress); } 101*cfb92d14SAndroid Build Coastguard Worker 102*cfb92d14SAndroid Build Coastguard Worker /** 103*cfb92d14SAndroid Build Coastguard Worker * Gets the IPv6 header 104*cfb92d14SAndroid Build Coastguard Worker * 105*cfb92d14SAndroid Build Coastguard Worker * @returns the IPv6 header. 106*cfb92d14SAndroid Build Coastguard Worker * 107*cfb92d14SAndroid Build Coastguard Worker */ GetIpHeader(void) const108*cfb92d14SAndroid Build Coastguard Worker const Ip6::Header &GetIpHeader(void) const { return mIpHeader; } 109*cfb92d14SAndroid Build Coastguard Worker 110*cfb92d14SAndroid Build Coastguard Worker /** 111*cfb92d14SAndroid Build Coastguard Worker * Initializes IPv6 Header. 112*cfb92d14SAndroid Build Coastguard Worker * 113*cfb92d14SAndroid Build Coastguard Worker * @param aVersionClassFlow Value of the Version, Traffic class and Flow control fields. 114*cfb92d14SAndroid Build Coastguard Worker * @param aPayloadLength Value of the payload length field. 115*cfb92d14SAndroid Build Coastguard Worker * @param aNextHeader Value of the next header field. 116*cfb92d14SAndroid Build Coastguard Worker * @param aHopLimit Value of the hop limit field. 117*cfb92d14SAndroid Build Coastguard Worker * @param aSource String represents IPv6 source address. 118*cfb92d14SAndroid Build Coastguard Worker * @param aDestination String represents IPv6 destination address. 119*cfb92d14SAndroid Build Coastguard Worker * 120*cfb92d14SAndroid Build Coastguard Worker */ SetIpHeader(uint32_t aVersionClassFlow,uint16_t aPayloadLength,uint8_t aNextHeader,uint8_t aHopLimit,const char * aSource,const char * aDestination)121*cfb92d14SAndroid Build Coastguard Worker void SetIpHeader(uint32_t aVersionClassFlow, 122*cfb92d14SAndroid Build Coastguard Worker uint16_t aPayloadLength, 123*cfb92d14SAndroid Build Coastguard Worker uint8_t aNextHeader, 124*cfb92d14SAndroid Build Coastguard Worker uint8_t aHopLimit, 125*cfb92d14SAndroid Build Coastguard Worker const char *aSource, 126*cfb92d14SAndroid Build Coastguard Worker const char *aDestination) 127*cfb92d14SAndroid Build Coastguard Worker { 128*cfb92d14SAndroid Build Coastguard Worker mIpHeader.SetVerionTrafficClassFlow(aVersionClassFlow); 129*cfb92d14SAndroid Build Coastguard Worker mIpHeader.SetPayloadLength(aPayloadLength); 130*cfb92d14SAndroid Build Coastguard Worker mIpHeader.SetNextHeader(aNextHeader); 131*cfb92d14SAndroid Build Coastguard Worker mIpHeader.SetHopLimit(aHopLimit); 132*cfb92d14SAndroid Build Coastguard Worker IgnoreError(mIpHeader.GetSource().FromString(aSource)); 133*cfb92d14SAndroid Build Coastguard Worker IgnoreError(mIpHeader.GetDestination().FromString(aDestination)); 134*cfb92d14SAndroid Build Coastguard Worker } 135*cfb92d14SAndroid Build Coastguard Worker 136*cfb92d14SAndroid Build Coastguard Worker /** 137*cfb92d14SAndroid Build Coastguard Worker * Initializes IPv6 Encapsulated Header. 138*cfb92d14SAndroid Build Coastguard Worker * 139*cfb92d14SAndroid Build Coastguard Worker * @param aVersionClassFlow Value of the Version, Traffic class and Flow control fields. 140*cfb92d14SAndroid Build Coastguard Worker * @param aPayloadLength Value of the payload length field. 141*cfb92d14SAndroid Build Coastguard Worker * @param aNextHeader Value of the next header field. 142*cfb92d14SAndroid Build Coastguard Worker * @param aHopLimit Value of the hop limit field. 143*cfb92d14SAndroid Build Coastguard Worker * @param aSource String represents IPv6 source address. 144*cfb92d14SAndroid Build Coastguard Worker * @param aDestination String represents IPv6 destination address. 145*cfb92d14SAndroid Build Coastguard Worker * 146*cfb92d14SAndroid Build Coastguard Worker */ SetIpTunneledHeader(uint32_t aVersionClassFlow,uint16_t aPayloadLength,uint8_t aNextHeader,uint8_t aHopLimit,const char * aSource,const char * aDestination)147*cfb92d14SAndroid Build Coastguard Worker void SetIpTunneledHeader(uint32_t aVersionClassFlow, 148*cfb92d14SAndroid Build Coastguard Worker uint16_t aPayloadLength, 149*cfb92d14SAndroid Build Coastguard Worker uint8_t aNextHeader, 150*cfb92d14SAndroid Build Coastguard Worker uint8_t aHopLimit, 151*cfb92d14SAndroid Build Coastguard Worker const char *aSource, 152*cfb92d14SAndroid Build Coastguard Worker const char *aDestination) 153*cfb92d14SAndroid Build Coastguard Worker { 154*cfb92d14SAndroid Build Coastguard Worker mIpTunneledHeader.SetVerionTrafficClassFlow(aVersionClassFlow); 155*cfb92d14SAndroid Build Coastguard Worker mIpTunneledHeader.SetPayloadLength(aPayloadLength); 156*cfb92d14SAndroid Build Coastguard Worker mIpTunneledHeader.SetNextHeader(aNextHeader); 157*cfb92d14SAndroid Build Coastguard Worker mIpTunneledHeader.SetHopLimit(aHopLimit); 158*cfb92d14SAndroid Build Coastguard Worker IgnoreError(mIpTunneledHeader.GetSource().FromString(aSource)); 159*cfb92d14SAndroid Build Coastguard Worker IgnoreError(mIpTunneledHeader.GetDestination().FromString(aDestination)); 160*cfb92d14SAndroid Build Coastguard Worker } 161*cfb92d14SAndroid Build Coastguard Worker 162*cfb92d14SAndroid Build Coastguard Worker /** 163*cfb92d14SAndroid Build Coastguard Worker * Initializes IPv6 Extension Header. 164*cfb92d14SAndroid Build Coastguard Worker * 165*cfb92d14SAndroid Build Coastguard Worker * @param aExtHeader Pointer to the extension header data. 166*cfb92d14SAndroid Build Coastguard Worker * @param aExtHeaderLength Length of the extension header data. 167*cfb92d14SAndroid Build Coastguard Worker * 168*cfb92d14SAndroid Build Coastguard Worker */ SetExtHeader(const uint8_t * aExtHeader,uint16_t aExtHeaderLength)169*cfb92d14SAndroid Build Coastguard Worker void SetExtHeader(const uint8_t *aExtHeader, uint16_t aExtHeaderLength) 170*cfb92d14SAndroid Build Coastguard Worker { 171*cfb92d14SAndroid Build Coastguard Worker memcpy(mExtHeader.mData, aExtHeader, aExtHeaderLength); 172*cfb92d14SAndroid Build Coastguard Worker mExtHeader.mLength = aExtHeaderLength; 173*cfb92d14SAndroid Build Coastguard Worker } 174*cfb92d14SAndroid Build Coastguard Worker 175*cfb92d14SAndroid Build Coastguard Worker /** 176*cfb92d14SAndroid Build Coastguard Worker * Initializes UDP Header. 177*cfb92d14SAndroid Build Coastguard Worker * 178*cfb92d14SAndroid Build Coastguard Worker * @param aSource Value of the source port. 179*cfb92d14SAndroid Build Coastguard Worker * @param aDestination Value of the destination port. 180*cfb92d14SAndroid Build Coastguard Worker * @param aLength Value of the length field. 181*cfb92d14SAndroid Build Coastguard Worker * @param aChecksum Value of the checksum field. 182*cfb92d14SAndroid Build Coastguard Worker * 183*cfb92d14SAndroid Build Coastguard Worker */ SetUDPHeader(uint16_t aSource,uint16_t aDestination,uint16_t aLength,uint16_t aChecksum)184*cfb92d14SAndroid Build Coastguard Worker void SetUDPHeader(uint16_t aSource, uint16_t aDestination, uint16_t aLength, uint16_t aChecksum) 185*cfb92d14SAndroid Build Coastguard Worker { 186*cfb92d14SAndroid Build Coastguard Worker mUdpHeader.SetSourcePort(aSource); 187*cfb92d14SAndroid Build Coastguard Worker mUdpHeader.SetDestinationPort(aDestination); 188*cfb92d14SAndroid Build Coastguard Worker mUdpHeader.SetLength(aLength); 189*cfb92d14SAndroid Build Coastguard Worker mUdpHeader.SetChecksum(aChecksum); 190*cfb92d14SAndroid Build Coastguard Worker } 191*cfb92d14SAndroid Build Coastguard Worker 192*cfb92d14SAndroid Build Coastguard Worker /** 193*cfb92d14SAndroid Build Coastguard Worker * Initializes LOWPAN_IPHC Header. 194*cfb92d14SAndroid Build Coastguard Worker * 195*cfb92d14SAndroid Build Coastguard Worker * @param aIphc Pointer to the LOWPAN_IPHC header. 196*cfb92d14SAndroid Build Coastguard Worker * @param aIphcLength Length of the LOWPAN_IPHC header. 197*cfb92d14SAndroid Build Coastguard Worker * 198*cfb92d14SAndroid Build Coastguard Worker */ SetIphcHeader(const uint8_t * aIphc,uint16_t aIphcLength)199*cfb92d14SAndroid Build Coastguard Worker void SetIphcHeader(const uint8_t *aIphc, uint16_t aIphcLength) 200*cfb92d14SAndroid Build Coastguard Worker { 201*cfb92d14SAndroid Build Coastguard Worker memcpy(mIphcHeader.mData, aIphc, aIphcLength); 202*cfb92d14SAndroid Build Coastguard Worker mIphcHeader.mLength = aIphcLength; 203*cfb92d14SAndroid Build Coastguard Worker } 204*cfb92d14SAndroid Build Coastguard Worker 205*cfb92d14SAndroid Build Coastguard Worker /** 206*cfb92d14SAndroid Build Coastguard Worker * Sets the expect result of the compression / decompression procedure. 207*cfb92d14SAndroid Build Coastguard Worker * 208*cfb92d14SAndroid Build Coastguard Worker * @param aError Expected result. 209*cfb92d14SAndroid Build Coastguard Worker * 210*cfb92d14SAndroid Build Coastguard Worker */ SetError(Error aError)211*cfb92d14SAndroid Build Coastguard Worker void SetError(Error aError) { mError = aError; } 212*cfb92d14SAndroid Build Coastguard Worker 213*cfb92d14SAndroid Build Coastguard Worker /** 214*cfb92d14SAndroid Build Coastguard Worker * Initializes IPv6 Payload (uncompressed data). 215*cfb92d14SAndroid Build Coastguard Worker * 216*cfb92d14SAndroid Build Coastguard Worker * @param aPayload Pointer to the payload data. 217*cfb92d14SAndroid Build Coastguard Worker * @param aLength Length of the payload data. 218*cfb92d14SAndroid Build Coastguard Worker * 219*cfb92d14SAndroid Build Coastguard Worker */ SetPayload(const uint8_t * aPayload,uint16_t aLength)220*cfb92d14SAndroid Build Coastguard Worker void SetPayload(const uint8_t *aPayload, uint16_t aLength) 221*cfb92d14SAndroid Build Coastguard Worker { 222*cfb92d14SAndroid Build Coastguard Worker memcpy(mPayload.mData, aPayload, aLength); 223*cfb92d14SAndroid Build Coastguard Worker mPayload.mLength = aLength; 224*cfb92d14SAndroid Build Coastguard Worker } 225*cfb92d14SAndroid Build Coastguard Worker 226*cfb92d14SAndroid Build Coastguard Worker /** 227*cfb92d14SAndroid Build Coastguard Worker * Sets the offset from the beginning of the IPv6 header to the uncompressed 228*cfb92d14SAndroid Build Coastguard Worker * payload. 229*cfb92d14SAndroid Build Coastguard Worker * 230*cfb92d14SAndroid Build Coastguard Worker * @param aPayloadOffset The offset from the beginning of the IPv6 header to the uncompressed 231*cfb92d14SAndroid Build Coastguard Worker * payload. 232*cfb92d14SAndroid Build Coastguard Worker * 233*cfb92d14SAndroid Build Coastguard Worker */ SetPayloadOffset(uint16_t aPayloadOffset)234*cfb92d14SAndroid Build Coastguard Worker void SetPayloadOffset(uint16_t aPayloadOffset) { mPayloadOffset = aPayloadOffset; } 235*cfb92d14SAndroid Build Coastguard Worker 236*cfb92d14SAndroid Build Coastguard Worker /** 237*cfb92d14SAndroid Build Coastguard Worker * Returns compressed LOWPAN_IPHC frame. 238*cfb92d14SAndroid Build Coastguard Worker * 239*cfb92d14SAndroid Build Coastguard Worker * @returns The compressed stream. 240*cfb92d14SAndroid Build Coastguard Worker * 241*cfb92d14SAndroid Build Coastguard Worker */ 242*cfb92d14SAndroid Build Coastguard Worker void GetCompressedStream(uint8_t *aIphc, uint16_t &aIphcLength); 243*cfb92d14SAndroid Build Coastguard Worker 244*cfb92d14SAndroid Build Coastguard Worker /** 245*cfb92d14SAndroid Build Coastguard Worker * Returns message object with the uncompressed IPv6 packet. 246*cfb92d14SAndroid Build Coastguard Worker * 247*cfb92d14SAndroid Build Coastguard Worker * @returns The message object with the uncompressed IPv6 packet. 248*cfb92d14SAndroid Build Coastguard Worker * 249*cfb92d14SAndroid Build Coastguard Worker */ 250*cfb92d14SAndroid Build Coastguard Worker void GetUncompressedStream(Message &aMessage); 251*cfb92d14SAndroid Build Coastguard Worker 252*cfb92d14SAndroid Build Coastguard Worker /** 253*cfb92d14SAndroid Build Coastguard Worker * Returns data with the uncompressed IPv6 packet. 254*cfb92d14SAndroid Build Coastguard Worker * 255*cfb92d14SAndroid Build Coastguard Worker * @returns The data with the uncompressed IPv6 packet. 256*cfb92d14SAndroid Build Coastguard Worker * 257*cfb92d14SAndroid Build Coastguard Worker */ 258*cfb92d14SAndroid Build Coastguard Worker void GetUncompressedStream(uint8_t *aIp6, uint16_t &aIp6Length); 259*cfb92d14SAndroid Build Coastguard Worker 260*cfb92d14SAndroid Build Coastguard Worker /** 261*cfb92d14SAndroid Build Coastguard Worker * This fields represent uncompressed IPv6 packet. 262*cfb92d14SAndroid Build Coastguard Worker * 263*cfb92d14SAndroid Build Coastguard Worker */ 264*cfb92d14SAndroid Build Coastguard Worker Mac::Addresses mMacAddrs; 265*cfb92d14SAndroid Build Coastguard Worker Ip6::Header mIpHeader; 266*cfb92d14SAndroid Build Coastguard Worker Payload mExtHeader; 267*cfb92d14SAndroid Build Coastguard Worker Ip6::Header mIpTunneledHeader; 268*cfb92d14SAndroid Build Coastguard Worker Ip6::Udp::Header mUdpHeader; 269*cfb92d14SAndroid Build Coastguard Worker 270*cfb92d14SAndroid Build Coastguard Worker /** 271*cfb92d14SAndroid Build Coastguard Worker * This fields represent compressed IPv6 packet. 272*cfb92d14SAndroid Build Coastguard Worker * 273*cfb92d14SAndroid Build Coastguard Worker */ 274*cfb92d14SAndroid Build Coastguard Worker Payload mIphcHeader; 275*cfb92d14SAndroid Build Coastguard Worker uint16_t mPayloadOffset; 276*cfb92d14SAndroid Build Coastguard Worker Lowpan::Context mSrcContext; 277*cfb92d14SAndroid Build Coastguard Worker Lowpan::Context mDstContext; 278*cfb92d14SAndroid Build Coastguard Worker 279*cfb92d14SAndroid Build Coastguard Worker /** 280*cfb92d14SAndroid Build Coastguard Worker * General purpose fields. 281*cfb92d14SAndroid Build Coastguard Worker * 282*cfb92d14SAndroid Build Coastguard Worker */ 283*cfb92d14SAndroid Build Coastguard Worker Payload mPayload; 284*cfb92d14SAndroid Build Coastguard Worker Error mError; 285*cfb92d14SAndroid Build Coastguard Worker const char *mTestName; 286*cfb92d14SAndroid Build Coastguard Worker }; 287*cfb92d14SAndroid Build Coastguard Worker 288*cfb92d14SAndroid Build Coastguard Worker } // namespace ot 289*cfb92d14SAndroid Build Coastguard Worker 290*cfb92d14SAndroid Build Coastguard Worker #endif // TEST_LOWPAN_HPP 291