Documentation
¶
Overview ¶
Package wire includes constants and functions for the raw libmilter protocol
Index ¶
- func AppendCString(dest []byte, s string) []byte
- func AppendUint16(dest []byte, val uint16) []byte
- func DecodeCStrings(data []byte) []string
- func ReadCString(data []byte) string
- func WritePacket(conn net.Conn, msg *Message, timeout time.Duration) error
- type ActionCode
- type Code
- type Message
- type ModifyActCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendCString ¶
AppendCString appends a C style string to the buffer and returns it (like append does). It is assumed that s does not contain null-bytes.
func AppendUint16 ¶
AppendUint16 appends the big endian encoding of val to dest. It returns the new dest like append does.
func DecodeCStrings ¶
DecodeCStrings splits a C style strings into a Go string slice The last C style string in data can optionally not be terminated with a null-byte.
func ReadCString ¶
ReadCString reads and returns a C style string from []byte. If data does not contain a null-byte the whole data-slice is returned as string
Types ¶
type ActionCode ¶
type ActionCode byte
const ( ActAccept ActionCode = 'a' // SMFIR_ACCEPT ActContinue ActionCode = 'c' // SMFIR_CONTINUE ActDiscard ActionCode = 'd' // SMFIR_DISCARD ActReject ActionCode = 'r' // SMFIR_REJECT ActTempFail ActionCode = 't' // SMFIR_TEMPFAIL ActReplyCode ActionCode = 'y' // SMFIR_REPLYCODE ActSkip ActionCode = 's' // SMFIR_SKIP [v6] ActProgress ActionCode = 'p' // SMFIR_PROGRESS [v6] )
func (ActionCode) String ¶ added in v0.10.0
func (i ActionCode) String() string
type Code ¶
type Code byte
const ( CodeOptNeg Code = 'O' // SMFIC_OPTNEG CodeMacro Code = 'D' // SMFIC_MACRO CodeConn Code = 'C' // SMFIC_CONNECT CodeQuit Code = 'Q' // SMFIC_QUIT CodeHelo Code = 'H' // SMFIC_HELO CodeMail Code = 'M' // SMFIC_MAIL CodeRcpt Code = 'R' // SMFIC_RCPT CodeHeader Code = 'L' // SMFIC_HEADER CodeEOH Code = 'N' // SMFIC_EOH CodeBody Code = 'B' // SMFIC_BODY CodeEOB Code = 'E' // SMFIC_BODYEOB CodeAbort Code = 'A' // SMFIC_ABORT CodeData Code = 'T' // SMFIC_DATA CodeQuitNewConn Code = 'K' // SMFIC_QUIT_NC [v6] CodeUnknown Code = 'U' // SMFIC_UNKNOWN [v6] )
type ModifyActCode ¶
type ModifyActCode byte
const ( ActAddRcpt ModifyActCode = '+' // SMFIR_ADDRCPT ActDelRcpt ModifyActCode = '-' // SMFIR_DELRCPT ActReplBody ModifyActCode = 'b' // SMFIR_ACCEPT ActAddHeader ModifyActCode = 'h' // SMFIR_ADDHEADER ActChangeHeader ModifyActCode = 'm' // SMFIR_CHGHEADER ActInsertHeader ModifyActCode = 'i' // SMFIR_INSHEADER ActQuarantine ModifyActCode = 'q' // SMFIR_QUARANTINE ActChangeFrom ModifyActCode = 'e' // SMFIR_CHGFROM [v6] ActAddRcptPar ModifyActCode = '2' // SMFIR_ADDRCPT_PAR [v6] )
func (ModifyActCode) String ¶ added in v0.10.0
func (i ModifyActCode) String() string
Click to show internal directories.
Click to hide internal directories.