RFC1034

command
v0.0.0-...-0c7c43c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package rfc1034 encompasses portions of:

RFC 1034 - "Domain Names - Concepts and Facilities"

This subpackage implements relevant methods and checks for validating the composition of a candidate RFC 1034 Absolute Name (aka FQDN).

This package's implementation of this RFC is a work-in-progress and may not necessarily be complete!

To see the actual RFC, visit: https://tools.ietf.org/html/rfc1034, or see the documentation for reference on the RFCEntity.URL() method for programmatic URL lookups.

This subpackage is currently maintained by Jesse Coretta (subcon42)

Section 3.1

This module currently focuses heavily on Section 3.1 of RFC 1034 under the tone of the RFC 2119 Must Imperative. Conditions that are evaluated are as follows:

➡ Total length (253 typed characters)

➡ First absolute name character is total length indicator (1 uint8)

➡ First byte in each label is label length indicator (1 uint8)

➡ Label length(s) for typed characters (1-63 characters each)

➡ Segmentation (label) count is less than, or equal to, 127

➡ Identical brother adjacency (no repeating labels next to one another)

➡ Null terminator presence (last byte of FQDN candidate bytes is the termination character)

➡ Characters present, not including the delimiter periods ("."), are limited to A-Z, a-z, 0-9 and hyphen

➡ TLD label emergency size-offset (Where preceding labels are all large sizes and the absolute name limit is in danger of being breached)

Hostname Bytes

Ultimately, a candidate absolute name is in the following form "under the hood":

[][]uint8{
 []uint8{0x13},                            // 13 is the total *TYPED* length
 []uint8{0x3,119,119,119},                 // 3 length + decimal w,w,w
 []uint8{0x7,101,120,97,109,112,108,101},  // 7 length + decimal e,x,a,m,p,l,e
 []uint8{0x3,99,111,109},                  // 3 length + decimal c,o,m
 []uint8{'\x00'},                          // no length
}

The user is not responsible for input of length bytes, nor the termination character. Specifically, the user is only expected to craft the decimal components shown (the so-called "TYPED" input).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL