<commit_before>// Package inet provides that highlevel behavior described in RFC 791 which is
// referred to as "internet module" responsibility, and which has been in the
// scope of my undergrad networking course (and my own research).
package inet

import (
	"fmt"

	"../blob"
	"../ip"
)

// EthFrame is a FrameBody whose ParseHead() returns an EthFrame and
// IPPayload.
type EthFrame struct {
	Blob blob.ByteBlob

	Destination []byte
	Source      []byte
	Type        []byte
}

func (ef *EthFrame) RawHeader() []byte { return ef.Blob.Data }

func (ef *EthFrame) HasHeader() bool {
	return ef.Blob.IsEmpty()
}

func (ef *EthFrame) String() string {
	return fmt.Sprintf(
		`destination hardware addr: 0x%x%x%x%x%x%x
source hardware addr: 0x%x
ethernet frame type: 0x%c
`, ef.Destination[0],
		ef.Destination[1],
		ef.Destination[2],
		ef.Destination[3],
		ef.Destination[4],
		ef.Destination[5],
		ef.Source,
		ef.Type)<commit_msg>utilize fancy fmt package space injector, and capitalize hex<commit_after>// Package inet provides that highlevel behavior described in RFC 791 which is
// referred to as "internet module" responsibility, and which has been in the
// scope of my undergrad networking course (and my own research).
package inet

import (
	"fmt"

	"../blob"
	"../ip"
)

// EthFrame is a FrameBody whose ParseHead() returns an EthFrame and
// IPPayload.
type EthFrame struct {
	Blob blob.ByteBlob

	Destination []byte
	Source      []byte
	Type        []byte
}

func (ef *EthFrame) RawHeader() []byte { return ef.Blob.Data }

func (ef *EthFrame) HasHeader() bool {
	return ef.Blob.IsEmpty()
}

func (ef *EthFrame) String() string {
	return fmt.Sprintf(
		`destination hardware addr: 0x% X
source hardware addr: 0x% X
ethernet frame type: 0x%c
`, ef.Destination, ef.Source, ef.Type)
{'fraction_non_alphanumeric': 0.11600669269380925, 'fraction_numerical': 0.010039040713887339, 'mean_word_length': 3.809651474530831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2832690', 'n_tokens_mistral': 610, 'n_tokens_neox': 582, 'n_words': 212}