common

package
v0.0.0-...-c49a80f Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEARCH_REQUEST_MALICIOUS uint8 = iota
	SEARCH_REQUEST_SEMIHONEST
	UPDATE_REQUEST_MALICIOUS
	UPDATE_REQUEST_SEMIHONEST
	SETUP_REQUEST
	GET_STATE_REQUEST
	BATCH_START_REQUEST
	BATCH_FINISH_REQUEST
)
View Source
const MAX_KEYWORD_SIZE = 32

Variables

This section is empty.

Functions

func CloseConnection

func CloseConnection(conn *Conn)

Close a TLS connection.

func ListenForSingleMessage

func ListenForSingleMessage(dstPort string, certFile string, keyFile string, handler ConnectionHandler) error

Listen for a single message and run a handler to respond.

func ListenLoop

func ListenLoop(dstPort string, certFile string, keyFile string, handler ConnectionHandler) error

Loop listening for incoming connections.

func SendMessage

func SendMessage(dstAddr string, reqType uint8, req interface{}, resp interface{}, respErr *error) error

Send a message, opening and closing a connection (wait for a response).

func SendMessageNoResp

func SendMessageNoResp(dstAddr string, reqType uint8, req interface{}) error

Send a message, opening and closing a connection (no response expected).

func SendMessageWithConnection

func SendMessageWithConnection(conn *Conn, reqType uint8, req interface{}, resp interface{}, respErr *error) error

Send a message over a connection (wait for a response).

func SendMessageWithConnectionNoResp

func SendMessageWithConnectionNoResp(conn *Conn, reqType uint8, req interface{}) error

Send a message over a connection (no response expected).

Types

type BatchFinishRequest

type BatchFinishRequest struct {
	Commit bool
}

type BatchFinishResponse

type BatchFinishResponse struct {
}

type BatchStartRequest

type BatchStartRequest struct {
	VersionNum int
	Updates    map[int]Update
	Malicious  bool
}

type BatchStartResponse

type BatchStartResponse struct {
	Commit bool
}

type ClientConfig

type ClientConfig struct {
	MasterAddr string
	MasterPort string
	Addr       []string
	Port       []string
	OutDir     string
	MaskKey    string
	MacKey     string
}

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func OpenConnection

func OpenConnection(dstAddr string) (*Conn, error)

Open a TLS connection to IP addr and port pair.

type ConnectionHandler

type ConnectionHandler func(net.Conn)

type GetStateRequest

type GetStateRequest struct {
	Test string
}

type GetStateResponse

type GetStateResponse struct {
	NumDocs    int
	SysVersion int
}

type MasterConfig

type MasterConfig struct {
	MasterAddr string
	MasterPort string
	Addr       []string
	Port       []string
	CertFile   string
	KeyFile    string
	OutDir     string
}

type MasterSetupRequest

type MasterSetupRequest struct {
	NumDocs  int
	Versions []uint32
}

type MasterSetupResponse

type MasterSetupResponse struct {
	Test string
}

type SearchRequest_malicious

type SearchRequest_malicious struct {
	Keys    [][]byte
	Version int
}

type SearchRequest_semihonest

type SearchRequest_semihonest struct {
	Keys    [][]byte
	Version int
}

type SearchResponse_malicious

type SearchResponse_malicious struct {
	Results       [][]byte
	ServerLatency time.Duration
}

type SearchResponse_semihonest

type SearchResponse_semihonest struct {
	Results       [][]byte
	ServerLatency time.Duration
}

type Server

type Server struct {
	Addr     string
	ID       string
	Port     string
	CertFile string
	KeyFile  string
}

type ServerConfig

type ServerConfig struct {
	Addr          string
	Port          string
	CertFile      string
	KeyFile       string
	OutDir        string
	ClientMaskKey string
	ClientMacKey  string
}

type SetupRequest

type SetupRequest struct {
	BenchmarkDir string
}

type SetupResponse

type SetupResponse struct {
	NumDocs  int
	Versions []uint32
}

type SystemConfig

type SystemConfig struct {
	MasterAddr         string
	MasterID           string
	MasterPort         string
	MasterCertFile     string
	MasterKeyFile      string
	ClientAddrs        []string
	ClientIDs          []string
	Servers            []Server
	OutDir             string
	ClientMaskKey      string
	ClientMacKey       string
	SSHKeyPath         string
	BaselineServerAddr string
	BaselineServerID   string
	BaselineClientAddr string
	BaselineClientID   string
}

type Update

type Update struct {
	BF   []byte
	MACs [][]byte
}

type UpdateRequest_malicious

type UpdateRequest_malicious struct {
	DocID   int
	Version uint32
	BF      []byte
	MACs    [][]byte
}

type UpdateRequest_semihonest

type UpdateRequest_semihonest struct {
	DocID   int
	Version uint32
	BF      []byte
}

type UpdateResponse_malicious

type UpdateResponse_malicious struct {
	Test string
}

type UpdateResponse_semihonest

type UpdateResponse_semihonest struct {
	Test string
}

Jump to

Keyboard shortcuts

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