2015-06-24 11:39:46 +00:00
|
|
|
// ************************************************************
|
|
|
|
// This file is automatically generated by genxdr. Do not edit.
|
|
|
|
// ************************************************************
|
|
|
|
|
|
|
|
package protocol
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/calmh/xdr"
|
|
|
|
)
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
header Structure:
|
2015-06-24 11:39:46 +00:00
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2015-06-28 00:52:01 +00:00
|
|
|
| magic |
|
2015-06-24 11:39:46 +00:00
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2015-06-28 00:52:01 +00:00
|
|
|
| message Type |
|
2015-06-24 11:39:46 +00:00
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2015-06-28 00:52:01 +00:00
|
|
|
| message Length |
|
2015-06-24 11:39:46 +00:00
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
struct header {
|
|
|
|
unsigned int magic;
|
|
|
|
int messageType;
|
|
|
|
int messageLength;
|
2015-06-24 11:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o header) EncodeXDR(w io.Writer) (int, error) {
|
2015-06-24 11:39:46 +00:00
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o header) MarshalXDR() ([]byte, error) {
|
2015-06-24 11:39:46 +00:00
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o header) MustMarshalXDR() []byte {
|
2015-06-24 11:39:46 +00:00
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o header) AppendXDR(bs []byte) ([]byte, error) {
|
2015-06-24 11:39:46 +00:00
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o header) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
|
|
|
xw.WriteUint32(o.magic)
|
|
|
|
xw.WriteUint32(uint32(o.messageType))
|
|
|
|
xw.WriteUint32(uint32(o.messageLength))
|
2015-06-24 11:39:46 +00:00
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o *header) DecodeXDR(r io.Reader) error {
|
2015-06-24 11:39:46 +00:00
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o *header) UnmarshalXDR(bs []byte) error {
|
2015-06-24 11:39:46 +00:00
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o *header) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
o.magic = xr.ReadUint32()
|
|
|
|
o.messageType = int32(xr.ReadUint32())
|
|
|
|
o.messageLength = int32(xr.ReadUint32())
|
2015-06-24 11:39:46 +00:00
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Ping Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct Ping {
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o Ping) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Ping) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Ping) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Ping) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Ping) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Ping) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Ping) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Ping) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Pong Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct Pong {
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o Pong) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Pong) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Pong) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Pong) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Pong) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Pong) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Pong) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Pong) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
JoinRelayRequest Structure:
|
2015-06-24 11:39:46 +00:00
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
struct JoinRelayRequest {
|
2015-06-24 11:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o JoinRelayRequest) EncodeXDR(w io.Writer) (int, error) {
|
2015-06-24 11:39:46 +00:00
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o JoinRelayRequest) MarshalXDR() ([]byte, error) {
|
2015-06-24 11:39:46 +00:00
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o JoinRelayRequest) MustMarshalXDR() []byte {
|
2015-06-24 11:39:46 +00:00
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o JoinRelayRequest) AppendXDR(bs []byte) ([]byte, error) {
|
2015-06-24 11:39:46 +00:00
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o JoinRelayRequest) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
2015-06-24 11:39:46 +00:00
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o *JoinRelayRequest) DecodeXDR(r io.Reader) error {
|
2015-06-24 11:39:46 +00:00
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o *JoinRelayRequest) UnmarshalXDR(bs []byte) error {
|
2015-06-24 11:39:46 +00:00
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
func (o *JoinRelayRequest) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
2015-11-20 23:42:49 +00:00
|
|
|
RelayFull Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct RelayFull {
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o RelayFull) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o RelayFull) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o RelayFull) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o RelayFull) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o RelayFull) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *RelayFull) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *RelayFull) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *RelayFull) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
2015-06-28 00:52:01 +00:00
|
|
|
JoinSessionRequest Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Length of Key |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ Key (variable length) \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct JoinSessionRequest {
|
|
|
|
opaque Key<32>;
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o JoinSessionRequest) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o JoinSessionRequest) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o JoinSessionRequest) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o JoinSessionRequest) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o JoinSessionRequest) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
|
|
|
if l := len(o.Key); l > 32 {
|
|
|
|
return xw.Tot(), xdr.ElementSizeExceeded("Key", l, 32)
|
|
|
|
}
|
|
|
|
xw.WriteBytes(o.Key)
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *JoinSessionRequest) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *JoinSessionRequest) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *JoinSessionRequest) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
o.Key = xr.ReadBytesMax(32)
|
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Response Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Code |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Length of Message |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ Message (variable length) \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct Response {
|
|
|
|
int Code;
|
|
|
|
string Message<>;
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o Response) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Response) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Response) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Response) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o Response) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
|
|
|
xw.WriteUint32(uint32(o.Code))
|
|
|
|
xw.WriteString(o.Message)
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Response) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Response) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Response) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
o.Code = int32(xr.ReadUint32())
|
|
|
|
o.Message = xr.ReadString()
|
2015-06-24 11:39:46 +00:00
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
ConnectRequest Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Length of ID |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ ID (variable length) \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct ConnectRequest {
|
|
|
|
opaque ID<32>;
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o ConnectRequest) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o ConnectRequest) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o ConnectRequest) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o ConnectRequest) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o ConnectRequest) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
|
|
|
if l := len(o.ID); l > 32 {
|
|
|
|
return xw.Tot(), xdr.ElementSizeExceeded("ID", l, 32)
|
|
|
|
}
|
|
|
|
xw.WriteBytes(o.ID)
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *ConnectRequest) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *ConnectRequest) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *ConnectRequest) DecodeXDRFrom(xr *xdr.Reader) error {
|
|
|
|
o.ID = xr.ReadBytesMax(32)
|
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
SessionInvitation Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2015-06-28 00:52:01 +00:00
|
|
|
| Length of From |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ From (variable length) \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2015-06-24 11:39:46 +00:00
|
|
|
| Length of Key |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ Key (variable length) \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Length of Address |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ Address (variable length) \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| 0x0000 | Port |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Server Socket (V=0 or 1) |V|
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct SessionInvitation {
|
2015-06-28 00:52:01 +00:00
|
|
|
opaque From<32>;
|
2015-06-24 11:39:46 +00:00
|
|
|
opaque Key<32>;
|
|
|
|
opaque Address<32>;
|
|
|
|
unsigned int Port;
|
|
|
|
bool ServerSocket;
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o SessionInvitation) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.EncodeXDRInto(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o SessionInvitation) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o SessionInvitation) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o SessionInvitation) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.EncodeXDRInto(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o SessionInvitation) EncodeXDRInto(xw *xdr.Writer) (int, error) {
|
2015-06-28 00:52:01 +00:00
|
|
|
if l := len(o.From); l > 32 {
|
|
|
|
return xw.Tot(), xdr.ElementSizeExceeded("From", l, 32)
|
|
|
|
}
|
|
|
|
xw.WriteBytes(o.From)
|
2015-06-24 11:39:46 +00:00
|
|
|
if l := len(o.Key); l > 32 {
|
|
|
|
return xw.Tot(), xdr.ElementSizeExceeded("Key", l, 32)
|
|
|
|
}
|
|
|
|
xw.WriteBytes(o.Key)
|
|
|
|
if l := len(o.Address); l > 32 {
|
|
|
|
return xw.Tot(), xdr.ElementSizeExceeded("Address", l, 32)
|
|
|
|
}
|
|
|
|
xw.WriteBytes(o.Address)
|
|
|
|
xw.WriteUint16(o.Port)
|
|
|
|
xw.WriteBool(o.ServerSocket)
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *SessionInvitation) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *SessionInvitation) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.DecodeXDRFrom(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *SessionInvitation) DecodeXDRFrom(xr *xdr.Reader) error {
|
2015-06-28 00:52:01 +00:00
|
|
|
o.From = xr.ReadBytesMax(32)
|
2015-06-24 11:39:46 +00:00
|
|
|
o.Key = xr.ReadBytesMax(32)
|
|
|
|
o.Address = xr.ReadBytesMax(32)
|
|
|
|
o.Port = xr.ReadUint16()
|
|
|
|
o.ServerSocket = xr.ReadBool()
|
|
|
|
return xr.Error()
|
|
|
|
}
|