Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
# 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
#####################################################################
+ 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'
#####################################################################
+ 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'
#####################################################################
+ 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."
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
= DHCP6OptSIPDomains - Enforcing only one dot at end of domain
str(DHCP6OptSIPDomains(sipdomains=["toto.example.org."])) == '\x00\x15\x00\x12\x04toto\x07example\x03org\x00'
#####################################################################
+ 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"
#####################################################################
+ 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."
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
#####################################################################
+ 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
#####################################################################
+ 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"
#####################################################################
+ 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"
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
= DHCP6OptNISPDomain - Instantiation with one domain with trailing dot
str(DHCP6OptNISPDomain(nispdomain="toto.example.org.")) == '\x00\x1e\x00\x12\x04toto\x07example\x03org\x00'
#####################################################################
+ 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*'
#####################################################################
+ 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."
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
#####################################################################
+ 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"
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
#####################################################################
+ 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]
#####################################################################
+ 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)
#####################################################################
+ 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()
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
#####################################################################
+ 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
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
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
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
#####################################################################
+ 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 == "::"
#####################################################################
#####################################################################
################# MIPv6 and NEMO #################
#####################################################################
#####################################################################
+ 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)
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)
p = IPv6(s)
p[ICMPv6MPAdv].type == 147 and p[ICMPv6MPAdv].cksum == 0xe8d6 and p[ICMPv6NDOptPrefixInfo].prefix == '::'
= ICMPv6MPAdv - build
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(\x07\x00*@\x00\x03\x04\x00@\xff\xff\xff\xff\x00\x00\x00\x0c\x00\x00\x00\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
str(IPv6()/ICMPv6MPAdv(cksum=0x2807, flags=1, id=42)/ICMPv6NDOptPrefixInfo(prefix='2001:db8::1', L=0, preferredlifetime=12)) == s
= ICMPv6MPAdv - dissection
p = IPv6(s)
p[ICMPv6MPAdv].cksum == 0x2807 and p[ICMPv6MPAdv].flags == 1 and p[ICMPv6MPAdv].id == 42 and p[ICMPv6NDOptPrefixInfo].prefix == '2001:db8::1' and p[ICMPv6NDOptPrefixInfo].preferredlifetime == 12
+ Type 2 Routing Header
= IPv6ExtHdrRouting - type 2 - build/dissection
p = IPv6(str(IPv6(dst='2001:db8::1', src='2001:db8::2')/IPv6ExtHdrRouting(type=2, addresses=['2001:db8::3'])/ICMPv6EchoRequest()))
p.type == 2 and len(p.addresses) == 1 and p.cksum == 0x2446
+ Mobility Options - Binding Refresh Advice
= MIP6OptBRAdvice - build (default values)
s = '\x02\x02\x00\x00'
str(MIP6OptBRAdvice()) == s
= MIP6OptBRAdvice - dissection (default values)
p = MIP6OptBRAdvice(s)
p.otype == 2 and p.olen == 2 and p.rinter == 0
= MIP6OptBRAdvice - build
s = '\x03*\n\xf7'
str(MIP6OptBRAdvice(otype=3, olen=42, rinter=2807)) == s
= MIP6OptBRAdvice - dissection
p = MIP6OptBRAdvice(s)
p.otype == 3 and p.olen == 42 and p.rinter == 2807
+ Mobility Options - Alternate Care-of Address
= MIP6OptAltCoA - build (default values)
s = '\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
str(MIP6OptAltCoA()) == s
= MIP6OptAltCoA - dissection (default values)
p = MIP6OptAltCoA(s)
p.otype == 3 and p.olen == 16 and p.acoa == '::'
= MIP6OptAltCoA - build
s = '*\x08 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
str(MIP6OptAltCoA(otype=42, olen=8, acoa='2001:db8::1')) == s
= MIP6OptAltCoA - dissection
p = MIP6OptAltCoA(s)
p.otype == 42 and p.olen == 8 and p.acoa == '2001:db8::1'
+ Mobility Options - Nonce Indices
= MIP6OptNonceIndices - build (default values)
s = '\x04\x10\x00\x00\x00\x00'
str(MIP6OptNonceIndices()) == s
= MIP6OptNonceIndices - dissection (default values)
p = MIP6OptNonceIndices(s)
p.otype == 4 and p.olen == 16 and p.hni == 0 and p.coni == 0
= MIP6OptNonceIndices - build
s = '\x04\x12\x00\x13\x00\x14'
str(MIP6OptNonceIndices(olen=18, hni=19, coni=20)) == s
= MIP6OptNonceIndices - dissection
p = MIP6OptNonceIndices(s)
p.hni == 19 and p.coni == 20
+ Mobility Options - Binding Authentication Data
= MIP6OptBindingAuthData - build (default values)
s = '\x05\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
str(MIP6OptBindingAuthData()) == s
= MIP6OptBindingAuthData - dissection (default values)
p = MIP6OptBindingAuthData(s)
p.otype == 5 and p.olen == 16 and p.authenticator == 0
= MIP6OptBindingAuthData - build
s = '\x05*\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\n\xf7'
str(MIP6OptBindingAuthData(olen=42, authenticator=2807)) == s
= MIP6OptBindingAuthData - dissection
p = MIP6OptBindingAuthData(s)
p.otype == 5 and p.olen == 42 and p.authenticator == 2807
+ Mobility Options - Mobile Network Prefix
= MIP6OptMobNetPrefix - build (default values)
s = '\x06\x12\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
str(MIP6OptMobNetPrefix()) == s
= MIP6OptMobNetPrefix - dissection (default values)
p = MIP6OptMobNetPrefix(s)
p.otype == 6 and p.olen == 18 and p.plen == 64 and p.prefix == '::'
= MIP6OptMobNetPrefix - build
s = '\x06*\x02 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
str(MIP6OptMobNetPrefix(olen=42, reserved=2, plen=32, prefix='2001:db8::')) == s
= MIP6OptMobNetPrefix - dissection
p = MIP6OptMobNetPrefix(s)
p.olen == 42 and p.reserved == 2 and p.plen == 32 and p.prefix == '2001:db8::'
+ Mobility Options - Link-Layer Address (MH-LLA)
= MIP6OptLLAddr - basic build
str(MIP6OptLLAddr()) == '\x07\x07\x02\x00\x00\x00\x00\x00\x00\x00'
= MIP6OptLLAddr - basic dissection
p = MIP6OptLLAddr('\x07\x07\x02\x00\x00\x00\x00\x00\x00\x00')
p.otype == 7 and p.olen == 7 and p.ocode == 2 and p.pad == 0 and p.lla == "00:00:00:00:00:00"
= MIP6OptLLAddr - build with specific values
str(MIP6OptLLAddr(olen=42, ocode=4, pad=0xff, lla='EE:EE:EE:EE:EE:EE')) == '\x07*\x04\xff\xee\xee\xee\xee\xee\xee'
= MIP6OptLLAddr - dissection with specific values
p = MIP6OptLLAddr('\x07*\x04\xff\xee\xee\xee\xee\xee\xee')
str(MIP6OptLLAddr(olen=42, ocode=4, pad=0xff, lla='EE:EE:EE:EE:EE:EE'))
p.otype == 7 and p.olen == 42 and p.ocode == 4 and p.pad == 0xff and p.lla == "ee:ee:ee:ee:ee:ee"
+ Mobility Options - Mobile Node Identifier
= MIP6OptMNID - basic build
str(MIP6OptMNID()) == '\x08\x01\x01'
= MIP6OptMNID - basic dissection
p = MIP6OptMNID('\x08\x01\x01')
p.otype == 8 and p.olen == 1 and p.subtype == 1 and p.id == ""
= MIP6OptMNID - build with specific values
str(MIP6OptMNID(subtype=42, id="someid")) == '\x08\x07*someid'
= MIP6OptMNID - dissection with specific values
p = MIP6OptMNID('\x08\x07*someid')
p.otype == 8 and p.olen == 7 and p.subtype == 42 and p.id == "someid"
+ Mobility Options - Message Authentication
= MIP6OptMsgAuth - basic build
str(MIP6OptMsgAuth()) == '\x09\x11\x01\x00\x00\x00\x00AAAAAAAAAAAA'
= MIP6OptMsgAuth - basic dissection
p = MIP6OptMsgAuth('\x09\x11\x01\x00\x00\x00\x00AAAAAAAAAAAA')
p.otype == 9 and p.olen == 17 and p.subtype == 1 and p.mspi == 0 and p.authdata == "A"*12
= MIP6OptMsgAuth - build with specific values
str(MIP6OptMsgAuth(authdata="B"*16, mspi=0xeeeeeeee, subtype=0xff)) == '\t\x15\xff\xee\xee\xee\xeeBBBBBBBBBBBBBBBB'
= MIP6OptMsgAuth - dissection with specific values
p = MIP6OptMsgAuth('\t\x15\xff\xee\xee\xee\xeeBBBBBBBBBBBBBBBB')
p.otype == 9 and p.olen == 21 and p.subtype == 255 and p.mspi == 0xeeeeeeee and p.authdata == "B"*16
+ Mobility Options - Replay Protection
= MIP6OptReplayProtection - basic build
str(MIP6OptReplayProtection()) == '\n\x08\x00\x00\x00\x00\x00\x00\x00\x00'
= MIP6OptReplayProtection - basic dissection
p = MIP6OptReplayProtection('\n\x08\x00\x00\x00\x00\x00\x00\x00\x00')
p.otype == 10 and p.olen == 8 and p.timestamp == 0
= MIP6OptReplayProtection - build with specific values
str(MIP6OptReplayProtection(olen=42, timestamp=(52*31536000)<<32)) == '\n*a\xbev\x00\x00\x00\x00\x00'
= MIP6OptReplayProtection - dissection with specific values
p = MIP6OptReplayProtection('\n*a\xbev\x00\x00\x00\x00\x00')
p.otype == 10 and p.olen == 42 and p.timestamp == 7043196609626112000L
+ Mobility Options - CGA Parameters
= MIP6OptCGAParams
+ Mobility Options - Signature
= MIP6OptSignature
+ Mobility Options - Permanent Home Keygen Token
= MIP6OptHomeKeygenToken
+ Mobility Options - Care-of Test Init
= MIP6OptCareOfTestInit
+ Mobility Options - Care-of Test
= MIP6OptCareOfTest
+ Mobility Options - Automatic Padding - MIP6OptBRAdvice
= Mobility Options - Automatic Padding - MIP6OptBRAdvice
a = str(MIP6MH_BU(seq=0x4242, options=[MIP6OptBRAdvice()])) ==';\x01\x05\x00\x00\x00BB\xd0\x00\x00\x03\x02\x02\x00\x00'
b = str(MIP6MH_BU(seq=0x4242, options=[Pad1(),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x00\x00\x02\x02\x00\x00\x01\x04\x00\x00\x00\x00'
c = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*0),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x00\x02\x02\x00\x00\x01\x04\x00\x00\x00\x00'
d = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*1),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x01\x00\x00\x02\x02\x00\x00\x01\x02\x00\x00'
e = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*2),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x02\x00\x00\x02\x02\x00\x00\x01\x02\x00\x00'
g = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*3),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x03\x00\x00\x00\x00\x02\x02\x00\x00\x01\x00'
h = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*4),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x04\x00\x00\x00\x00\x02\x02\x00\x00\x01\x00'
i = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*5),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x05\x00\x00\x00\x00\x00\x00\x02\x02\x00\x00'
j = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*6),MIP6OptBRAdvice()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x06\x00\x00\x00\x00\x00\x00\x02\x02\x00\x00'
a and b and c and d and e and g and h and i and j
+ Mobility Options - Automatic Padding - MIP6OptAltCoA
= Mobility Options - Automatic Padding - MIP6OptAltCoA
a = str(MIP6MH_BU(seq=0x4242, options=[MIP6OptAltCoA()])) ==';\x03\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
b = str(MIP6MH_BU(seq=0x4242, options=[Pad1(),MIP6OptAltCoA()])) ==';\x03\x05\x00\x00\x00BB\xd0\x00\x00\x03\x00\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
c = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*0),MIP6OptAltCoA()])) ==';\x03\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
d = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*1),MIP6OptAltCoA()])) ==';\x04\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x01\x00\x01\x05\x00\x00\x00\x00\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
e = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*2),MIP6OptAltCoA()])) ==';\x04\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x02\x00\x00\x01\x04\x00\x00\x00\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
g = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*3),MIP6OptAltCoA()])) ==';\x04\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x03\x00\x00\x00\x01\x03\x00\x00\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
h = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*4),MIP6OptAltCoA()])) ==';\x04\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x04\x00\x00\x00\x00\x01\x02\x00\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
i = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*5),MIP6OptAltCoA()])) ==';\x04\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x05\x00\x00\x00\x00\x00\x01\x01\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
j = str(MIP6MH_BU(seq=0x4242, options=[PadN(optdata='\x00'*6),MIP6OptAltCoA()])) ==';\x04\x05\x00\x00\x00BB\xd0\x00\x00\x03\x01\x06\x00\x00\x00\x00\x00\x00\x01\x00\x03\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
a and b and c and d and e and g and h and i and j
+ Mobility Options - Automatic Padding - MIP6OptNonceIndices
= Mobility Options - Automatic Padding - MIP6OptNonceIndices
a = str(MIP6MH_BU(seq=0x4242, options=[MIP6OptNonceIndices()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x04\x10\x00\x00\x00\x00\x01\x04\x00\x00\x00\x00'
b = str(MIP6MH_BU(seq=0x4242, options=[Pad1(),MIP6OptNonceIndices()])) ==';\x02\x05\x00\x00\x00BB\xd0\x00\x00\x03\x00\x00\x04\x10\x00\x00\x00\x00\x01\x02\x00\x00'