Documentation ¶
Overview ¶
Package ndntestvector contains test vectors of NDN packets.
Index ¶
Constants ¶
View Source
const NotNni uint64 = 0xB9C0CEA091E491F0
NotNni in TlvElementTests indicates the TLV-VALUE is not a non-negative integer.
Variables ¶
View Source
var ( TestbedArizona20200301 = makeDataFromBase64(` Bv0CxgcxCANuZG4IA2VkdQgHYXJpem9uYQgDS0VZCAgk8wnxnkmjlwgCTkEICf0A AAFwnGPguhQJGAECGQQANu6AFf0BJjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBAMM/l8Stuasx/HUfl4B2yzFGHpWFsEriuaAuH/getpgfE7xLvQ+jWljS P0WC5p8dERE+m4/hTSrw09XveXJ+9xhSIVMW0bGc9sFVbGV3qMBtifqqGYUGgv65 u8Elj/B+aYrAN6KO4LX0f7S1K9E7iSwRWDxbTvuDDHDeiyoxJi7pmcv6EzQSlD4i vhdSQKbZv1Sz7iuIL57dmJeB6eMA3ttHvU/YCrSD46hghYbh9VNaZESBVfutwVlJ 1tfVj5/LmmzrEdP067I6aaBMUT2TJ7VdDtw4PFwJVb74XUL6flHzr4V/QI4cUyQn o3rAJ9+95eU2VsPwhutunjK/XCl1eJ0CAwEAARb9ARAbAQMcFgcUCANuZG4IA0tF WQgIZZ1/pcWBEH39AP0m/QD+DzIwMjAwMzAxVDE3NTU1Nv0A/w8yMDIxMDMwMlQx NzU1NTb9AQLH/QIAD/0CAQdhZHZpc29y/QICAP0CADf9AgEFZW1haWz9AgIqL25k bi9lZHUvYXJpem9uYS9Ab3BlcmF0b3JzLm5hbWVkLWRhdGEubmV0/QIAKf0CAQhm dWxsbmFtZf0CAhlUaGUgVW5pdmVyc2l0eSBvZiBBcml6b25h/QIADf0CAQVncm91 cP0CAgD9AgAP/QIBB2hvbWV1cmz9AgIA/QIAJP0CAQxvcmdhbml6YXRpb279AgIQ TkROIFRlc3RiZWQgUm9vdBdIMEYCIQCRlyhpTVvQaBSOJOccmnRRJ5+xGQFi1BeN 53zDaGdfGgIhA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VY+NgIgT4nBoHDJkbeeAg7+tpAY E2rs8ThtmNI1je+CP5CfKOE=`) Ed25519Demo = makeDataFromBase64(` Bv0BCgc1CAxFZDI1NTE5LWRlbW8IA0tFWQgQNWE2MTVkYjdjZjA2MDNiNQgEc2Vs ZjYIAAABgQD8AY0UCRgBAhkEADbugBUsMCowBQYDK2VwAyEAQxUZBL+3I3D4oDIJ tJvuCTguHM7AUbhlhA/wu8ZhrkwWVhsBBRwnByUIDEVkMjU1MTktZGVtbwgDS0VZ CBA1YTYxNWRiN2NmMDYwM2I1/QD9Jv0A/g8xOTcwMDEwMVQwMDAwMDD9AP8PMjAy MjA1MjZUMTUyODQ0F0DAAWCZzxQSCAV0tluFDry5aT1b+EgoYgT1JKxbKVb/tINx M43PFy/2hDe8j61PuYD9tCah0TWapPwfXWi3fygA`) )
NDN certificate samples. Each is a function that returns the certificate Data packet.
View Source
var LpDecodeTests = []struct { Input string Bad bool SeqNum uint64 FragIndex uint16 FragCount uint16 PitToken []byte NackReason uint8 CongMark uint8 PayloadL int }{ {Input: "", Bad: true}, {Input: bareInterest, FragCount: 1, PayloadL: payloadInterestL}, {Input: "6409 payload=" + payloadInterest, FragCount: 1, PayloadL: payloadInterestL}, {Input: "6402 unknown-critical=6300", Bad: true}, {Input: "6404 unknown-critical=FD03BF00", Bad: true}, {Input: "6404 unknown-ignored=FD03BC00", FragCount: 1}, {Input: "6413 seq=5108A0A1A2A3A4A5A600 fragcount=530102 payload=" + payloadFragment, SeqNum: 0xA0A1A2A3A4A5A600, FragIndex: 0, FragCount: 2, PayloadL: payloadFragmentL}, {Input: "6416 seq=5108A0A1A2A3A4A5A601 fragindex=520101 fragcount=530102 " + "payload=" + payloadFragment, SeqNum: 0xA0A1A2A3A4A5A601, FragIndex: 1, FragCount: 2, PayloadL: payloadFragmentL}, {Input: "6417 seq=5108A0A1A2A3A4A5A601 fragindex=520102 fragcount=530102 " + "payload=" + payloadFragment, Bad: true}, {Input: "6413 pittoken=62089A414B412BC38EB2 payload=" + payloadInterest, PitToken: bytesFromHex("9A414B412BC38EB2"), PayloadL: payloadInterestL}, {Input: "640F pittoken=620420A3C0D7 payload=" + payloadInterest, PitToken: bytesFromHex("20A3C0D7"), PayloadL: payloadInterestL}, {Input: "642B pittoken=6220B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7 " + "payload=" + payloadInterest, PitToken: bytesFromHex("B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7"), PayloadL: payloadInterestL}, {Input: "642C pittoken=6221B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7B0B1B2B3B4B5B6B7BB " + "payload=" + payloadInterest, Bad: true}, {Input: "640D nack=FD032000(noreason) payload=" + payloadInterest, NackReason: an.NackUnspecified, PayloadL: payloadInterestL}, {Input: "6412 nack=FD032005(FD03210196~noroute) payload=" + payloadInterest, NackReason: an.NackNoRoute, PayloadL: payloadInterestL}, {Input: "640E congmark=FD03400104 payload=" + payloadInterest, CongMark: 4, PayloadL: payloadInterestL}, }
LpDecodeTests contains test vectors for NDNLPv2 decoder.
View Source
var TlvElementTests = []struct { Input string Bad bool Type uint32 Value string Nni uint64 }{ {Input: "", Bad: true}, {Input: "01", Bad: true}, {Input: "01 01", Bad: true}, {Input: "01 FD00", Bad: true}, {Input: "01 FF0000000100000000 A0", Bad: true}, {Input: "01 04 A0A1", Bad: true}, {Input: "00 00", Bad: true}, {Input: "FF0000000100000000 00", Bad: true}, {Input: "01 00", Type: 0x01, Value: "", Nni: NotNni}, {Input: "FC 01 01", Type: 0xFC, Value: "01", Nni: 0x01}, {Input: "FD00FD 02 A0A1", Type: 0xFD, Value: "A0A1", Nni: 0xA0A1}, {Input: "FD00FF 03 A0A1A2", Type: 0xFF, Value: "A0A1A2", Nni: NotNni}, {Input: "FE00010000 04 A0A1A2A3", Type: 0x10000, Value: "A0A1A2A3", Nni: 0xA0A1A2A3}, {Input: "FEFFFFFFFF 05 A0A1A2A3A4", Type: 0xFFFFFFFF, Value: "A0A1A2A3A4", Nni: NotNni}, {Input: "01 06 A0A1A2A3A4A5", Type: 0x01, Value: "A0A1A2A3A4A5", Nni: NotNni}, {Input: "01 07 A0A1A2A3A4A5A6", Type: 0x01, Value: "A0A1A2A3A4A5A6", Nni: NotNni}, {Input: "01 08 A0A1A2A3A4A5A6A7", Type: 0x01, Value: "A0A1A2A3A4A5A6A7", Nni: 0xA0A1A2A3A4A5A6A7}, {Input: "01 09 A0A1A2A3A4A5A6A7A8", Type: 0x01, Value: "A0A1A2A3A4A5A6A7A8", Nni: NotNni}, }
TlvElementTests contains test vectors for TLV element decoder.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.