Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultSock(name string) string
- func GetIPCStrID() string
- func SetIPCID(id []byte)
- func SetIdentifier(name string, id [4]byte)
- type DataType
- type Database
- type Destination
- type GenericData
- type GetJSON
- type IPCHeader
- type IPCMessage
- type IPCMessageId
- type IPCRequest
- type IPCResponse
- type Metadata
- type MsgType
- type Object
Constants ¶
View Source
const ( AF_UNIX = "unix" // UNIX domain sockets AF_DGRAM = "unixgram" // UNIX domain datagram sockets as specified in net package STREAM = "SOCK_STREAM" // Stream socket (like TCP) DGRAM = "SOCK_DGRAM" // Datagram socket (like UDP) // Network values if applicable Network = "tcp" Address = "localhost:50052" Timeout = 1 * time.Second )
View Source
const ( MSG_CONN = 0x01 // Connection message MSG_ACK = 0x02 // Acknowledgement message MSG_CONNACK = 0x03 // Connection acknowledgement message MSG_MSG = 0x04 // Message MSG_MSGACK = 0x05 // Message acknowledgement MSG_PING = 0x08 // Ping message MSG_PONG = 0x09 // Pong message MSG_DISCONNECT = 0xD1 // Disconnect message // Error message // The sender is obviously still connected, but something went wrong and the message was not handled MSG_ERROR = 0xEE MSG_UNKNOWN = 0xFF // Unknown message - for signifying unknown type, maybe an error, but the receiver will try to wing it )
View Source
const ( DATA_TEXT = 0x01 // Text data DATA_INT = 0x02 // Integer data DATA_JSON = 0x03 // JSON data (used for structured data) DATA_YAML = 0x04 // YAML data (used for configuration files) DATA_BIN = 0x05 // Binary data (such as images, files, etc.) )
Variables ¶
View Source
var IDENTIFIERS = map[string][4]byte{}
View Source
var IPCID []byte // Identifier of the IPC communication
View Source
var MSGTYPE = map[string]byte{ "conn": byte(MSG_CONN), "ack": byte(MSG_ACK), "connack": byte(MSG_CONNACK), "msg": byte(MSG_MSG), "msgack": byte(MSG_MSGACK), "ping": byte(MSG_PING), "pong": byte(MSG_PONG), "disconnect": byte(MSG_DISCONNECT), "error": byte(MSG_ERROR), "unknown": byte(MSG_UNKNOWN), }
Functions ¶
func DefaultSock ¶
func GetIPCStrID ¶
func GetIPCStrID() string
func SetIdentifier ¶
Types ¶
type Destination ¶
type Destination struct {
Object Object `json:"destination" yaml:"destination"` // should unmarsal as Destination
}
type GenericData ¶
type GenericData map[string]interface{}
GenericData is a generic map for data. It can be used to store any data type.
type IPCMessage ¶
type IPCMessageId ¶
type IPCMessageId []byte // Identifier of the message
type IPCRequest ¶
type IPCRequest struct { MessageSignature []byte // The message signature, used to declare an ipcRequest Header IPCHeader // The header - containing type and identifier Message IPCMessage // The message Timestamp int64 // Timestamp of the message Checksum32 int // Checksum of the message byte data }
func (*IPCRequest) Stringify ¶
func (r *IPCRequest) Stringify() string
type IPCResponse ¶
type IPCResponse struct { Request IPCRequest // The request that was sent Success bool // Was the request successful Message string // Message from the server Checksum32 int // Checksum of the message byte data }
type Metadata ¶
type Metadata struct { Source string `json:"source"` // Source. Ex: sigma Destination Destination `json:"destination"` // Destination. Ex: { name: database, info: "table=threat_intel" } Method string `json:"method"` // Using HTTP verbs to differentiate between requests (ps: this got nothing to do with actual HTTP) }
Click to show internal directories.
Click to hide internal directories.