initial parsing of requests

This commit is contained in:
2020-10-31 21:56:18 +01:00
parent e0ff8d79c3
commit ba905d3fcd
2 changed files with 101 additions and 12 deletions

View File

@@ -26,15 +26,35 @@ const (
booleanIntegerTag = 0x22
enumValueTag = 0x23
// Character string values
textWithoutLanguagage = 0x41
nameWithoutLanguagage = 0x42
keyword = 0x44
uri = 0x45
uriScheme = 0x46
charset = 0x47
naturalLanguagage = 0x48
mimeMediaType = 0x49
memberAttrName = 0x4a
textWithoutLanguagageValueTag = 0x41
nameWithoutLanguagageValueTag = 0x42
keywordValueTag = 0x44
uriValueTag = 0x45
uriSchemeValueTag = 0x46
charsetValueTag = 0x47
naturalLanguagageValueTag = 0x48
mimeMediaTypeValueTag = 0x49
memberAttrNameValueTag = 0x4a
)
// Operation-id, defined in rfc8011
const (
PrintJob = 0x0002
PrintURI = 0x0003
ValidateJob = 0x0004
CreateJob = 0x0005
SendDocument = 0x0006
SendURI = 0x0007
CancelJob = 0x0008
GetJobAttributes = 0x0009
GetJobs = 0x000a
GetPrinterAttributes = 0x000b
HoldJob = 0x000c
ReleaseJob = 0x000d
RestartJob = 0x000e
PausePrinter = 0x0010
ResumePrinter = 0x0011
PurgeJobs = 0x0012
)
type ippRequestHeader struct {
@@ -42,3 +62,9 @@ type ippRequestHeader struct {
operationId uint16
requestId uint32
}
type ippRequest struct {
header ippRequestHeader
operationAttributes map[string]string
requestedAttributes []string
}