Newer
Older
= DHCP6OptServerId dissection with specific DUID_LL as duid value
a=DHCP6OptServerId('\x00\x02\x00\n\x00\x03\x00\x01\x00\x00\x00\x00\x00\x00')
a.optcode == 2 and a.optlen == 10 and isinstance(a.duid, DUID_LL) and a.duid.type == 3 and a.duid.hwtype == 1 and a.duid.lladdr == "00:00:00:00:00:00"
= DHCP6OptServerId dissection with specific DUID_LLT as duid value
a=DHCP6OptServerId('\x00\x02\x00\x0e\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.optcode == 2 and a.optlen == 14 and isinstance(a.duid, DUID_LLT) and a.duid.type == 1 and a.duid.hwtype == 1 and a.duid.timeval == 0 and a.duid.lladdr == "00:00:00:00:00:00"
= DHCP6OptServerId dissection with specific DUID_EN as duid value
a=DHCP6OptServerId('\x00\x02\x00\x06\x00\x02\x00\x00\x017')
a.optcode == 2 and a.optlen == 6 and isinstance(a.duid, DUID_EN) and a.duid.type == 2 and a.duid.enterprisenum == 311 and a.duid.id == ""
############
############
+ Test DHCP6 IA Address Option (IA_TA or IA_NA suboption)
= DHCP6OptIAAddress - Basic Instantiation
Todd Freed
committed
str(DHCP6OptIAAddress()) == '\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Todd Freed
committed
a = DHCP6OptIAAddress('\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.optcode == 5 and a.optlen == 24 and a.addr == "::" and a.preflft == 0 and a. validlft == 0 and a.iaaddropts == ""
= DHCP6OptIAAddress - Instantiation with specific values
Todd Freed
committed
str(DHCP6OptIAAddress(optlen=0x1111, addr="2222:3333::5555", preflft=0x66666666, validlft=0x77777777, iaaddropts="somestring")) == '\x00\x05\x11\x11""33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00UUffffwwwwsomestring'
= DHCP6OptIAAddress - Instantiation with specific values (default optlen computation)
Todd Freed
committed
str(DHCP6OptIAAddress(addr="2222:3333::5555", preflft=0x66666666, validlft=0x77777777, iaaddropts="somestring")) == '\x00\x05\x00"""33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00UUffffwwwwsomestring'
= DHCP6OptIAAddress - Dissection with specific values
Todd Freed
committed
a = DHCP6OptIAAddress('\x00\x05\x00"""33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00UUffffwwwwsomestring')
a.optcode == 5 and a.optlen == 34 and a.addr == "2222:3333::5555" and a.preflft == 0x66666666 and a. validlft == 0x77777777 and a.iaaddropts == "somestring"
############
############
+ Test DHCP6 Identity Association for Non-temporary Addresses Option
= DHCP6OptIA_NA - Basic Instantiation
str(DHCP6OptIA_NA()) == '\x00\x03\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
= DHCP6OptIA_NA - Basic Dissection
a = DHCP6OptIA_NA('\x00\x03\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.optcode == 3 and a.optlen == 12 and a.iaid == 0 and a.T1 == 0 and a.T2==0 and a.ianaopts == []
= DHCP6OptIA_NA - Instantiation with specific values (keep automatic length computation)
str(DHCP6OptIA_NA(iaid=0x22222222, T1=0x33333333, T2=0x44444444)) == '\x00\x03\x00\x0c""""3333DDDD'
= DHCP6OptIA_NA - Instantiation with specific values (forced optlen)
str(DHCP6OptIA_NA(optlen=0x1111, iaid=0x22222222, T1=0x33333333, T2=0x44444444)) == '\x00\x03\x11\x11""""3333DDDD'
= DHCP6OptIA_NA - Instantiation with a list of IA Addresses (optlen automatic computation)
Todd Freed
committed
str(DHCP6OptIA_NA(iaid=0x22222222, T1=0x33333333, T2=0x44444444, ianaopts=[DHCP6OptIAAddress(), DHCP6OptIAAddress()])) == '\x00\x03\x00D""""3333DDDD\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Todd Freed
committed
a = DHCP6OptIA_NA('\x00\x03\x00L""""3333DDDD\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.optcode == 3 and a.optlen == 76 and a.iaid == 0x22222222 and a.T1 == 0x33333333 and a.T2==0x44444444 and len(a.ianaopts) == 2 and isinstance(a.ianaopts[0], DHCP6OptIAAddress) and isinstance(a.ianaopts[1], DHCP6OptIAAddress)
############
############
+ Test DHCP6 Identity Association for Temporary Addresses Option
= DHCP6OptIA_TA - Basic Instantiation
str(DHCP6OptIA_TA()) == '\x00\x04\x00\x04\x00\x00\x00\x00'
= DHCP6OptIA_TA - Basic Dissection
a = DHCP6OptIA_TA('\x00\x04\x00\x04\x00\x00\x00\x00')
a.optcode == 4 and a.optlen == 4 and a.iaid == 0 and a.iataopts == []
= DHCP6OptIA_TA - Instantiation with specific values
Todd Freed
committed
str(DHCP6OptIA_TA(optlen=0x1111, iaid=0x22222222, iataopts=[DHCP6OptIAAddress(), DHCP6OptIAAddress()])) == '\x00\x04\x11\x11""""\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Todd Freed
committed
a = DHCP6OptIA_TA('\x00\x04\x11\x11""""\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.optcode == 4 and a.optlen == 0x1111 and a.iaid == 0x22222222 and len(a.iataopts) == 2 and isinstance(a.iataopts[0], DHCP6OptIAAddress) and isinstance(a.iataopts[1], DHCP6OptIAAddress)
############
############
+ Test DHCP6 Option Request Option
= DHCP6OptOptReq - Basic Instantiation
str(DHCP6OptOptReq()) == '\x00\x06\x00\x04\x00\x17\x00\x18'
= DHCP6OptOptReq - optlen field computation
str(DHCP6OptOptReq(reqopts=[1,2,3,4])) == '\x00\x06\x00\x08\x00\x01\x00\x02\x00\x03\x00\x04'
= DHCP6OptOptReq - instantiation with empty list
str(DHCP6OptOptReq(reqopts=[])) == '\x00\x06\x00\x00'
= DHCP6OptOptReq - Basic dissection
a=DHCP6OptOptReq('\x00\x06\x00\x00')
a.optcode == 6 and a.optlen == 0 and a.reqopts == [23,24]
= DHCP6OptOptReq - Dissection with specific value
a=DHCP6OptOptReq('\x00\x06\x00\x08\x00\x01\x00\x02\x00\x03\x00\x04')
a.optcode == 6 and a.optlen == 8 and a.reqopts == [1,2,3,4]
############
############
+ Test DHCP6 Option - Preference option
= DHCP6OptPref - Basic instantiation
str(DHCP6OptPref()) == '\x00\x07\x00\x01\xff'
= DHCP6OptPref - Instantiation with specific values
str(DHCP6OptPref(optlen=0xffff, prefval= 0x11)) == '\x00\x07\xff\xff\x11'
= DHCP6OptPref - Basic Dissection
a=DHCP6OptPref('\x00\x07\x00\x01\xff')
a.optcode == 7 and a.optlen == 1 and a.prefval == 255
= DHCP6OptPref - Dissection with specific values
a=DHCP6OptPref('\x00\x07\xff\xff\x11')
a.optcode == 7 and a.optlen == 0xffff and a.prefval == 0x11
############
############
+ Test DHCP6 Option - Elapsed Time
= DHCP6OptElapsedTime - Basic Instantiation
str(DHCP6OptElapsedTime()) == '\x00\x08\x00\x02\x00\x00'
= DHCP6OptElapsedTime - Instantiation with specific elapsedtime value
str(DHCP6OptElapsedTime(elapsedtime=421)) == '\x00\x08\x00\x02\x01\xa5'
= DHCP6OptElapsedTime - Basic Dissection
a=DHCP6OptElapsedTime('\x00\x08\x00\x02\x00\x00')
a.optcode == 8 and a.optlen == 2 and a.elapsedtime == 0
= DHCP6OptElapsedTime - Dissection with specific values
a=DHCP6OptElapsedTime('\x00\x08\x00\x02\x01\xa5')
a.optcode == 8 and a.optlen == 2 and a.elapsedtime == 421
############
############
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
+ Test DHCP6 Option - Server Unicast Address
= DHCP6OptServerUnicast - Basic Instantiation
str(DHCP6OptServerUnicast()) == '\x00\x0c\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
= DHCP6OptServerUnicast - Instantiation with specific values (test 1)
str(DHCP6OptServerUnicast(srvaddr="2001::1")) == '\x00\x0c\x00\x10 \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptServerUnicast - Instantiation with specific values (test 2)
str(DHCP6OptServerUnicast(srvaddr="2001::1", optlen=42)) == '\x00\x0c\x00* \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptServerUnicast - Dissection with default values
a=DHCP6OptServerUnicast('\x00\x0c\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.optcode == 12 and a.optlen == 16 and a.srvaddr == "::"
= DHCP6OptServerUnicast - Dissection with specific values (test 1)
a=DHCP6OptServerUnicast('\x00\x0c\x00\x10 \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 12 and a.optlen == 16 and a.srvaddr == "2001::1"
= DHCP6OptServerUnicast - Dissection with specific values (test 2)
a=DHCP6OptServerUnicast('\x00\x0c\x00* \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 12 and a.optlen == 42 and a.srvaddr == "2001::1"
############
############
+ Test DHCP6 Option - Status Code
= DHCP6OptStatusCode - Basic Instantiation
str(DHCP6OptStatusCode()) == '\x00\r\x00\x02\x00\x00'
= DHCP6OptStatusCode - Instantiation with specific values
str(DHCP6OptStatusCode(optlen=42, statuscode=0xff, statusmsg="Hello")) == '\x00\r\x00*\x00\xffHello'
= DHCP6OptStatusCode - Automatic Length computation
str(DHCP6OptStatusCode(statuscode=0xff, statusmsg="Hello")) == '\x00\r\x00\x07\x00\xffHello'
# Add tests to verify Unicode behavior
############
############
+ Test DHCP6 Option - Rapid Commit
= DHCP6OptRapidCommit - Basic Instantiation
str(DHCP6OptRapidCommit()) == '\x00\x0e\x00\x00'
= DHCP6OptRapidCommit - Basic Dissection
a=DHCP6OptRapidCommit('\x00\x0e\x00\x00')
a.optcode == 14 and a.optlen == 0
############
############
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
+ Test DHCP6 Option - User class
= DHCP6OptUserClass - Basic Instantiation
str(DHCP6OptUserClass()) == '\x00\x0f\x00\x00'
= DHCP6OptUserClass - Basic Dissection
a = DHCP6OptUserClass('\x00\x0f\x00\x00')
a.optcode == 15 and a.optlen == 0 and a.userclassdata == []
= DHCP6OptUserClass - Instantiation with one user class data structure
str(DHCP6OptUserClass(userclassdata=[USER_CLASS_DATA(data="something")])) == '\x00\x0f\x00\x0b\x00\tsomething'
= DHCP6OptUserClass - Dissection with one user class data structure
a = DHCP6OptUserClass('\x00\x0f\x00\x0b\x00\tsomething')
a.optcode == 15 and a.optlen == 11 and len(a.userclassdata) == 1 and isinstance(a.userclassdata[0], USER_CLASS_DATA) and a.userclassdata[0].len == 9 and a.userclassdata[0].data == 'something'
= DHCP6OptUserClass - Instantiation with two user class data structures
str(DHCP6OptUserClass(userclassdata=[USER_CLASS_DATA(data="something"), USER_CLASS_DATA(data="somethingelse")])) == '\x00\x0f\x00\x1a\x00\tsomething\x00\rsomethingelse'
= DHCP6OptUserClass - Dissection with two user class data structures
a = DHCP6OptUserClass('\x00\x0f\x00\x1a\x00\tsomething\x00\rsomethingelse')
a.optcode == 15 and a.optlen == 26 and len(a.userclassdata) == 2 and isinstance(a.userclassdata[0], USER_CLASS_DATA) and isinstance(a.userclassdata[1], USER_CLASS_DATA) and a.userclassdata[0].len == 9 and a.userclassdata[0].data == 'something' and a.userclassdata[1].len == 13 and a.userclassdata[1].data == 'somethingelse'
############
############
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
+ Test DHCP6 Option - Vendor class
= DHCP6OptVendorClass - Basic Instantiation
str(DHCP6OptVendorClass()) == '\x00\x10\x00\x04\x00\x00\x00\x00'
= DHCP6OptVendorClass - Basic Dissection
a = DHCP6OptVendorClass('\x00\x10\x00\x04\x00\x00\x00\x00')
a.optcode == 16 and a.optlen == 4 and a.enterprisenum == 0 and a.vcdata == []
= DHCP6OptVendorClass - Instantiation with one vendor class data structure
str(DHCP6OptVendorClass(vcdata=[VENDOR_CLASS_DATA(data="something")])) == '\x00\x10\x00\x0f\x00\x00\x00\x00\x00\tsomething'
= DHCP6OptVendorClass - Dissection with one vendor class data structure
a = DHCP6OptVendorClass('\x00\x10\x00\x0f\x00\x00\x00\x00\x00\tsomething')
a.optcode == 16 and a.optlen == 15 and a.enterprisenum == 0 and len(a.vcdata) == 1 and isinstance(a.vcdata[0], VENDOR_CLASS_DATA) and a.vcdata[0].len == 9 and a.vcdata[0].data == 'something'
= DHCP6OptVendorClass - Instantiation with two vendor class data structures
str(DHCP6OptVendorClass(vcdata=[VENDOR_CLASS_DATA(data="something"), VENDOR_CLASS_DATA(data="somethingelse")])) == '\x00\x10\x00\x1e\x00\x00\x00\x00\x00\tsomething\x00\rsomethingelse'
= DHCP6OptVendorClass - Dissection with two vendor class data structures
a = DHCP6OptVendorClass('\x00\x10\x00\x1e\x00\x00\x00\x00\x00\tsomething\x00\rsomethingelse')
a.optcode == 16 and a.optlen == 30 and a.enterprisenum == 0 and len(a.vcdata) == 2 and isinstance(a.vcdata[0], VENDOR_CLASS_DATA) and isinstance(a.vcdata[1], VENDOR_CLASS_DATA) and a.vcdata[0].len == 9 and a.vcdata[0].data == 'something' and a.vcdata[1].len == 13 and a.vcdata[1].data == 'somethingelse'
############
############
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
+ Test DHCP6 Option - Vendor-specific information
= DHCP6OptVendorSpecificInfo - Basic Instantiation
str(DHCP6OptVendorSpecificInfo()) == '\x00\x11\x00\x04\x00\x00\x00\x00'
= DHCP6OptVendorSpecificInfo - Basic Dissection
a = DHCP6OptVendorSpecificInfo('\x00\x11\x00\x04\x00\x00\x00\x00')
a.optcode == 17 and a.optlen == 4 and a.enterprisenum == 0
= DHCP6OptVendorSpecificInfo - Instantiation with specific values (one option)
str(DHCP6OptVendorSpecificInfo(enterprisenum=0xeeeeeeee, vso=[VENDOR_SPECIFIC_OPTION(optcode=43, optdata="something")])) == '\x00\x11\x00\x11\xee\xee\xee\xee\x00+\x00\tsomething'
= DHCP6OptVendorSpecificInfo - Dissection with with specific values (one option)
a = DHCP6OptVendorSpecificInfo('\x00\x11\x00\x11\xee\xee\xee\xee\x00+\x00\tsomething')
a.optcode == 17 and a.optlen == 17 and a.enterprisenum == 0xeeeeeeee and len(a.vso) == 1 and isinstance(a.vso[0], VENDOR_SPECIFIC_OPTION) and a.vso[0].optlen == 9 and a.vso[0].optdata == 'something'
= DHCP6OptVendorSpecificInfo - Instantiation with specific values (two options)
str(DHCP6OptVendorSpecificInfo(enterprisenum=0xeeeeeeee, vso=[VENDOR_SPECIFIC_OPTION(optcode=43, optdata="something"), VENDOR_SPECIFIC_OPTION(optcode=42, optdata="somethingelse")])) == '\x00\x11\x00"\xee\xee\xee\xee\x00+\x00\tsomething\x00*\x00\rsomethingelse'
= DHCP6OptVendorSpecificInfo - Dissection with with specific values (two options)
a = DHCP6OptVendorSpecificInfo('\x00\x11\x00"\xee\xee\xee\xee\x00+\x00\tsomething\x00*\x00\rsomethingelse')
a.optcode == 17 and a.optlen == 34 and a.enterprisenum == 0xeeeeeeee and len(a.vso) == 2 and isinstance(a.vso[0], VENDOR_SPECIFIC_OPTION) and isinstance(a.vso[1], VENDOR_SPECIFIC_OPTION) and a.vso[0].optlen == 9 and a.vso[0].optdata == 'something' and a.vso[1].optlen == 13 and a.vso[1].optdata == 'somethingelse'
############
############
+ Test DHCP6 Option - Interface-Id
= DHCP6OptIfaceId - Basic Instantiation
str(DHCP6OptIfaceId()) == '\x00\x12\x00\x00'
= DHCP6OptIfaceId - Basic Dissection
a = DHCP6OptIfaceId('\x00\x12\x00\x00')
a.optcode == 18 and a.optlen == 0
= DHCP6OptIfaceId - Instantiation with specific value
str(DHCP6OptIfaceId(ifaceid="something")) == '\x00\x12\x00\x09something'
= DHCP6OptIfaceId - Dissection with specific value
a = DHCP6OptIfaceId('\x00\x12\x00\x09something')
a.optcode == 18 and a.optlen == 9 and a.ifaceid == "something"
############
############
+ Test DHCP6 Option - Reconfigure Message
= DHCP6OptReconfMsg - Basic Instantiation
str(DHCP6OptReconfMsg()) == '\x00\x13\x00\x01\x0b'
= DHCP6OptReconfMsg - Basic Dissection
a = DHCP6OptReconfMsg('\x00\x13\x00\x01\x0b')
a.optcode == 19 and a.optlen == 1 and a.msgtype == 11
= DHCP6OptReconfMsg - Instantiation with specific values
str(DHCP6OptReconfMsg(optlen=4, msgtype=5)) == '\x00\x13\x00\x04\x05'
= DHCP6OptReconfMsg - Dissection with specific values
a = DHCP6OptReconfMsg('\x00\x13\x00\x04\x05')
a.optcode == 19 and a.optlen == 4 and a.msgtype == 5
############
############
+ Test DHCP6 Option - Reconfigure Accept
= DHCP6OptReconfAccept - Basic Instantiation
str(DHCP6OptReconfAccept()) == '\x00\x14\x00\x00'
= DHCP6OptReconfAccept - Basic Dissection
a = DHCP6OptReconfAccept('\x00\x14\x00\x00')
a.optcode == 20 and a.optlen == 0
= DHCP6OptReconfAccept - Instantiation with specific values
str(DHCP6OptReconfAccept(optlen=23)) == '\x00\x14\x00\x17'
= DHCP6OptReconfAccept - Dssection with specific values
a = DHCP6OptReconfAccept('\x00\x14\x00\x17')
a.optcode == 20 and a.optlen == 23
############
############
+ Test DHCP6 Option - SIP Servers Domain Name List
= DHCP6OptSIPDomains - Basic Instantiation
str(DHCP6OptSIPDomains()) == '\x00\x15\x00\x00'
= DHCP6OptSIPDomains - Basic Dissection
a = DHCP6OptSIPDomains('\x00\x15\x00\x00')
a.optcode == 21 and a.optlen == 0 and a.sipdomains == []
= DHCP6OptSIPDomains - Instantiation with one domain
str(DHCP6OptSIPDomains(sipdomains=["toto.example.org"])) == '\x00\x15\x00\x12\x04toto\x07example\x03org\x00'
= DHCP6OptSIPDomains - Dissection with one domain
a = DHCP6OptSIPDomains('\x00\x15\x00\x12\x04toto\x07example\x03org\x00')
a.optcode == 21 and a.optlen == 18 and len(a.sipdomains) == 1 and a.sipdomains[0] == "toto.example.org."
= DHCP6OptSIPDomains - Instantiation with two domains
str(DHCP6OptSIPDomains(sipdomains=["toto.example.org", "titi.example.org"])) == '\x00\x15\x00$\x04toto\x07example\x03org\x00\x04titi\x07example\x03org\x00'
= DHCP6OptSIPDomains - Dissection with two domains
a = DHCP6OptSIPDomains('\x00\x15\x00$\x04toto\x07example\x03org\x00\x04TITI\x07example\x03org\x00')
a.optcode == 21 and a.optlen == 36 and len(a.sipdomains) == 2 and a.sipdomains[0] == "toto.example.org." and a.sipdomains[1] == "TITI.example.org."
= DHCP6OptSIPDomains - Enforcing only one dot at end of domain
str(DHCP6OptSIPDomains(sipdomains=["toto.example.org."])) == '\x00\x15\x00\x12\x04toto\x07example\x03org\x00'
############
############
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
+ Test DHCP6 Option - SIP Servers IPv6 Address List
= DHCP6OptSIPServers - Basic Instantiation
str(DHCP6OptSIPServers()) == '\x00\x16\x00\x00'
= DHCP6OptSIPServers - Basic Dissection
a = DHCP6OptSIPServers('\x00\x16\x00\x00')
a.optcode == 22 and a. optlen == 0 and a.sipservers == []
= DHCP6OptSIPServers - Instantiation with specific values (1 address)
str(DHCP6OptSIPServers(sipservers = ["2001:db8::1"] )) == '\x00\x16\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptSIPServers - Dissection with specific values (1 address)
a = DHCP6OptSIPServers('\x00\x16\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 22 and a.optlen == 16 and len(a.sipservers) == 1 and a.sipservers[0] == "2001:db8::1"
= DHCP6OptSIPServers - Instantiation with specific values (2 addresses)
str(DHCP6OptSIPServers(sipservers = ["2001:db8::1", "2001:db8::2"] )) == '\x00\x16\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'
= DHCP6OptSIPServers - Dissection with specific values (2 addresses)
a = DHCP6OptSIPServers('\x00\x16\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02')
a.optcode == 22 and a.optlen == 32 and len(a.sipservers) == 2 and a.sipservers[0] == "2001:db8::1" and a.sipservers[1] == "2001:db8::2"
############
############
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
+ Test DHCP6 Option - DNS Recursive Name Server
= DHCP6OptDNSServers - Basic Instantiation
str(DHCP6OptDNSServers()) == '\x00\x17\x00\x00'
= DHCP6OptDNSServers - Basic Dissection
a = DHCP6OptDNSServers('\x00\x17\x00\x00')
a.optcode == 23 and a. optlen == 0 and a.dnsservers == []
= DHCP6OptDNSServers - Instantiation with specific values (1 address)
str(DHCP6OptDNSServers(dnsservers = ["2001:db8::1"] )) == '\x00\x17\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptDNSServers - Dissection with specific values (1 address)
a = DHCP6OptDNSServers('\x00\x17\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 23 and a.optlen == 16 and len(a.dnsservers) == 1 and a.dnsservers[0] == "2001:db8::1"
= DHCP6OptDNSServers - Instantiation with specific values (2 addresses)
str(DHCP6OptDNSServers(dnsservers = ["2001:db8::1", "2001:db8::2"] )) == '\x00\x17\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'
= DHCP6OptDNSServers - Dissection with specific values (2 addresses)
a = DHCP6OptDNSServers('\x00\x17\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02')
a.optcode == 23 and a.optlen == 32 and len(a.dnsservers) == 2 and a.dnsservers[0] == "2001:db8::1" and a.dnsservers[1] == "2001:db8::2"
############
############
+ Test DHCP6 Option - DNS Domain Search List Option
= DHCP6OptDNSDomains - Basic Instantiation
str(DHCP6OptDNSDomains()) == '\x00\x18\x00\x00'
= DHCP6OptDNSDomains - Basic Dissection
a = DHCP6OptDNSDomains('\x00\x18\x00\x00')
a.optcode == 24 and a.optlen == 0 and a.dnsdomains == []
= DHCP6OptDNSDomains - Instantiation with specific values (1 domain)
str(DHCP6OptDNSDomains(dnsdomains=["toto.example.com."])) == '\x00\x18\x00\x12\x04toto\x07example\x03com\x00'
= DHCP6OptDNSDomains - Dissection with specific values (1 domain)
a = DHCP6OptDNSDomains('\x00\x18\x00\x12\x04toto\x07example\x03com\x00')
a.optcode == 24 and a.optlen == 18 and len(a.dnsdomains) == 1 and a.dnsdomains[0] == "toto.example.com."
= DHCP6OptDNSDomains - Instantiation with specific values (2 domains)
str(DHCP6OptDNSDomains(dnsdomains=["toto.example.com.", "titi.example.com."])) == '\x00\x18\x00$\x04toto\x07example\x03com\x00\x04titi\x07example\x03com\x00'
= DHCP6OptDNSDomains - Dissection with specific values (2 domains)
a = DHCP6OptDNSDomains('\x00\x18\x00$\x04toto\x07example\x03com\x00\x04titi\x07example\x03com\x00')
a.optcode == 24 and a.optlen == 36 and len(a.dnsdomains) == 2 and a.dnsdomains[0] == "toto.example.com." and a.dnsdomains[1] == "titi.example.com."
############
############
+ Test DHCP6 Option - IA_PD Prefix Option
= DHCP6OptIAPrefix - Basic Instantiation
str(DHCP6OptIAPrefix()) == '\x00\x1a\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x000 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
#TODO : finish me
############
############
+ Test DHCP6 Option - Identity Association for Prefix Delegation
= DHCP6OptIA_PD - Basic Instantiation
str(DHCP6OptIA_PD()) == '\x00\x19\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
#TODO : finish me
############
############
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
+ Test DHCP6 Option - NIS Servers
= DHCP6OptNISServers - Basic Instantiation
str(DHCP6OptNISServers()) == '\x00\x1b\x00\x00'
= DHCP6OptNISServers - Basic Dissection
a = DHCP6OptNISServers('\x00\x1b\x00\x00')
a.optcode == 27 and a. optlen == 0 and a.nisservers == []
= DHCP6OptNISServers - Instantiation with specific values (1 address)
str(DHCP6OptNISServers(nisservers = ["2001:db8::1"] )) == '\x00\x1b\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptNISServers - Dissection with specific values (1 address)
a = DHCP6OptNISServers('\x00\x1b\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 27 and a.optlen == 16 and len(a.nisservers) == 1 and a.nisservers[0] == "2001:db8::1"
= DHCP6OptNISServers - Instantiation with specific values (2 addresses)
str(DHCP6OptNISServers(nisservers = ["2001:db8::1", "2001:db8::2"] )) == '\x00\x1b\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'
= DHCP6OptNISServers - Dissection with specific values (2 addresses)
a = DHCP6OptNISServers('\x00\x1b\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02')
a.optcode == 27 and a.optlen == 32 and len(a.nisservers) == 2 and a.nisservers[0] == "2001:db8::1" and a.nisservers[1] == "2001:db8::2"
############
############
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
+ Test DHCP6 Option - NIS+ Servers
= DHCP6OptNISPServers - Basic Instantiation
str(DHCP6OptNISPServers()) == '\x00\x1c\x00\x00'
= DHCP6OptNISPServers - Basic Dissection
a = DHCP6OptNISPServers('\x00\x1c\x00\x00')
a.optcode == 28 and a. optlen == 0 and a.nispservers == []
= DHCP6OptNISPServers - Instantiation with specific values (1 address)
str(DHCP6OptNISPServers(nispservers = ["2001:db8::1"] )) == '\x00\x1c\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptNISPServers - Dissection with specific values (1 address)
a = DHCP6OptNISPServers('\x00\x1c\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 28 and a.optlen == 16 and len(a.nispservers) == 1 and a.nispservers[0] == "2001:db8::1"
= DHCP6OptNISPServers - Instantiation with specific values (2 addresses)
str(DHCP6OptNISPServers(nispservers = ["2001:db8::1", "2001:db8::2"] )) == '\x00\x1c\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'
= DHCP6OptNISPServers - Dissection with specific values (2 addresses)
a = DHCP6OptNISPServers('\x00\x1c\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02')
a.optcode == 28 and a.optlen == 32 and len(a.nispservers) == 2 and a.nispservers[0] == "2001:db8::1" and a.nispservers[1] == "2001:db8::2"
############
############
+ Test DHCP6 Option - NIS Domain Name
= DHCP6OptNISDomain - Basic Instantiation
str(DHCP6OptNISDomain()) == '\x00\x1d\x00\x00'
= DHCP6OptNISDomain - Basic Dissection
a = DHCP6OptNISDomain('\x00\x1d\x00\x00')
a.optcode == 29 and a.optlen == 0 and a.nisdomain == ""
= DHCP6OptNISDomain - Instantiation with one domain name
str(DHCP6OptNISDomain(nisdomain="toto.example.org")) == '\x00\x1d\x00\x11\x04toto\x07example\x03org'
= DHCP6OptNISDomain - Dissection with one domain name
a = DHCP6OptNISDomain('\x00\x1d\x00\x11\x04toto\x07example\x03org\x00')
a.optcode == 29 and a.optlen == 17 and a.nisdomain == "toto.example.org"
= DHCP6OptNISDomain - Instantiation with one domain with trailing dot
str(DHCP6OptNISDomain(nisdomain="toto.example.org.")) == '\x00\x1d\x00\x12\x04toto\x07example\x03org\x00'
############
############
+ Test DHCP6 Option - NIS+ Domain Name
= DHCP6OptNISPDomain - Basic Instantiation
str(DHCP6OptNISPDomain()) == '\x00\x1e\x00\x00'
= DHCP6OptNISPDomain - Basic Dissection
a = DHCP6OptNISPDomain('\x00\x1e\x00\x00')
a.optcode == 30 and a.optlen == 0 and a.nispdomain == ""
= DHCP6OptNISPDomain - Instantiation with one domain name
str(DHCP6OptNISPDomain(nispdomain="toto.example.org")) == '\x00\x1e\x00\x11\x04toto\x07example\x03org'
= DHCP6OptNISPDomain - Dissection with one domain name
a = DHCP6OptNISPDomain('\x00\x1e\x00\x11\x04toto\x07example\x03org\x00')
a.optcode == 30 and a.optlen == 17 and a.nispdomain == "toto.example.org"
= DHCP6OptNISPDomain - Instantiation with one domain with trailing dot
str(DHCP6OptNISPDomain(nispdomain="toto.example.org.")) == '\x00\x1e\x00\x12\x04toto\x07example\x03org\x00'
############
############
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
+ Test DHCP6 Option - SNTP Servers
= DHCP6OptSNTPServers - Basic Instantiation
str(DHCP6OptSNTPServers()) == '\x00\x1f\x00\x00'
= DHCP6OptSNTPServers - Basic Dissection
a = DHCP6OptSNTPServers('\x00\x1f\x00\x00')
a.optcode == 31 and a. optlen == 0 and a.sntpservers == []
= DHCP6OptSNTPServers - Instantiation with specific values (1 address)
str(DHCP6OptSNTPServers(sntpservers = ["2001:db8::1"] )) == '\x00\x1f\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptSNTPServers - Dissection with specific values (1 address)
a = DHCP6OptSNTPServers('\x00\x1f\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 31 and a.optlen == 16 and len(a.sntpservers) == 1 and a.sntpservers[0] == "2001:db8::1"
= DHCP6OptSNTPServers - Instantiation with specific values (2 addresses)
str(DHCP6OptSNTPServers(sntpservers = ["2001:db8::1", "2001:db8::2"] )) == '\x00\x1f\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'
= DHCP6OptSNTPServers - Dissection with specific values (2 addresses)
a = DHCP6OptSNTPServers('\x00\x1f\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02')
a.optcode == 31 and a.optlen == 32 and len(a.sntpservers) == 2 and a.sntpservers[0] == "2001:db8::1" and a.sntpservers[1] == "2001:db8::2"
############
############
+ Test DHCP6 Option - Information Refresh Time
= DHCP6OptInfoRefreshTime - Basic Instantiation
str(DHCP6OptInfoRefreshTime()) == '\x00 \x00\x04\x00\x01Q\x80'
= DHCP6OptInfoRefreshTime - Basic Dissction
a = DHCP6OptInfoRefreshTime('\x00 \x00\x04\x00\x01Q\x80')
a.optcode == 32 and a.optlen == 4 and a.reftime == 86400
= DHCP6OptInfoRefreshTime - Instantiation with specific values
str(DHCP6OptInfoRefreshTime(optlen=7, reftime=42)) == '\x00 \x00\x07\x00\x00\x00*'
############
############
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
+ Test DHCP6 Option - BCMCS Servers
= DHCP6OptBCMCSServers - Basic Instantiation
str(DHCP6OptBCMCSServers()) == '\x00"\x00\x00'
= DHCP6OptBCMCSServers - Basic Dissection
a = DHCP6OptBCMCSServers('\x00"\x00\x00')
a.optcode == 34 and a. optlen == 0 and a.bcmcsservers == []
= DHCP6OptBCMCSServers - Instantiation with specific values (1 address)
str(DHCP6OptBCMCSServers(bcmcsservers = ["2001:db8::1"] )) == '\x00"\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
= DHCP6OptBCMCSServers - Dissection with specific values (1 address)
a = DHCP6OptBCMCSServers('\x00"\x00\x10 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
a.optcode == 34 and a.optlen == 16 and len(a.bcmcsservers) == 1 and a.bcmcsservers[0] == "2001:db8::1"
= DHCP6OptBCMCSServers - Instantiation with specific values (2 addresses)
str(DHCP6OptBCMCSServers(bcmcsservers = ["2001:db8::1", "2001:db8::2"] )) == '\x00"\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02'
= DHCP6OptBCMCSServers - Dissection with specific values (2 addresses)
a = DHCP6OptBCMCSServers('\x00"\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02')
a.optcode == 34 and a.optlen == 32 and len(a.bcmcsservers) == 2 and a.bcmcsservers[0] == "2001:db8::1" and a.bcmcsservers[1] == "2001:db8::2"
############
############
+ Test DHCP6 Option - BCMCS Domains
= DHCP6OptBCMCSDomains - Basic Instantiation
str(DHCP6OptBCMCSDomains()) == '\x00!\x00\x00'
= DHCP6OptBCMCSDomains - Basic Dissection
a = DHCP6OptBCMCSDomains('\x00!\x00\x00')
a.optcode == 33 and a.optlen == 0 and a.bcmcsdomains == []
= DHCP6OptBCMCSDomains - Instantiation with specific values (1 domain)
str(DHCP6OptBCMCSDomains(bcmcsdomains=["toto.example.com."])) == '\x00!\x00\x12\x04toto\x07example\x03com\x00'
= DHCP6OptBCMCSDomains - Dissection with specific values (1 domain)
a = DHCP6OptBCMCSDomains('\x00!\x00\x12\x04toto\x07example\x03com\x00')
a.optcode == 33 and a.optlen == 18 and len(a.bcmcsdomains) == 1 and a.bcmcsdomains[0] == "toto.example.com."
= DHCP6OptBCMCSDomains - Instantiation with specific values (2 domains)
str(DHCP6OptBCMCSDomains(bcmcsdomains=["toto.example.com.", "titi.example.com."])) == '\x00!\x00$\x04toto\x07example\x03com\x00\x04titi\x07example\x03com\x00'
= DHCP6OptBCMCSDomains - Dissection with specific values (2 domains)
a = DHCP6OptBCMCSDomains('\x00!\x00$\x04toto\x07example\x03com\x00\x04titi\x07example\x03com\x00')
a.optcode == 33 and a.optlen == 36 and len(a.bcmcsdomains) == 2 and a.bcmcsdomains[0] == "toto.example.com." and a.bcmcsdomains[1] == "titi.example.com."
############
############
+ Test DHCP6 Option - Relay Agent Remote-ID
= DHCP6OptRemoteID - Basic Instantiation
str(DHCP6OptRemoteID()) == '\x00%\x00\x04\x00\x00\x00\x00'
= DHCP6OptRemoteID - Basic Dissection
a = DHCP6OptRemoteID('\x00%\x00\x04\x00\x00\x00\x00')
a.optcode == 37 and a.optlen == 4 and a.enterprisenum == 0 and a.remoteid == ""
= DHCP6OptRemoteID - Instantiation with specific values
str(DHCP6OptRemoteID(enterprisenum=0xeeeeeeee, remoteid="someid")) == '\x00%\x00\n\xee\xee\xee\xeesomeid'
= DHCP6OptRemoteID - Dissection with specific values
a = DHCP6OptRemoteID('\x00%\x00\n\xee\xee\xee\xeesomeid')
a.optcode == 37 and a.optlen == 10 and a.enterprisenum == 0xeeeeeeee and a.remoteid == "someid"
############
############
+ Test DHCP6 Option - Subscriber ID
= DHCP6OptSubscriberID - Basic Instantiation
str(DHCP6OptSubscriberID()) == '\x00&\x00\x00'
= DHCP6OptSubscriberID - Basic Dissection
a = DHCP6OptSubscriberID('\x00&\x00\x00')
a.optcode == 38 and a.optlen == 0 and a.subscriberid == ""
= DHCP6OptSubscriberID - Instantiation with specific values
str(DHCP6OptSubscriberID(subscriberid="someid")) == '\x00&\x00\x06someid'
= DHCP6OptSubscriberID - Dissection with specific values
a = DHCP6OptSubscriberID('\x00&\x00\x06someid')
a.optcode == 38 and a.optlen == 6 and a.subscriberid == "someid"
############
############
+ Test DHCP6 Option - Client FQDN
= DHCP6OptClientFQDN - Basic Instantiation
str(DHCP6OptClientFQDN()) == "\x00'\x00\x01\x00"
= DHCP6OptClientFQDN - Basic Dissection
a = DHCP6OptClientFQDN("\x00'\x00\x01\x00")
a.optcode == 39 and a.optlen == 1 and a.res == 0 and a.flags == 0 and a.fqdn == ""
= DHCP6OptClientFQDN - Instantiation with various flags combinations
str(DHCP6OptClientFQDN(flags="S")) == "\x00'\x00\x01\x01" and str(DHCP6OptClientFQDN(flags="O")) == "\x00'\x00\x01\x02" and str(DHCP6OptClientFQDN(flags="N")) == "\x00'\x00\x01\x04" and str(DHCP6OptClientFQDN(flags="SON")) == "\x00'\x00\x01\x07" and str(DHCP6OptClientFQDN(flags="ON")) == "\x00'\x00\x01\x06"
= DHCP6OptClientFQDN - Instantiation with one fqdn
str(DHCP6OptClientFQDN(fqdn="toto.example.org")) == "\x00'\x00\x12\x00\x04toto\x07example\x03org"
a = DHCP6OptClientFQDN("\x00'\x00\x12\x00\x04toto\x07example\x03org\x00")
a.optcode == 39 and a.optlen == 18 and a.res == 0 and a.flags == 0 and a.fqdn == "toto.example.org"
############
############
+ Test DHCP6 Option Relay Agent Echo Request Option
= DHCP6OptRelayAgentERO - Basic Instantiation
str(DHCP6OptRelayAgentERO()) == '\x00+\x00\x04\x00\x17\x00\x18'
= DHCP6OptRelayAgentERO - optlen field computation
str(DHCP6OptRelayAgentERO(reqopts=[1,2,3,4])) == '\x00+\x00\x08\x00\x01\x00\x02\x00\x03\x00\x04'
= DHCP6OptRelayAgentERO - instantiation with empty list
str(DHCP6OptRelayAgentERO(reqopts=[])) == '\x00+\x00\x00'
= DHCP6OptRelayAgentERO - Basic dissection
a=DHCP6OptRelayAgentERO('\x00+\x00\x00')
a.optcode == 43 and a.optlen == 0 and a.reqopts == [23,24]
= DHCP6OptRelayAgentERO - Dissection with specific value
a=DHCP6OptRelayAgentERO('\x00+\x00\x08\x00\x01\x00\x02\x00\x03\x00\x04')
a.optcode == 43 and a.optlen == 8 and a.reqopts == [1,2,3,4]
############
############
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
+ Test DHCP6 Messages - DHCP6_Solicit
= DHCP6_Solicit - Basic Instantiation
str(DHCP6_Solicit()) == '\x01\x00\x00\x00'
= DHCP6_Solicit - Basic Dissection
a = DHCP6_Solicit('\x01\x00\x00\x00')
a.msgtype == 1 and a.trid == 0
= DHCP6_Solicit - Basic test of DHCP6_solicit.hashret()
DHCP6_Solicit().hashret() == '\x00\x00\x00'
= DHCP6_Solicit - Test of DHCP6_solicit.hashret() with specific values
DHCP6_Solicit(trid=0xbbccdd).hashret() == '\xbb\xcc\xdd'
= DHCP6_Solicit - UDP ports overload
a=UDP()/DHCP6_Solicit()
a.sport == 546 and a.dport == 547
= DHCP6_Solicit - Dispatch based on UDP port
a=UDP(str(UDP()/DHCP6_Solicit()))
isinstance(a.payload, DHCP6_Solicit)
############
############
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
+ Test DHCP6 Messages - DHCP6_Advertise
= DHCP6_Advertise - Basic Instantiation
str(DHCP6_Advertise()) == '\x02\x00\x00\x00'
= DHCP6_Advertise - Basic test of DHCP6_solicit.hashret()
DHCP6_Advertise().hashret() == '\x00\x00\x00'
= DHCP6_Advertise - Test of DHCP6_Advertise.hashret() with specific values
DHCP6_Advertise(trid=0xbbccdd).hashret() == '\xbb\xcc\xdd'
= DHCP6_Advertise - Basic test of answers() with solicit message
a = DHCP6_Solicit()
b = DHCP6_Advertise()
a > b
= DHCP6_Advertise - Test of answers() with solicit message
a = DHCP6_Solicit(trid=0xbbccdd)
b = DHCP6_Advertise(trid=0xbbccdd)
a > b
= DHCP6_Advertise - UDP ports overload
a=UDP()/DHCP6_Advertise()
a.sport == 547 and a.dport == 546
############
############
+ Test DHCP6 Messages - DHCP6_Request
= DHCP6_Request - Basic Instantiation
str(DHCP6_Request()) == '\x03\x00\x00\x00'
= DHCP6_Request - Basic Dissection
a=DHCP6_Request('\x03\x00\x00\x00')
a.msgtype == 3 and a.trid == 0
= DHCP6_Request - UDP ports overload
a=UDP()/DHCP6_Request()
a.sport == 546 and a.dport == 547
############
############
+ Test DHCP6 Messages - DHCP6_Confirm
= DHCP6_Confirm - Basic Instantiation
str(DHCP6_Confirm()) == '\x04\x00\x00\x00'
= DHCP6_Confirm - Basic Dissection
a=DHCP6_Confirm('\x04\x00\x00\x00')
a.msgtype == 4 and a.trid == 0
= DHCP6_Confirm - UDP ports overload
a=UDP()/DHCP6_Confirm()
a.sport == 546 and a.dport == 547
############
############
+ Test DHCP6 Messages - DHCP6_Renew
= DHCP6_Renew - Basic Instantiation
str(DHCP6_Renew()) == '\x05\x00\x00\x00'
= DHCP6_Renew - Basic Dissection
a=DHCP6_Renew('\x05\x00\x00\x00')
a.msgtype == 5 and a.trid == 0
= DHCP6_Renew - UDP ports overload
a=UDP()/DHCP6_Renew()
a.sport == 546 and a.dport == 547
############
############
+ Test DHCP6 Messages - DHCP6_Rebind
= DHCP6_Rebind - Basic Instantiation
str(DHCP6_Rebind()) == '\x06\x00\x00\x00'
= DHCP6_Rebind - Basic Dissection
a=DHCP6_Rebind('\x06\x00\x00\x00')
a.msgtype == 6 and a.trid == 0
= DHCP6_Rebind - UDP ports overload
a=UDP()/DHCP6_Rebind()
a.sport == 546 and a.dport == 547
############
############
+ Test DHCP6 Messages - DHCP6_Reply
= DHCP6_Reply - Basic Instantiation
str(DHCP6_Reply()) == '\x07\x00\x00\x00'
= DHCP6_Reply - Basic Dissection
a=DHCP6_Reply('\x07\x00\x00\x00')
a.msgtype == 7 and a.trid == 0
= DHCP6_Reply - UDP ports overload
a=UDP()/DHCP6_Reply()
############
############
+ Test DHCP6 Messages - DHCP6_Release
= DHCP6_Release - Basic Instantiation
str(DHCP6_Release()) == '\x08\x00\x00\x00'
= DHCP6_Release - Basic Dissection
a=DHCP6_Release('\x08\x00\x00\x00')
a.msgtype == 8 and a.trid == 0
= DHCP6_Release - UDP ports overload
a=UDP()/DHCP6_Release()
a.sport == 546 and a.dport == 547
############
############
+ Test DHCP6 Messages - DHCP6_Decline
= DHCP6_Decline - Basic Instantiation
str(DHCP6_Decline()) == '\x09\x00\x00\x00'
= DHCP6_Confirm - Basic Dissection
a=DHCP6_Confirm('\x09\x00\x00\x00')
a.msgtype == 9 and a.trid == 0
= DHCP6_Decline - UDP ports overload
a=UDP()/DHCP6_Decline()
a.sport == 546 and a.dport == 547
############
############
+ Test DHCP6 Messages - DHCP6_Reconf
= DHCP6_Reconf - Basic Instantiation
str(DHCP6_Reconf()) == '\x0A\x00\x00\x00'
= DHCP6_Reconf - Basic Dissection
a=DHCP6_Reconf('\x0A\x00\x00\x00')
a.msgtype == 10 and a.trid == 0
= DHCP6_Reconf - UDP ports overload
a=UDP()/DHCP6_Reconf()
a.sport == 547 and a.dport == 546
############
############
+ Test DHCP6 Messages - DHCP6_InfoRequest
= DHCP6_InfoRequest - Basic Instantiation
str(DHCP6_InfoRequest()) == '\x0B\x00\x00\x00'
= DHCP6_InfoRequest - Basic Dissection
a=DHCP6_InfoRequest('\x0B\x00\x00\x00')
a.msgtype == 11 and a.trid == 0
= DHCP6_InfoRequest - UDP ports overload
a=UDP()/DHCP6_InfoRequest()
a.sport == 546 and a.dport == 547
############
############
+ Test DHCP6 Messages - DHCP6_RelayForward
= DHCP6_RelayForward - Basic Instantiation
str(DHCP6_RelayForward()) == '\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
= DHCP6_RelayForward - Basic Dissection
a=DHCP6_RelayForward('\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.msgtype == 12 and a.hopcount == 0 and a.linkaddr == "::" and a.peeraddr == "::"
= DHCP6_RelayForward - Dissection with options
a = DHCP6_RelayForward('\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x04\x00\x01\x00\x00')
a.msgtype == 12 and DHCP6OptRelayMsg in a and DHCP6OptClientId in a
############
############
+ Test DHCP6 Messages - DHCP6_RelayReply
= DHCP6_RelayReply - Basic Instantiation
str(DHCP6_RelayReply()) == '\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
= DHCP6_RelayReply - Basic Dissection
a=DHCP6_RelayReply('\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a.msgtype == 13 and a.hopcount == 0 and a.linkaddr == "::" and a.peeraddr == "::"
############
############
+ Home Agent Address Discovery
= in6_getha()
in6_getha('2001:db8::') == '2001:db8::fdff:ffff:ffff:fffe'
= ICMPv6HAADRequest - build/dissection
p = IPv6(str(IPv6(dst=in6_getha('2001:db8::'), src='2001:db8::1')/ICMPv6HAADRequest(id=42)))
p.cksum == 0x9620 and p.dst == '2001:db8::fdff:ffff:ffff:fffe' and p.R == 1
= ICMPv6HAADReply - build/dissection
p = IPv6(str(IPv6(dst='2001:db8::1', src='2001:db8::42')/ICMPv6HAADReply(id=42, addresses=['2001:db8::2', '2001:db8::3'])))
p.cksum = 0x3747 and p.addresses == [ '2001:db8::2', '2001:db8::3' ]
= ICMPv6HAADRequest / ICMPv6HAADReply - build/dissection
a=ICMPv6HAADRequest(id=42)
b=ICMPv6HAADReply(id=42)
not a < b and a > b
############
############
+ Mobile Prefix Solicitation/Advertisement
= ICMPv6MPSol - build (default values)
if WINDOWS:
route_add_loopback()
s = '`\x00\x00\x00\x00\x08:@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x92\x00m\xbb\x00\x00\x00\x00'
str(IPv6()/ICMPv6MPSol()) == s
= ICMPv6MPSol - dissection (default values)
p = IPv6(s)
p[ICMPv6MPSol].type == 146 and p[ICMPv6MPSol].cksum == 0x6dbb and p[ICMPv6MPSol].id == 0
= ICMPv6MPSol - build
s = '`\x00\x00\x00\x00\x08:@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x92\x00(\x08\x00\x08\x00\x00'
str(IPv6()/ICMPv6MPSol(cksum=0x2808, id=8)) == s
= ICMPv6MPSol - dissection
p = IPv6(s)
p[ICMPv6MPSol].cksum == 0x2808 and p[ICMPv6MPSol].id == 8
= ICMPv6MPAdv - build (default values)
s = '`\x00\x00\x00\x00(:@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x93\x00\xe8\xd6\x00\x00\x80\x00\x03\x04\x00\xc0\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
str(IPv6()/ICMPv6MPAdv()/ICMPv6NDOptPrefixInfo()) == s
= ICMPv6MPAdv - dissection (default values)