gofido

package module
v0.0.0-...-d06afec Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2017 License: MIT Imports: 11 Imported by: 0

README

GoFido!

GoDoc Build Status Go Report Card GitHub license

Golang library for FidoNet tools developing

Wikipedia about FidoNet: https://en.wikipedia.org/wiki/FidoNet

FTSC Documents (i.e. Technical Standards): http://ftsc.org/docs/

Documentation

Index

Constants

View Source
const (
	// PktUserNameSize maximum size of null terminated User Name variable
	PktUserNameSize = 36
	// PktSubjectSize maximum size of null terminated Subject variable
	PktSubjectSize = 72
	// PktTextSize maximum size of null terminated Text variable (Body of the message)
	PktTextSize = 65535
	// PktDateTimeLayout parsing time layout
	PktDateTimeLayout = "02 Jan 06  15:04:05"
)

Variables

View Source
var ReFidoNetAddress = regexp.MustCompile(`^(\d{1,4}):(\d{1,5})/(\d{1,5})[.]?(\d{1,5})?[@]?([a-z]*)$`)

ReFidoNetAddress regular expression matches standard FidoNet address string

Functions

func CP866toUTF8

func CP866toUTF8(src []byte) []byte

CP866toUTF8 converts slice of bytes from CP866 codepage to UTF8

func ComposeAddress

func ComposeAddress(fAddr FidoNetAddress) (strAddr string)

ComposeAddress makes FidoNet address string from FidoNetAddress struct

func GetKludges

func GetKludges(msgText string) map[string]string

GetKludges returns a map of kludges (without colons) from message text (body)

func GetMsgBody

func GetMsgBody(msgText string) (text string)

GetMsgBody returns message body without kludges

func GetOutboundDir

func GetOutboundDir(fAddr FidoNetAddress) string

GetOutboundDir returns outbound directory name for Points of the Node

func PktRead

func PktRead(pktFileName string) (pktHead PktHeader, pktPassword string, messages []FidoMessage, err error)

PktRead returns slice of Messages from .pkt file

func PktWrite

func PktWrite(pktFileName string, pktHead PktHeader, messages []FidoMessage) error

By now it's UNTESTED!!! PktWrite creates and write .pkt file

func UTF8toCP866

func UTF8toCP866(src []byte) []byte

UTF8toCP866 converts slice of bytes from UTF8 to CP866 codepage (changing russian "Н" char to similar latin "H")

Types

type FidoMessage

type FidoMessage struct {
	FromName   string
	FromAddr   FidoNetAddress
	ToName     string
	ToAddr     FidoNetAddress
	Subj       string
	Text       string
	DateTime   time.Time
	Attributes uint16
}

FidoMessage implements simple Message architecture

type FidoNetAddress

type FidoNetAddress struct {
	Zone    uint16
	Network uint16
	Node    uint16
	Point   uint16
	Domain  string
}

FidoNetAddress structure of FidoNet address zone:network/node.point@domain

func ParseAddress

func ParseAddress(strAddr string) (fAddress FidoNetAddress, err error)

ParseAddress parses a string with FidoNet address and returns it's separate elements

type PktHeader

type PktHeader struct {
	OrigNode   uint16  // of packet, not of messages in packet
	DestNode   uint16  // of packet, not of messages in packet
	Year       uint16  // of packet creation, e.g. 1986
	Month      uint16  // of packet creation, 0-11 for Jan-Dec
	Day        uint16  // of packet creation, 1-31
	Hour       uint16  // of packet creation, 0-23
	Minute     uint16  // of packet creation, 0-59
	Second     uint16  // of packet creation, 0-59
	Baud       uint16  // max baud rate of orig and dest, 0=SEA
	PacketType uint16  // old type-1 packets now obsolete
	OrigNet    uint16  // of packet, not of messages in packet
	DestNet    uint16  // of packet, not of messages in packet
	ProdCode   byte    // 0 for Fido, write to FTSC for others
	SerialNo   byte    // binary serial number (otherwise null)
	Password   [8]byte // session password  (otherwise null)
	OrigZone   uint16  // zone of pkt sender (otherwise null)
	DestZone   uint16  // zone of pkt receiver (otherwise null)
	Filled     [20]byte
}

PktHeader header of standard .pkt file

Jump to

Keyboard shortcuts

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