ipp

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Decoder = &decoder.StreamDecoder{
	Type:        types.Type_NC_IPP,
	Name:        serviceIPP,
	Description: "IPP is the Internet Printing Protocol used for managing print jobs and printer status over HTTP",
	PostInit: func(d *decoder.StreamDecoder) error {
		var err error
		ippLog, _, err = logging.InitZapLogger(
			decoderconfig.Instance.Out,
			"ipp",
			decoderconfig.Instance.Debug,
		)
		return err
	},
	CanDecode: func(client, server []byte) bool {

		if len(client) > 0 {

			if bytes.Contains(client, []byte("POST /ipp")) ||
				bytes.Contains(client, []byte("POST /printers")) {
				return true
			}

			if bytes.Contains(client, []byte("application/ipp")) {
				return true
			}
		}

		if len(server) > 0 {
			if bytes.Contains(server, []byte("application/ipp")) {
				return true
			}

			if idx := bytes.Index(server, []byte("\r\n\r\n")); idx >= 0 {
				body := server[idx+4:]
				if len(body) >= 4 && (body[0] == 0x01 || body[0] == 0x02) && body[1] <= 0x01 {
					return true
				}
			}
		}
		return false
	},
	DeInit: func(sd *decoder.StreamDecoder) error {
		return ippLog.Sync()
	},
	Factory: &ippReader{},
	Typ:     core.TCP,
}

Decoder for protocol analysis and writing audit records to disk.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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