# Appendix B: Code Sets

Select shared and named code sets defined in SIF are included here for reference.

## Infrastructure

### Status Code

`0` | Success (ZIS ONLY). SIF_Status/SIF_Data may contain additional data.
`1` | Immediate SIF_Ack (AGENT ONLY). Message is persisted or processing is complete. Discard the referenced message.
`2` | Intermediate SIF_Ack (AGENT ONLY). Only valid in response to SIF_Event delivery. Invokes Selective Message Blocking. The event referenced must still be persisted, and no other events must be delivered, until the agent sends a "Final" SIF_Ack at a later time.
`3` | Final SIF_Ack (AGENT ONLY). Sent (a SIF_Ack with this value is never returned by an agent in response to a delivered message) by an agent to the ZIS to end Selective Message Blocking. Discard the referenced event and allow for delivery of other events.
`7` | Already have a message with this SIF_MsgId from you.
`8` | Receiver is sleeping.
`9` | No messages available. This is returned when an agent is trying to pull messages from a ZIS and there are no messages available.

### Error Category

The following table describes the functional areas where an error may occur in SIF. When a `SIF_Error` element is returned within a `SIF_Ack` message, the `SIF_Error/SIF_Category` element MUST contain one of the values from the table.

The next tables present the error codes that must be used when constructing a `SIF_Error` element. The value of `SIF_Error/SIF_Code` must come from these lists unless the functional category is `System` where error codes not defined in these tables can be included.

`0` | Unknown (This should NEVER be used if possible)
`1` | XML Validation
`2` | Encryption
`3` | Authentication
`4` | Access and Permissions
`5` | Registration
`6` | Provision
`7` | Subscription
`8` | Request and Response
`9` | Event Reporting and Processing
`10` | Transport
`11` | System (OS, Database, Vendor localized, etc.)
`12` | Generic Message Handling
`13` | SMB Handling
`14` | SIF Zone Service

### XML Validation Error

`1` | Generic error
`2` | Message is not well-formed
`3` | Generic validation error
`4` | Invalid value for element/attribute
`6` | Missing mandatory element/attribute

### Encryption Error

`1` | Generic error

### Authentication Error

`1` | Generic error
`2` | Generic authentication error (with signature)
`3` | Missing sender's certificate
`4` | Invalid certificate
`5` | Sender's certificate is not trusted
`6` | Expired certificate
`7` | Invalid signature
`8` | Invalid encryption algorithm (only accepts MD4)
`9` | Missing public key of the receiver (when decrypting message)
`10` | Missing receiver's private key (when decrypting message)

### Access and Permission Error

`1` | Generic error
`2` | No permission to register
`3` | No permission to provide this object
`4` | No permission to subscribe to this SIF_Event
`5` | No permission to request this object
`6` | No permission to respond to this object request
`7` | No permission to publish SIF_Event
`8` | No permission to administer policies
`9` | SIF_SourceId is not registered
`10` | No permission to publish SIF_Event Add
`11` | No permission to publish SIF_Event Change
`12` | No permission to publish SIF_Event Delete
`13` | No permission to publish indicated SIF_Notification
`14` | No permission to invoke SIF_ServiceInput to this Service
`15` | No permission to provide this Service

### Registration Error

`1` | Generic error
`2` | The SIF_SourceId is invalid
`3` | Requested transport protocol is unsupported
`4` | Requested SIF_Version(s) not supported.
`6` | Requested SIF_MaxBufferSize is too small
`7` | ZIS requires a secure transport
`9` | Agent is registered for push mode (returned when a push-mode agent sends a SIF_GetMessage).
`10` | ZIS does not support the requested Accept-Encoding value.

### Provision Error

`1` | Generic error
`3` | Invalid object
`4` | Object already has a provider (SIF_Provide message)

### Subscription Error

`1` | Generic error
`3` | Invalid object

### Request and Response Error

`1` | Generic error
`3` | Invalid object
`4` | No provider
`7` | Responder does not support requested SIF_Version
`8` | Responder does not support requested SIF_MaxBufferSize
`9` | Unsupported query in request
`10` | Invalid SIF_RequestMsgId specified in SIF_Response
`11` | SIF_Response is larger than requested SIF_MaxBufferSize
`12` | SIF_PacketNumber is invalid in SIF_Response
`13` | SIF_Response does not match any SIF_Version from SIF_Request
`14` | SIF_DestinationId does not match SIF_SourceId from SIF_Request
`15` | No support for SIF_ExtendedQuery
`16` | SIF_RequestMsgId deleted from cache due to timeout
`17` | SIF_RequestMsgId deleted from cache by administrator
`18` | SIF_Request cancelled by requesting agent
`19` | SIF_Request cancelled due to a SIF XML filter rule

### Event Reporting and Processing Error

`1` | Generic error
`3` | Invalid event

### Transport Error

`1` | Generic error
`2` | Requested protocol is not supported
`3` | Secure channel requested and no secure path exists
`4` | Unable to establish connection

### System Error

`1` | Generic error

### Generic Message Handling Error

`1` | Generic error
`2` | Message not supported
`3` | Version not supported
`4` | Context not supported
`5` | Protocol error
`6` | No such message (as identified by SIF_OriginalMsgId)
`7` | Multiple contexts not supported

### SMB Error

`1` | Generic error
`2` | SMB can only be invoked during a SIF_Event acknowledgement
`3` | Final SIF_Ack expected from Push-Mode Agent
`4` | Incorrect SIF_MsgId in final SIF_Ack

### SIF Zone Service Error

`1` | Generic error
`2` | Invalid service
`3` | No provider for service
`4` | Responder does not support requested SIF_Version
`5` | Responder does not support requested SIF_MaxBufferSize
`6` | Operation not supported
`7` | Argument not valid
`8` | Invalid SIF_ServiceMsgId specified in SIF_ServiceOutput
`9` | SIF_ServiceOutput is larger than requested SIF_MaxBufferSize
`10` | SIF_PacketNumber is invalid
`11` | SIF_ServiceOutput does not match any SIF_Version from SIF_ServiceInput
`12` | SIF_DestinationId does not match SIF_SourceId from SIF_ServiceInput
`13` | SIF_ServiceMsgId deleted from cache due to timeout
`14` | SIF_ServiceMsgId deleted from cache by administrator
`15` | SIF_ServiceInput cancelled by requesting agent
`16` | ACL permission denied
`17` | Not a provider for this service
`18` | Service or Operation failed

## SIF_LogEntry

### Agent Error Condition

`1` | An exception has occurred in the agent (generic error)

### Data Issues with Failure Result

`1` | Insufficient information in message
`2` | Cannot process change due to business rule
`3` | Related information unavailable

### Data Issues with Success Result

`1` | Data was changed to complete request successfully
`2` | Data was added to complete request successfully

### Success Category

`1` | Success

### ZIS Error Condition

`1` | An exception has occurred in the ZIS (generic error)
`2` | Message could not be delivered due to buffer size limitations
`3` | Message could not be delivered due to minimum security requirements
`4` | Message could not be delivered due to destination agent not supporting SIF_Version
`5` | Message could not be delivered due to SIF_Response validation