rpc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2021 Thorben Krüger (thorben.krueger@ovgu.de)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021-2024 Thorben Krüger (thorben.krueger@ovgu.de)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021-2024 Thorben Krüger (thorben.krueger@ovgu.de)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDaemonAddress = &net.UnixAddr{
		Name: "/tmp/scion-pan-rpc.sock",
		Net:  "unix",
	}
	ErrDeref = errors.New("can not dereference Nil value")
)

Functions

func NewSelectorClient

func NewSelectorClient(client *Client) extra.Selector

func NewServer

func NewServer(selector extra.MultiSelector) (*rpc.Server, error)

func NewServer(selector extra.MultiSelector, tracer logging.Tracer, connectionTracer ServerConnectionTracer) (*rpc.Server, error) {

Types

type Client

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

func NewClient

func NewClient(conn io.ReadWriteCloser) (*Client, error)

func (*Client) Call

func (c *Client) Call(serviceMethod string, args interface{}, reply interface{}) error

func (*Client) Close

func (c *Client) Close() error

type IDMsg

type IDMsg struct {
	Value *int
}

type IDServer

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

func (*IDServer) GetID

func (s *IDServer) GetID(arg, resp *IDMsg) error

type Path

type Path struct {
	Source      pan.IA
	Destination pan.IA
	Metadata    *pan.PathMetadata
	Fingerprint pan.PathFingerprint
	//ForwardingPath pan.ForwardingPath
	Expiry time.Time
}

func NewPathFrom

func NewPathFrom(p *pan.Path) *Path

func (*Path) PanPath

func (p *Path) PanPath() *pan.Path

type SelectorClient

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

func (*SelectorClient) Close

func (s *SelectorClient) Close() error

func (*SelectorClient) Initialize

func (s *SelectorClient) Initialize(local, remote pan.UDPAddr, paths []*pan.Path)

func (*SelectorClient) Path

func (s *SelectorClient) Path() *pan.Path

func (*SelectorClient) PathDown

func (s *SelectorClient) PathDown(fp pan.PathFingerprint, pi pan.PathInterface)

func (*SelectorClient) Refresh

func (s *SelectorClient) Refresh(paths []*pan.Path)

func (*SelectorClient) SetPreferences

func (s *SelectorClient) SetPreferences(prefs map[string]string) error

type SelectorMsg

type SelectorMsg struct {
	Local         *pan.UDPAddr
	Remote        *pan.UDPAddr
	Fingerprint   *pan.PathFingerprint
	PathInterface *pan.PathInterface
	Preferences   map[string]string
	Paths         []*Path
}

type SelectorServer

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

SelectorServer is the RPC-facing server part (the one with the rigit function signatures)

func NewSelectorServer

func NewSelectorServer(selector extra.MultiSelector) *SelectorServer

func (*SelectorServer) Close

func (s *SelectorServer) Close(args, resp *SelectorMsg) error

func (*SelectorServer) Initialize

func (s *SelectorServer) Initialize(args, resp *SelectorMsg) error

func (*SelectorServer) Path

func (s *SelectorServer) Path(args, resp *SelectorMsg) error

func (*SelectorServer) PathDown

func (s *SelectorServer) PathDown(args, resp *SelectorMsg) error

func (*SelectorServer) Refresh

func (s *SelectorServer) Refresh(args, resp *SelectorMsg) error

func (*SelectorServer) SetPreferences

func (s *SelectorServer) SetPreferences(args, resp *SelectorMsg) error

Jump to

Keyboard shortcuts

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