id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
136,700 | netrack/openflow | net.go | Write | func (c *conn) Write(b []byte) (int, error) {
c.mu.Lock()
defer c.mu.Unlock()
return c.buf.Write(b)
} | go | func (c *conn) Write(b []byte) (int, error) {
c.mu.Lock()
defer c.mu.Unlock()
return c.buf.Write(b)
} | [
"func",
"(",
"c",
"*",
"conn",
")",
"Write",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"c",
".",
"bu... | // Write writes data to the connection. Write can be made to time out. | [
"Write",
"writes",
"data",
"to",
"the",
"connection",
".",
"Write",
"can",
"be",
"made",
"to",
"time",
"out",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L151-L155 |
136,701 | netrack/openflow | net.go | Flush | func (c *conn) Flush() error {
c.mu.Lock()
defer c.mu.Unlock()
return c.buf.Flush()
} | go | func (c *conn) Flush() error {
c.mu.Lock()
defer c.mu.Unlock()
return c.buf.Flush()
} | [
"func",
"(",
"c",
"*",
"conn",
")",
"Flush",
"(",
")",
"error",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"c",
".",
"buf",
".",
"Flush",
"(",
")",
"\n",
"}"
] | // Flush writes any buffered data to the connection. | [
"Flush",
"writes",
"any",
"buffered",
"data",
"to",
"the",
"connection",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L158-L162 |
136,702 | netrack/openflow | net.go | forceWrite | func (c *conn) forceWrite(b []byte) error {
c.mu.Lock()
defer c.mu.Unlock()
_, err := c.buf.Write(b)
if err != nil {
return err
}
return c.buf.Flush()
} | go | func (c *conn) forceWrite(b []byte) error {
c.mu.Lock()
defer c.mu.Unlock()
_, err := c.buf.Write(b)
if err != nil {
return err
}
return c.buf.Flush()
} | [
"func",
"(",
"c",
"*",
"conn",
")",
"forceWrite",
"(",
"b",
"[",
"]",
"byte",
")",
"error",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"_",
",",
"err",
":=",
"c",
".",
"buf",
... | // forceWrite writes given data and any buffered data to the connection. | [
"forceWrite",
"writes",
"given",
"data",
"and",
"any",
"buffered",
"data",
"to",
"the",
"connection",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L165-L175 |
136,703 | netrack/openflow | net.go | Send | func (c *conn) Send(r *Request) error {
if d := c.WriteTimeout; d != 0 {
defer func() {
c.SetWriteDeadline(time.Now().Add(d))
}()
}
_, err := r.WriteTo(c)
return err
} | go | func (c *conn) Send(r *Request) error {
if d := c.WriteTimeout; d != 0 {
defer func() {
c.SetWriteDeadline(time.Now().Add(d))
}()
}
_, err := r.WriteTo(c)
return err
} | [
"func",
"(",
"c",
"*",
"conn",
")",
"Send",
"(",
"r",
"*",
"Request",
")",
"error",
"{",
"if",
"d",
":=",
"c",
".",
"WriteTimeout",
";",
"d",
"!=",
"0",
"{",
"defer",
"func",
"(",
")",
"{",
"c",
".",
"SetWriteDeadline",
"(",
"time",
".",
"Now",... | // Send writes OpenFlow data to the connection. | [
"Send",
"writes",
"OpenFlow",
"data",
"to",
"the",
"connection",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L178-L187 |
136,704 | netrack/openflow | net.go | Send | func Send(c Conn, requests ...*Request) error {
for _, request := range requests {
if err := c.Send(request); err != nil {
return err
}
}
return c.Flush()
} | go | func Send(c Conn, requests ...*Request) error {
for _, request := range requests {
if err := c.Send(request); err != nil {
return err
}
}
return c.Flush()
} | [
"func",
"Send",
"(",
"c",
"Conn",
",",
"requests",
"...",
"*",
"Request",
")",
"error",
"{",
"for",
"_",
",",
"request",
":=",
"range",
"requests",
"{",
"if",
"err",
":=",
"c",
".",
"Send",
"(",
"request",
")",
";",
"err",
"!=",
"nil",
"{",
"retu... | // Send allows to send multiple requests at once to the connection.
//
// The requests will be written to the per-call buffer. If the
// serialization of all given requests succeeded it will be flushed
// to the OpenFlow connection.
//
// No data will be written when any of the request failed. | [
"Send",
"allows",
"to",
"send",
"multiple",
"requests",
"at",
"once",
"to",
"the",
"connection",
".",
"The",
"requests",
"will",
"be",
"written",
"to",
"the",
"per",
"-",
"call",
"buffer",
".",
"If",
"the",
"serialization",
"of",
"all",
"given",
"requests"... | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L232-L240 |
136,705 | netrack/openflow | net.go | Dial | func Dial(network, addr string) (Conn, error) {
conn, err := net.Dial(network, addr)
if err != nil {
return nil, err
}
return NewConn(conn), nil
} | go | func Dial(network, addr string) (Conn, error) {
conn, err := net.Dial(network, addr)
if err != nil {
return nil, err
}
return NewConn(conn), nil
} | [
"func",
"Dial",
"(",
"network",
",",
"addr",
"string",
")",
"(",
"Conn",
",",
"error",
")",
"{",
"conn",
",",
"err",
":=",
"net",
".",
"Dial",
"(",
"network",
",",
"addr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"... | // Dial establishes the remote connection to the address on the
// given network. | [
"Dial",
"establishes",
"the",
"remote",
"connection",
"to",
"the",
"address",
"on",
"the",
"given",
"network",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L244-L251 |
136,706 | netrack/openflow | net.go | DialTLS | func DialTLS(network, addr string, config *tls.Config) (Conn, error) {
conn, err := tls.Dial(network, addr, config)
if err != nil {
return nil, err
}
return NewConn(conn), nil
} | go | func DialTLS(network, addr string, config *tls.Config) (Conn, error) {
conn, err := tls.Dial(network, addr, config)
if err != nil {
return nil, err
}
return NewConn(conn), nil
} | [
"func",
"DialTLS",
"(",
"network",
",",
"addr",
"string",
",",
"config",
"*",
"tls",
".",
"Config",
")",
"(",
"Conn",
",",
"error",
")",
"{",
"conn",
",",
"err",
":=",
"tls",
".",
"Dial",
"(",
"network",
",",
"addr",
",",
"config",
")",
"\n",
"if... | // DialTLS establishes the remote connection to the address on the
// given network and then initiates TLS handshake, returning the
// resulting TLS connection. | [
"DialTLS",
"establishes",
"the",
"remote",
"connection",
"to",
"the",
"address",
"on",
"the",
"given",
"network",
"and",
"then",
"initiates",
"TLS",
"handshake",
"returning",
"the",
"resulting",
"TLS",
"connection",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L256-L263 |
136,707 | netrack/openflow | net.go | Listen | func Listen(network, laddr string) (Listener, error) {
tcpaddr, err := net.ResolveTCPAddr(network, laddr)
if err != nil {
return nil, err
}
ln, err := net.ListenTCP(network, tcpaddr)
if err != nil {
return nil, err
}
return &listener{ln}, err
} | go | func Listen(network, laddr string) (Listener, error) {
tcpaddr, err := net.ResolveTCPAddr(network, laddr)
if err != nil {
return nil, err
}
ln, err := net.ListenTCP(network, tcpaddr)
if err != nil {
return nil, err
}
return &listener{ln}, err
} | [
"func",
"Listen",
"(",
"network",
",",
"laddr",
"string",
")",
"(",
"Listener",
",",
"error",
")",
"{",
"tcpaddr",
",",
"err",
":=",
"net",
".",
"ResolveTCPAddr",
"(",
"network",
",",
"laddr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil"... | // Listen announces on the local network address laddr. | [
"Listen",
"announces",
"on",
"the",
"local",
"network",
"address",
"laddr",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L313-L325 |
136,708 | netrack/openflow | net.go | ListenTLS | func ListenTLS(network, laddr string, config *tls.Config) (Listener, error) {
ln, err := tls.Listen(network, laddr, config)
if err != nil {
return nil, err
}
return &listener{ln}, err
} | go | func ListenTLS(network, laddr string, config *tls.Config) (Listener, error) {
ln, err := tls.Listen(network, laddr, config)
if err != nil {
return nil, err
}
return &listener{ln}, err
} | [
"func",
"ListenTLS",
"(",
"network",
",",
"laddr",
"string",
",",
"config",
"*",
"tls",
".",
"Config",
")",
"(",
"Listener",
",",
"error",
")",
"{",
"ln",
",",
"err",
":=",
"tls",
".",
"Listen",
"(",
"network",
",",
"laddr",
",",
"config",
")",
"\n... | // ListenTLS announces on the local network address. | [
"ListenTLS",
"announces",
"on",
"the",
"local",
"network",
"address",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/net.go#L328-L335 |
136,709 | netrack/openflow | request.go | init | func (r *copyReader) init() {
_, r.rerr = r.WriteTo(&r.rbuf)
} | go | func (r *copyReader) init() {
_, r.rerr = r.WriteTo(&r.rbuf)
} | [
"func",
"(",
"r",
"*",
"copyReader",
")",
"init",
"(",
")",
"{",
"_",
",",
"r",
".",
"rerr",
"=",
"r",
".",
"WriteTo",
"(",
"&",
"r",
".",
"rbuf",
")",
"\n",
"}"
] | // init writes the WriterTo content into the internal buffer. This
// data will be used in the Read method.
//
// It persists an error of the WriteTo call. So it will be returned
// on each attempt to read the data. | [
"init",
"writes",
"the",
"WriterTo",
"content",
"into",
"the",
"internal",
"buffer",
".",
"This",
"data",
"will",
"be",
"used",
"in",
"the",
"Read",
"method",
".",
"It",
"persists",
"an",
"error",
"of",
"the",
"WriteTo",
"call",
".",
"So",
"it",
"will",
... | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/request.go#L45-L47 |
136,710 | netrack/openflow | request.go | WriteTo | func (r *copyReader) WriteTo(w io.Writer) (int64, error) {
if r.WriterTo == nil {
return 0, nil
}
return r.WriterTo.WriteTo(w)
} | go | func (r *copyReader) WriteTo(w io.Writer) (int64, error) {
if r.WriterTo == nil {
return 0, nil
}
return r.WriterTo.WriteTo(w)
} | [
"func",
"(",
"r",
"*",
"copyReader",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"if",
"r",
".",
"WriterTo",
"==",
"nil",
"{",
"return",
"0",
",",
"nil",
"\n",
"}",
"\n\n",
"return",
"r",
".",
"Writ... | // WriteTo implements io.WriterTo interface. It makes it possible
// to call WriterTo methods, even when underlying instance is set
// to nil. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"makes",
"it",
"possible",
"to",
"call",
"WriterTo",
"methods",
"even",
"when",
"underlying",
"instance",
"is",
"set",
"to",
"nil",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/request.go#L52-L58 |
136,711 | netrack/openflow | request.go | NewRequest | func NewRequest(t Type, body io.WriterTo) *Request {
req := &Request{
Body: ©Reader{WriterTo: body},
Proto: "OFP/1.3",
ProtoMajor: 1, ProtoMinor: 3,
}
req.Header.Version = uint8(req.ProtoMajor + req.ProtoMinor)
req.Header.Type = t
return req
} | go | func NewRequest(t Type, body io.WriterTo) *Request {
req := &Request{
Body: ©Reader{WriterTo: body},
Proto: "OFP/1.3",
ProtoMajor: 1, ProtoMinor: 3,
}
req.Header.Version = uint8(req.ProtoMajor + req.ProtoMinor)
req.Header.Type = t
return req
} | [
"func",
"NewRequest",
"(",
"t",
"Type",
",",
"body",
"io",
".",
"WriterTo",
")",
"*",
"Request",
"{",
"req",
":=",
"&",
"Request",
"{",
"Body",
":",
"&",
"copyReader",
"{",
"WriterTo",
":",
"body",
"}",
",",
"Proto",
":",
"\"",
"\"",
",",
"ProtoMaj... | // NewRequest returns a new Request given a type, address, and optional
// body. | [
"NewRequest",
"returns",
"a",
"new",
"Request",
"given",
"a",
"type",
"address",
"and",
"optional",
"body",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/request.go#L105-L116 |
136,712 | netrack/openflow | request.go | ProtoAtLeast | func (r *Request) ProtoAtLeast(major, minor int) bool {
return r.ProtoMajor > major ||
r.ProtoMajor == major && r.ProtoMinor >= minor
} | go | func (r *Request) ProtoAtLeast(major, minor int) bool {
return r.ProtoMajor > major ||
r.ProtoMajor == major && r.ProtoMinor >= minor
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"ProtoAtLeast",
"(",
"major",
",",
"minor",
"int",
")",
"bool",
"{",
"return",
"r",
".",
"ProtoMajor",
">",
"major",
"||",
"r",
".",
"ProtoMajor",
"==",
"major",
"&&",
"r",
".",
"ProtoMinor",
">=",
"minor",
"\n"... | // ProtoAtLeast reports whether the OpenFlow protocol used in the request
// is at least major.minor. | [
"ProtoAtLeast",
"reports",
"whether",
"the",
"OpenFlow",
"protocol",
"used",
"in",
"the",
"request",
"is",
"at",
"least",
"major",
".",
"minor",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/request.go#L120-L123 |
136,713 | netrack/openflow | request.go | WriteTo | func (r *Request) WriteTo(w io.Writer) (n int64, err error) {
var buf bytes.Buffer
// Save the header length into the request.
r.Header.Length = uint16(headerlen)
// If the body of the request is not specified (like in case when
// the echo requests or reply are used), keep the fast path.
if r.Body == nil {
re... | go | func (r *Request) WriteTo(w io.Writer) (n int64, err error) {
var buf bytes.Buffer
// Save the header length into the request.
r.Header.Length = uint16(headerlen)
// If the body of the request is not specified (like in case when
// the echo requests or reply are used), keep the fast path.
if r.Body == nil {
re... | [
"func",
"(",
"r",
"*",
"Request",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"// Save the header length into the request.",
"r",
".",
"Header",
".",
... | // WriteTo implements WriterTo interface. Writes the request in wire format
// to w until there's no more data to write or when an error occurs. | [
"WriteTo",
"implements",
"WriterTo",
"interface",
".",
"Writes",
"the",
"request",
"in",
"wire",
"format",
"to",
"w",
"until",
"there",
"s",
"no",
"more",
"data",
"to",
"write",
"or",
"when",
"an",
"error",
"occurs",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/request.go#L132-L174 |
136,714 | netrack/openflow | request.go | ReadFrom | func (r *Request) ReadFrom(rd io.Reader) (n int64, err error) {
// On the first step we will read the OpenFlow header, so
// we could get the total length of the OpenFlow message.
n, err = r.Header.ReadFrom(rd)
if err != nil {
return
}
// Decode the protocol version major and minor number to
// make the reque... | go | func (r *Request) ReadFrom(rd io.Reader) (n int64, err error) {
// On the first step we will read the OpenFlow header, so
// we could get the total length of the OpenFlow message.
n, err = r.Header.ReadFrom(rd)
if err != nil {
return
}
// Decode the protocol version major and minor number to
// make the reque... | [
"func",
"(",
"r",
"*",
"Request",
")",
"ReadFrom",
"(",
"rd",
"io",
".",
"Reader",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"// On the first step we will read the OpenFlow header, so",
"// we could get the total length of the OpenFlow message.",
"n",
","... | // ReadFrom implements ReaderFrom interface. Reads the request in wire
// format from the r to the Request structure. | [
"ReadFrom",
"implements",
"ReaderFrom",
"interface",
".",
"Reads",
"the",
"request",
"in",
"wire",
"format",
"from",
"the",
"r",
"to",
"the",
"Request",
"structure",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/request.go#L178-L216 |
136,715 | netrack/openflow | ofp/aggregate.go | WriteTo | func (a *AggregateStatsRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, a.Table, pad3{},
a.OutPort, a.OutGroup, pad4{}, a.Cookie,
a.CookieMask, &a.Match)
} | go | func (a *AggregateStatsRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, a.Table, pad3{},
a.OutPort, a.OutGroup, pad4{}, a.Cookie,
a.CookieMask, &a.Match)
} | [
"func",
"(",
"a",
"*",
"AggregateStatsRequest",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"a",
".",
"Table",
",",
"pad3",
"{",
"}",
",",
"a",
"."... | // WriteTo implements io.WriterTo interface. It serializes the
// aggregated statistics request into the wire format with required
// padding. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"aggregated",
"statistics",
"request",
"into",
"the",
"wire",
"format",
"with",
"required",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/aggregate.go#L67-L71 |
136,716 | netrack/openflow | ofp/aggregate.go | ReadFrom | func (a *AggregateStatsRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &a.Table, &defaultPad3,
&a.OutPort, &a.OutGroup, &defaultPad4, &a.Cookie,
&a.CookieMask, &a.Match)
} | go | func (a *AggregateStatsRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &a.Table, &defaultPad3,
&a.OutPort, &a.OutGroup, &defaultPad4, &a.Cookie,
&a.CookieMask, &a.Match)
} | [
"func",
"(",
"a",
"*",
"AggregateStatsRequest",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"a",
".",
"Table",
",",
"&",
"defaultPad3",
",",
"... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// aggregated statistics request from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"aggregated",
"statistics",
"request",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/aggregate.go#L75-L79 |
136,717 | netrack/openflow | ofp/aggregate.go | WriteTo | func (a *AggregateStats) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(
w, a.PacketCount, a.ByteCount, a.FlowCount, pad4{})
} | go | func (a *AggregateStats) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(
w, a.PacketCount, a.ByteCount, a.FlowCount, pad4{})
} | [
"func",
"(",
"a",
"*",
"AggregateStats",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"a",
".",
"PacketCount",
",",
"a",
".",
"ByteCount",
",",
"a",
... | // WriteTo implements io.WriterTo interface. It serializes the
// aggregated statistics into the wire format with required
// padding. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"aggregated",
"statistics",
"into",
"the",
"wire",
"format",
"with",
"required",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/aggregate.go#L97-L100 |
136,718 | netrack/openflow | ofp/aggregate.go | ReadFrom | func (a *AggregateStats) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(
r, &a.PacketCount, &a.ByteCount, &a.FlowCount, &defaultPad4)
} | go | func (a *AggregateStats) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(
r, &a.PacketCount, &a.ByteCount, &a.FlowCount, &defaultPad4)
} | [
"func",
"(",
"a",
"*",
"AggregateStats",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"a",
".",
"PacketCount",
",",
"&",
"a",
".",
"ByteCount",... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// aggregated statistics from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"aggregated",
"statistics",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/aggregate.go#L104-L107 |
136,719 | netrack/openflow | ofp/flow.go | NewFlowMod | func NewFlowMod(c FlowModCommand, p *PacketIn) *FlowMod {
var flags FlowModFlag
switch c {
case FlowDelete, FlowDeleteStrict:
// For flow delete requests we cannot set the same flags
// as for flow insertion and modification.
default:
// Use the overlap checking and flow removed notification
// flags by de... | go | func NewFlowMod(c FlowModCommand, p *PacketIn) *FlowMod {
var flags FlowModFlag
switch c {
case FlowDelete, FlowDeleteStrict:
// For flow delete requests we cannot set the same flags
// as for flow insertion and modification.
default:
// Use the overlap checking and flow removed notification
// flags by de... | [
"func",
"NewFlowMod",
"(",
"c",
"FlowModCommand",
",",
"p",
"*",
"PacketIn",
")",
"*",
"FlowMod",
"{",
"var",
"flags",
"FlowModFlag",
"\n\n",
"switch",
"c",
"{",
"case",
"FlowDelete",
",",
"FlowDeleteStrict",
":",
"// For flow delete requests we cannot set the same ... | // NewFlowMod creates a flow modification message based on the specified
// packet-in message.
//
// It is responsibility of the caller to assign the missing instructions
// and the rest of parameters. | [
"NewFlowMod",
"creates",
"a",
"flow",
"modification",
"message",
"based",
"on",
"the",
"specified",
"packet",
"-",
"in",
"message",
".",
"It",
"is",
"responsibility",
"of",
"the",
"caller",
"to",
"assign",
"the",
"missing",
"instructions",
"and",
"the",
"rest"... | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L177-L210 |
136,720 | netrack/openflow | ofp/flow.go | WriteTo | func (f *FlowMod) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, f.Cookie, f.CookieMask, f.Table,
f.Command, f.IdleTimeout, f.HardTimeout, f.Priority,
f.Buffer, f.OutPort, f.OutGroup, f.Flags, pad2{},
&f.Match, &f.Instructions,
)
} | go | func (f *FlowMod) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, f.Cookie, f.CookieMask, f.Table,
f.Command, f.IdleTimeout, f.HardTimeout, f.Priority,
f.Buffer, f.OutPort, f.OutGroup, f.Flags, pad2{},
&f.Match, &f.Instructions,
)
} | [
"func",
"(",
"f",
"*",
"FlowMod",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"f",
".",
"Cookie",
",",
"f",
".",
"CookieMask",
",",
"f",
".",
"Ta... | // WriteTo implements io.WriterTo interface. It serializes the flow
// modification command into the wire format with a necessary padding. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"flow",
"modification",
"command",
"into",
"the",
"wire",
"format",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L225-L231 |
136,721 | netrack/openflow | ofp/flow.go | ReadFrom | func (f *FlowMod) ReadFrom(r io.Reader) (int64, error) {
// Set the list of instructions to nil, if someone will decide
// to reuse the same exemplar for multiple deserializations.
f.Instructions = nil
return encoding.ReadFrom(r, &f.Cookie, &f.CookieMask, &f.Table,
&f.Command, &f.IdleTimeout, &f.HardTimeout, &f.... | go | func (f *FlowMod) ReadFrom(r io.Reader) (int64, error) {
// Set the list of instructions to nil, if someone will decide
// to reuse the same exemplar for multiple deserializations.
f.Instructions = nil
return encoding.ReadFrom(r, &f.Cookie, &f.CookieMask, &f.Table,
&f.Command, &f.IdleTimeout, &f.HardTimeout, &f.... | [
"func",
"(",
"f",
"*",
"FlowMod",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"// Set the list of instructions to nil, if someone will decide",
"// to reuse the same exemplar for multiple deserializations.",
"f",
".",
"Inst... | // ReadFrom implements io.ReaderFrom interface. It deserializes the flow
// modification command from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"flow",
"modification",
"command",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L235-L245 |
136,722 | netrack/openflow | ofp/flow.go | WriteTo | func (f *FlowRemoved) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, f.Cookie, f.Priority, f.Reason,
f.Table, f.DurationSec, f.DurationNSec, f.IdleTimeout,
f.HardTimeout, f.PacketCount, f.ByteCount, &f.Match,
)
} | go | func (f *FlowRemoved) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, f.Cookie, f.Priority, f.Reason,
f.Table, f.DurationSec, f.DurationNSec, f.IdleTimeout,
f.HardTimeout, f.PacketCount, f.ByteCount, &f.Match,
)
} | [
"func",
"(",
"f",
"*",
"FlowRemoved",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"f",
".",
"Cookie",
",",
"f",
".",
"Priority",
",",
"f",
".",
"... | // WriteTo implements io.WriterTo interface. It serializes the flow
// removed message into the wire format with necessary padding. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"flow",
"removed",
"message",
"into",
"the",
"wire",
"format",
"with",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L321-L326 |
136,723 | netrack/openflow | ofp/flow.go | ReadFrom | func (f *FlowRemoved) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &f.Cookie, &f.Priority, &f.Reason,
&f.Table, &f.DurationSec, &f.DurationNSec, &f.IdleTimeout,
&f.HardTimeout, &f.PacketCount, &f.ByteCount, &f.Match,
)
} | go | func (f *FlowRemoved) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &f.Cookie, &f.Priority, &f.Reason,
&f.Table, &f.DurationSec, &f.DurationNSec, &f.IdleTimeout,
&f.HardTimeout, &f.PacketCount, &f.ByteCount, &f.Match,
)
} | [
"func",
"(",
"f",
"*",
"FlowRemoved",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"f",
".",
"Cookie",
",",
"&",
"f",
".",
"Priority",
",",
... | // ReadFrom implements ReaderFrom interface. It serializes the flow
// removed message from the wire format. | [
"ReadFrom",
"implements",
"ReaderFrom",
"interface",
".",
"It",
"serializes",
"the",
"flow",
"removed",
"message",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L330-L335 |
136,724 | netrack/openflow | ofp/flow.go | WriteTo | func (f *FlowStatsRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, f.Table, pad3{}, f.OutPort,
f.OutGroup, pad4{}, f.Cookie, f.CookieMask, &f.Match,
)
} | go | func (f *FlowStatsRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, f.Table, pad3{}, f.OutPort,
f.OutGroup, pad4{}, f.Cookie, f.CookieMask, &f.Match,
)
} | [
"func",
"(",
"f",
"*",
"FlowStatsRequest",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"f",
".",
"Table",
",",
"pad3",
"{",
"}",
",",
"f",
".",
"... | // WriteTo implements io.WriterTo interface. It serializes the flow
// statistics request into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"flow",
"statistics",
"request",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L393-L397 |
136,725 | netrack/openflow | ofp/flow.go | ReadFrom | func (f *FlowStatsRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &f.Table, &defaultPad3, &f.OutPort,
&f.OutGroup, &defaultPad4, &f.Cookie, &f.CookieMask, &f.Match,
)
} | go | func (f *FlowStatsRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &f.Table, &defaultPad3, &f.OutPort,
&f.OutGroup, &defaultPad4, &f.Cookie, &f.CookieMask, &f.Match,
)
} | [
"func",
"(",
"f",
"*",
"FlowStatsRequest",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"f",
".",
"Table",
",",
"&",
"defaultPad3",
",",
"&",
... | // ReadFrom implements io.ReadFrom interface. It deserializes the flow
// statistics request from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReadFrom",
"interface",
".",
"It",
"deserializes",
"the",
"flow",
"statistics",
"request",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L401-L405 |
136,726 | netrack/openflow | ofp/flow.go | WriteTo | func (f *FlowStats) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
_, err := encoding.WriteTo(&buf, f.Table, pad1{}, f.DurationSec,
f.DurationNSec, f.Priority, f.IdleTimeout, f.HardTimeout,
f.Flags, pad4{}, f.Cookie, f.PacketCount, f.ByteCount,
&f.Match, &f.Instructions,
)
if err != nil {
retu... | go | func (f *FlowStats) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
_, err := encoding.WriteTo(&buf, f.Table, pad1{}, f.DurationSec,
f.DurationNSec, f.Priority, f.IdleTimeout, f.HardTimeout,
f.Flags, pad4{}, f.Cookie, f.PacketCount, f.ByteCount,
&f.Match, &f.Instructions,
)
if err != nil {
retu... | [
"func",
"(",
"f",
"*",
"FlowStats",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n\n",
"_",
",",
"err",
":=",
"encoding",
".",
"WriteTo",
"(",
"&",
"buf",
",",
... | // WriteTo implements io.WriterTo interface. It serializes the flow
// statistics into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"flow",
"statistics",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L462-L476 |
136,727 | netrack/openflow | ofp/flow.go | ReadFrom | func (f *FlowStats) ReadFrom(r io.Reader) (int64, error) {
var len uint16
n, err := encoding.ReadFrom(r, &len, &f.Table, &defaultPad1,
&f.DurationSec, &f.DurationNSec, &f.Priority, &f.IdleTimeout,
&f.HardTimeout, &f.Flags, &defaultPad4, &f.Cookie, &f.PacketCount,
&f.ByteCount, &f.Match)
if err != nil {
ret... | go | func (f *FlowStats) ReadFrom(r io.Reader) (int64, error) {
var len uint16
n, err := encoding.ReadFrom(r, &len, &f.Table, &defaultPad1,
&f.DurationSec, &f.DurationNSec, &f.Priority, &f.IdleTimeout,
&f.HardTimeout, &f.Flags, &defaultPad4, &f.Cookie, &f.PacketCount,
&f.ByteCount, &f.Match)
if err != nil {
ret... | [
"func",
"(",
"f",
"*",
"FlowStats",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"len",
"uint16",
"\n\n",
"n",
",",
"err",
":=",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"len",
",",
"... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the flow statistics from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"flow",
"statistics",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/flow.go#L480-L497 |
136,728 | netrack/openflow | ofputil/match.go | basic | func basic(t ofp.XMType, val ofp.XMValue, mask ofp.XMValue) ofp.XM {
return ofp.XM{
Class: ofp.XMClassOpenflowBasic,
Type: t, Value: val, Mask: mask,
}
} | go | func basic(t ofp.XMType, val ofp.XMValue, mask ofp.XMValue) ofp.XM {
return ofp.XM{
Class: ofp.XMClassOpenflowBasic,
Type: t, Value: val, Mask: mask,
}
} | [
"func",
"basic",
"(",
"t",
"ofp",
".",
"XMType",
",",
"val",
"ofp",
".",
"XMValue",
",",
"mask",
"ofp",
".",
"XMValue",
")",
"ofp",
".",
"XM",
"{",
"return",
"ofp",
".",
"XM",
"{",
"Class",
":",
"ofp",
".",
"XMClassOpenflowBasic",
",",
"Type",
":",... | // basic creates an Openflow basic extensible match of the given type. | [
"basic",
"creates",
"an",
"Openflow",
"basic",
"extensible",
"match",
"of",
"the",
"given",
"type",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/match.go#L28-L33 |
136,729 | netrack/openflow | ofputil/match.go | MatchEthType | func MatchEthType(eth uint16) ofp.XM {
return basic(ofp.XMTypeEthType, bytesOf(eth), nil)
} | go | func MatchEthType(eth uint16) ofp.XM {
return basic(ofp.XMTypeEthType, bytesOf(eth), nil)
} | [
"func",
"MatchEthType",
"(",
"eth",
"uint16",
")",
"ofp",
".",
"XM",
"{",
"return",
"basic",
"(",
"ofp",
".",
"XMTypeEthType",
",",
"bytesOf",
"(",
"eth",
")",
",",
"nil",
")",
"\n",
"}"
] | // MatchEthType creates an Openflow basic extensible match of Ethernet
// payload type. | [
"MatchEthType",
"creates",
"an",
"Openflow",
"basic",
"extensible",
"match",
"of",
"Ethernet",
"payload",
"type",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/match.go#L37-L39 |
136,730 | netrack/openflow | ofputil/match.go | MatchInPort | func MatchInPort(port ofp.PortNo) ofp.XM {
return basic(ofp.XMTypeInPort, bytesOf(port), nil)
} | go | func MatchInPort(port ofp.PortNo) ofp.XM {
return basic(ofp.XMTypeInPort, bytesOf(port), nil)
} | [
"func",
"MatchInPort",
"(",
"port",
"ofp",
".",
"PortNo",
")",
"ofp",
".",
"XM",
"{",
"return",
"basic",
"(",
"ofp",
".",
"XMTypeInPort",
",",
"bytesOf",
"(",
"port",
")",
",",
"nil",
")",
"\n",
"}"
] | // MatchInPort creates an Openflow basic extensible match of in port. | [
"MatchInPort",
"creates",
"an",
"Openflow",
"basic",
"extensible",
"match",
"of",
"in",
"port",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/match.go#L42-L44 |
136,731 | netrack/openflow | ofputil/match.go | MatchIPProto | func MatchIPProto(ipp uint8) ofp.XM {
return basic(ofp.XMTypeIPProto, bytesOf(ipp), nil)
} | go | func MatchIPProto(ipp uint8) ofp.XM {
return basic(ofp.XMTypeIPProto, bytesOf(ipp), nil)
} | [
"func",
"MatchIPProto",
"(",
"ipp",
"uint8",
")",
"ofp",
".",
"XM",
"{",
"return",
"basic",
"(",
"ofp",
".",
"XMTypeIPProto",
",",
"bytesOf",
"(",
"ipp",
")",
",",
"nil",
")",
"\n",
"}"
] | // MatchIPProto creates an Openflow basic extensible match of IP protocol
// payload type. | [
"MatchIPProto",
"creates",
"an",
"Openflow",
"basic",
"extensible",
"match",
"of",
"IP",
"protocol",
"payload",
"type",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/match.go#L48-L50 |
136,732 | netrack/openflow | ofputil/match.go | MatchICMPv6Type | func MatchICMPv6Type(icmpt uint8) ofp.XM {
return basic(ofp.XMTypeICMPv6Type, bytesOf(icmpt), nil)
} | go | func MatchICMPv6Type(icmpt uint8) ofp.XM {
return basic(ofp.XMTypeICMPv6Type, bytesOf(icmpt), nil)
} | [
"func",
"MatchICMPv6Type",
"(",
"icmpt",
"uint8",
")",
"ofp",
".",
"XM",
"{",
"return",
"basic",
"(",
"ofp",
".",
"XMTypeICMPv6Type",
",",
"bytesOf",
"(",
"icmpt",
")",
",",
"nil",
")",
"\n",
"}"
] | // MatchICMPv6Type creates an Openflow basic extensible match of ICMPv6
// message type. | [
"MatchICMPv6Type",
"creates",
"an",
"Openflow",
"basic",
"extensible",
"match",
"of",
"ICMPv6",
"message",
"type",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/match.go#L54-L56 |
136,733 | netrack/openflow | ofputil/match.go | MatchIPv6ExtHeader | func MatchIPv6ExtHeader(header uint16) ofp.XM {
return basic(ofp.XMTypeIPv6ExtHeader, bytesOf(header), nil)
} | go | func MatchIPv6ExtHeader(header uint16) ofp.XM {
return basic(ofp.XMTypeIPv6ExtHeader, bytesOf(header), nil)
} | [
"func",
"MatchIPv6ExtHeader",
"(",
"header",
"uint16",
")",
"ofp",
".",
"XM",
"{",
"return",
"basic",
"(",
"ofp",
".",
"XMTypeIPv6ExtHeader",
",",
"bytesOf",
"(",
"header",
")",
",",
"nil",
")",
"\n",
"}"
] | // MatchIPv6ExtHeader creates an Openflow basic extensible match of IPv6
// extension header. | [
"MatchIPv6ExtHeader",
"creates",
"an",
"Openflow",
"basic",
"extensible",
"match",
"of",
"IPv6",
"extension",
"header",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/match.go#L60-L62 |
136,734 | netrack/openflow | ofp/action.go | String | func (a ActionType) String() string {
text, ok := actionText[a]
// If action is now known just say it.
if !ok {
return fmt.Sprintf("Action(%d)", a)
}
return text
} | go | func (a ActionType) String() string {
text, ok := actionText[a]
// If action is now known just say it.
if !ok {
return fmt.Sprintf("Action(%d)", a)
}
return text
} | [
"func",
"(",
"a",
"ActionType",
")",
"String",
"(",
")",
"string",
"{",
"text",
",",
"ok",
":=",
"actionText",
"[",
"a",
"]",
"\n",
"// If action is now known just say it.",
"if",
"!",
"ok",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"... | // String returns a string representation of the action type. | [
"String",
"returns",
"a",
"string",
"representation",
"of",
"the",
"action",
"type",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L16-L24 |
136,735 | netrack/openflow | ofp/action.go | WriteTo | func (a *Actions) WriteTo(w io.Writer) (int64, error) {
buf, err := a.bytes()
if err != nil {
return int64(len(buf)), err
}
return encoding.WriteTo(w, buf)
} | go | func (a *Actions) WriteTo(w io.Writer) (int64, error) {
buf, err := a.bytes()
if err != nil {
return int64(len(buf)), err
}
return encoding.WriteTo(w, buf)
} | [
"func",
"(",
"a",
"*",
"Actions",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"buf",
",",
"err",
":=",
"a",
".",
"bytes",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"int64",
"(",
"le... | // WriteTo writes the list of action to the given writer instance. | [
"WriteTo",
"writes",
"the",
"list",
"of",
"action",
"to",
"the",
"given",
"writer",
"instance",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L186-L193 |
136,736 | netrack/openflow | ofp/action.go | ReadFrom | func (a *Actions) ReadFrom(r io.Reader) (int64, error) {
var actionType ActionType
*a = nil
rm := func() (io.ReaderFrom, error) {
if rm, ok := actionMap[actionType]; ok {
rd, err := rm.MakeReader()
*a = append(*a, rd.(Action))
return rd, err
}
format := "ofp: unknown action type: '%x'"
return nil,... | go | func (a *Actions) ReadFrom(r io.Reader) (int64, error) {
var actionType ActionType
*a = nil
rm := func() (io.ReaderFrom, error) {
if rm, ok := actionMap[actionType]; ok {
rd, err := rm.MakeReader()
*a = append(*a, rd.(Action))
return rd, err
}
format := "ofp: unknown action type: '%x'"
return nil,... | [
"func",
"(",
"a",
"*",
"Actions",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"actionType",
"ActionType",
"\n",
"*",
"a",
"=",
"nil",
"\n\n",
"rm",
":=",
"func",
"(",
")",
"(",
"io",
".",
"R... | // ReadFrom decodes the list of actions from the wire format into
// the list of types that implement Action interface. | [
"ReadFrom",
"decodes",
"the",
"list",
"of",
"actions",
"from",
"the",
"wire",
"format",
"into",
"the",
"list",
"of",
"types",
"that",
"implement",
"Action",
"interface",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L197-L214 |
136,737 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionOutput) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), 16}, *a, pad6{})
} | go | func (a *ActionOutput) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), 16}, *a, pad6{})
} | [
"func",
"(",
"a",
"*",
"ActionOutput",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"action",
"{",
"a",
".",
"Type",
"(",
")",
",",
"16",
"}",
","... | // WriteTo implements the io.WriterTo interface. It serializes
// the action with a necessary padding. | [
"WriteTo",
"implements",
"the",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L239-L241 |
136,738 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionOutput) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &action{}, &a.Port, &a.MaxLen, &defaultPad6)
} | go | func (a *ActionOutput) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &action{}, &a.Port, &a.MaxLen, &defaultPad6)
} | [
"func",
"(",
"a",
"*",
"ActionOutput",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"action",
"{",
"}",
",",
"&",
"a",
".",
"Port",
",",
"&... | // ReadFrom implements the io.ReaderFrom interface. It deserialized
// the output action from a wire format. | [
"ReadFrom",
"implements",
"the",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserialized",
"the",
"output",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L245-L247 |
136,739 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionCopyTTLOut) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, pad4{})
} | go | func (a *ActionCopyTTLOut) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, pad4{})
} | [
"func",
"(",
"a",
"*",
"ActionCopyTTLOut",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"action",
"{",
"a",
".",
"Type",
"(",
")",
",",
"actionLen",
... | // WriteTo implements io.WriterTo interface. It serializes
// the "copy TTL out" action with a necessary padding. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"copy",
"TTL",
"out",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L260-L262 |
136,740 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionCopyTTLOut) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad8)
} | go | func (a *ActionCopyTTLOut) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad8)
} | [
"func",
"(",
"a",
"*",
"ActionCopyTTLOut",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"defaultPad8",
")",
"\n",
"}"
] | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "copy TTL out" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"copy",
"TTL",
"out",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L266-L268 |
136,741 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionSetMPLSTTL) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &action{}, &a.TTL, &defaultPad3)
} | go | func (a *ActionSetMPLSTTL) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &action{}, &a.TTL, &defaultPad3)
} | [
"func",
"(",
"a",
"*",
"ActionSetMPLSTTL",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"action",
"{",
"}",
",",
"&",
"a",
".",
"TTL",
",",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "set MPLS TTL" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"set",
"MPLS",
"TTL",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L311-L313 |
136,742 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionPushMPLS) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen},
a.EtherType, pad2{})
} | go | func (a *ActionPushMPLS) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen},
a.EtherType, pad2{})
} | [
"func",
"(",
"a",
"*",
"ActionPushMPLS",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"action",
"{",
"a",
".",
"Type",
"(",
")",
",",
"actionLen",
"... | // WriteTo implement the io.WriterTo interface. It serializes
// the "push MPLS" action with a necessary padding. | [
"WriteTo",
"implement",
"the",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"push",
"MPLS",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L398-L401 |
136,743 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionPushMPLS) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.EtherType, &defaultPad2)
} | go | func (a *ActionPushMPLS) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.EtherType, &defaultPad2)
} | [
"func",
"(",
"a",
"*",
"ActionPushMPLS",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"defaultPad4",
",",
"&",
"a",
".",
"EtherType",
",",
"&",... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "push VLAN" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"push",
"VLAN",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L405-L407 |
136,744 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionSetQueue) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.QueueID)
} | go | func (a *ActionSetQueue) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.QueueID)
} | [
"func",
"(",
"a",
"*",
"ActionSetQueue",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"action",
"{",
"a",
".",
"Type",
"(",
")",
",",
"actionLen",
"... | // WriteTo implement the io.WriterTo interface. It serializes
// the "set queue" action with a necessary padding. | [
"WriteTo",
"implement",
"the",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"set",
"queue",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L453-L455 |
136,745 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionSetQueue) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.QueueID)
} | go | func (a *ActionSetQueue) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.QueueID)
} | [
"func",
"(",
"a",
"*",
"ActionSetQueue",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"defaultPad4",
",",
"&",
"a",
".",
"QueueID",
")",
"\n",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "set queue" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"set",
"queue",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L459-L461 |
136,746 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionGroup) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.Group)
} | go | func (a *ActionGroup) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.Group)
} | [
"func",
"(",
"a",
"*",
"ActionGroup",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"action",
"{",
"a",
".",
"Type",
"(",
")",
",",
"actionLen",
"}",... | // WriteTo implement the io.WriterTo interface. It serializes
// the "group" action with a necessary padding. | [
"WriteTo",
"implement",
"the",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"group",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L478-L480 |
136,747 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionGroup) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.Group)
} | go | func (a *ActionGroup) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.Group)
} | [
"func",
"(",
"a",
"*",
"ActionGroup",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"defaultPad4",
",",
"&",
"a",
".",
"Group",
")",
"\n",
"}"... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "group" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"group",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L484-L486 |
136,748 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionSetNetworkTTL) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.TTL, pad3{})
} | go | func (a *ActionSetNetworkTTL) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.TTL, pad3{})
} | [
"func",
"(",
"a",
"*",
"ActionSetNetworkTTL",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"action",
"{",
"a",
".",
"Type",
"(",
")",
",",
"actionLen"... | // WriteTo implement the io.WriterTo interface. It serializes
// the "set network TTL" action with a necessary padding. | [
"WriteTo",
"implement",
"the",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"set",
"network",
"TTL",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L502-L504 |
136,749 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionSetNetworkTTL) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.TTL, &defaultPad3)
} | go | func (a *ActionSetNetworkTTL) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.TTL, &defaultPad3)
} | [
"func",
"(",
"a",
"*",
"ActionSetNetworkTTL",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"defaultPad4",
",",
"&",
"a",
".",
"TTL",
",",
"&",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "set network TTL" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"set",
"network",
"TTL",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L508-L510 |
136,750 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionSetField) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
_, err := a.Field.WriteTo(&buf)
if err != nil {
return 0, err
}
// Length is padded to 64 bits
length := buf.Len() + 4
if length%8 != 0 {
_, err := buf.Write(make(pad, 8-length%8))
if err != nil {
return 0, err
}
}... | go | func (a *ActionSetField) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
_, err := a.Field.WriteTo(&buf)
if err != nil {
return 0, err
}
// Length is padded to 64 bits
length := buf.Len() + 4
if length%8 != 0 {
_, err := buf.Write(make(pad, 8-length%8))
if err != nil {
return 0, err
}
}... | [
"func",
"(",
"a",
"*",
"ActionSetField",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n\n",
"_",
",",
"err",
":=",
"a",
".",
"Field",
".",
"WriteTo",
"(",
"&",
... | // WriteTo implement the io.WriterTo interface. It serializes
// the "set field" action with a necessary padding. | [
"WriteTo",
"implement",
"the",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"set",
"field",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L547-L567 |
136,751 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionSetField) ReadFrom(r io.Reader) (int64, error) {
var header action
var num int64
n, err := encoding.ReadFrom(r, &header)
if err != nil {
return n, err
}
limrd := io.LimitReader(r, int64(header.Len-4))
num, err = a.Field.ReadFrom(limrd)
n += num
if err != nil {
return n, err
}
b, err :=... | go | func (a *ActionSetField) ReadFrom(r io.Reader) (int64, error) {
var header action
var num int64
n, err := encoding.ReadFrom(r, &header)
if err != nil {
return n, err
}
limrd := io.LimitReader(r, int64(header.Len-4))
num, err = a.Field.ReadFrom(limrd)
n += num
if err != nil {
return n, err
}
b, err :=... | [
"func",
"(",
"a",
"*",
"ActionSetField",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"header",
"action",
"\n",
"var",
"num",
"int64",
"\n\n",
"n",
",",
"err",
":=",
"encoding",
".",
"ReadFrom",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "set field" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"set",
"field",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L571-L591 |
136,752 | netrack/openflow | ofp/action.go | WriteTo | func (a *ActionExperimenter) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.Experimenter)
} | go | func (a *ActionExperimenter) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, action{a.Type(), actionLen}, a.Experimenter)
} | [
"func",
"(",
"a",
"*",
"ActionExperimenter",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"action",
"{",
"a",
".",
"Type",
"(",
")",
",",
"actionLen",... | // WriteTo implements the io.WriterTo interface. It serializes
// the "experimenter" action with a necessary padding. | [
"WriteTo",
"implements",
"the",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"experimenter",
"action",
"with",
"a",
"necessary",
"padding",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L634-L636 |
136,753 | netrack/openflow | ofp/action.go | ReadFrom | func (a *ActionExperimenter) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.Experimenter)
} | go | func (a *ActionExperimenter) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad4, &a.Experimenter)
} | [
"func",
"(",
"a",
"*",
"ActionExperimenter",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"defaultPad4",
",",
"&",
"a",
".",
"Experimenter",
")",... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the "experimenter" action from a wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"experimenter",
"action",
"from",
"a",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/action.go#L640-L642 |
136,754 | netrack/openflow | ofp/handshake.go | WriteTo | func (h HelloElems) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
for _, elem := range h {
_, err := elem.WriteTo(&buf)
if err != nil {
return 0, err
}
}
return encoding.WriteTo(w, buf.Bytes())
} | go | func (h HelloElems) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
for _, elem := range h {
_, err := elem.WriteTo(&buf)
if err != nil {
return 0, err
}
}
return encoding.WriteTo(w, buf.Bytes())
} | [
"func",
"(",
"h",
"HelloElems",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"for",
"_",
",",
"elem",
":=",
"range",
"h",
"{",
"_",
",",
"err",
":=",
"elem... | // WriteTo implements io.WriterTo interface. It serializes the list
// of hello message elements into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"list",
"of",
"hello",
"message",
"elements",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L48-L58 |
136,755 | netrack/openflow | ofp/handshake.go | ReadFrom | func (h HelloElems) ReadFrom(r io.Reader) (int64, error) {
var helloElemType HelloElemType
rm := func() (io.ReaderFrom, error) {
if rm, ok := helloElemMap[helloElemType]; ok {
rd, err := rm.MakeReader()
h = append(h, rd.(HelloElem))
return rd, err
}
format := "ofp: unknown hello element type: '%x'"
... | go | func (h HelloElems) ReadFrom(r io.Reader) (int64, error) {
var helloElemType HelloElemType
rm := func() (io.ReaderFrom, error) {
if rm, ok := helloElemMap[helloElemType]; ok {
rd, err := rm.MakeReader()
h = append(h, rd.(HelloElem))
return rd, err
}
format := "ofp: unknown hello element type: '%x'"
... | [
"func",
"(",
"h",
"HelloElems",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"helloElemType",
"HelloElemType",
"\n\n",
"rm",
":=",
"func",
"(",
")",
"(",
"io",
".",
"ReaderFrom",
",",
"error",
")",... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// list of hello elements from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"list",
"of",
"hello",
"elements",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L62-L78 |
136,756 | netrack/openflow | ofp/handshake.go | WriteTo | func (h *Hello) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, h.Elements)
} | go | func (h *Hello) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, h.Elements)
} | [
"func",
"(",
"h",
"*",
"Hello",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"h",
".",
"Elements",
")",
"\n",
"}"
] | // WriteTo implements io.WriterTo interface. It serializes
// the hello message into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"hello",
"message",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L101-L103 |
136,757 | netrack/openflow | ofp/handshake.go | ReadFrom | func (h *Hello) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &h.Elements)
} | go | func (h *Hello) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &h.Elements)
} | [
"func",
"(",
"h",
"*",
"Hello",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"h",
".",
"Elements",
")",
"\n",
"}"
] | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the message from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"message",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L107-L109 |
136,758 | netrack/openflow | ofp/handshake.go | WriteTo | func (h *HelloElemVersionBitmap) WriteTo(w io.Writer) (int64, error) {
// Calculate the padding used to align the list of bitmaps.
maplen := len(h.Bitmaps) * 4
padding := make([]byte, (helloElemLen+maplen)%8)
// Total length of the element includes the length of the
// optional header, length of the bitmaps and t... | go | func (h *HelloElemVersionBitmap) WriteTo(w io.Writer) (int64, error) {
// Calculate the padding used to align the list of bitmaps.
maplen := len(h.Bitmaps) * 4
padding := make([]byte, (helloElemLen+maplen)%8)
// Total length of the element includes the length of the
// optional header, length of the bitmaps and t... | [
"func",
"(",
"h",
"*",
"HelloElemVersionBitmap",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"// Calculate the padding used to align the list of bitmaps.",
"maplen",
":=",
"len",
"(",
"h",
".",
"Bitmaps",
")",
"*",... | // WriteTo implements io.WriterTo interface. It serializes the version
// bitmap into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"version",
"bitmap",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L131-L145 |
136,759 | netrack/openflow | ofp/handshake.go | ReadFrom | func (h *HelloElemVersionBitmap) ReadFrom(r io.Reader) (int64, error) {
// Read the header of the version bitmaps to retrieve
// the total length of the message.
var header helloElem
n, err := encoding.ReadFrom(r, &header)
if err != nil {
return n, err
}
// Calculate the length of the list of version bitmaps.... | go | func (h *HelloElemVersionBitmap) ReadFrom(r io.Reader) (int64, error) {
// Read the header of the version bitmaps to retrieve
// the total length of the message.
var header helloElem
n, err := encoding.ReadFrom(r, &header)
if err != nil {
return n, err
}
// Calculate the length of the list of version bitmaps.... | [
"func",
"(",
"h",
"*",
"HelloElemVersionBitmap",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"// Read the header of the version bitmaps to retrieve",
"// the total length of the message.",
"var",
"header",
"helloElem",
"\... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// version bitmap from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"version",
"bitmap",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L149-L168 |
136,760 | netrack/openflow | ofp/handshake.go | WriteTo | func (e *Experimenter) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, e.Experimenter, e.ExpType)
} | go | func (e *Experimenter) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, e.Experimenter, e.ExpType)
} | [
"func",
"(",
"e",
"*",
"Experimenter",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"e",
".",
"Experimenter",
",",
"e",
".",
"ExpType",
")",
"\n",
"... | // WriteTo implements io.WriterTo interface. It serializes the
// experimenter header into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"experimenter",
"header",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L183-L185 |
136,761 | netrack/openflow | ofp/handshake.go | ReadFrom | func (e *Experimenter) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &e.Experimenter, &e.ExpType)
} | go | func (e *Experimenter) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &e.Experimenter, &e.ExpType)
} | [
"func",
"(",
"e",
"*",
"Experimenter",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"e",
".",
"Experimenter",
",",
"&",
"e",
".",
"ExpType",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the experimenter header from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"experimenter",
"header",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L189-L191 |
136,762 | netrack/openflow | ofp/handshake.go | WriteTo | func (rr *RoleRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, rr.Role, pad4{}, rr.GenerationID)
} | go | func (rr *RoleRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, rr.Role, pad4{}, rr.GenerationID)
} | [
"func",
"(",
"rr",
"*",
"RoleRequest",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"rr",
".",
"Role",
",",
"pad4",
"{",
"}",
",",
"rr",
".",
"Gen... | // WriteTo implements io.WriterTo interface. It serializes the role
// request into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"role",
"request",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L242-L244 |
136,763 | netrack/openflow | ofp/handshake.go | ReadFrom | func (rr *RoleRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &rr.Role, &defaultPad4, &rr.GenerationID)
} | go | func (rr *RoleRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &rr.Role, &defaultPad4, &rr.GenerationID)
} | [
"func",
"(",
"rr",
"*",
"RoleRequest",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"rr",
".",
"Role",
",",
"&",
"defaultPad4",
",",
"&",
"rr... | // ReadFrom implements io.ReaderFrom interface. It deserializes the role
// request from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"role",
"request",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L248-L250 |
136,764 | netrack/openflow | ofp/handshake.go | WriteTo | func (a *AsyncConfig) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, a.PacketInMask,
a.PortStatusMask, a.FlowRemovedMask)
} | go | func (a *AsyncConfig) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, a.PacketInMask,
a.PortStatusMask, a.FlowRemovedMask)
} | [
"func",
"(",
"a",
"*",
"AsyncConfig",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"a",
".",
"PacketInMask",
",",
"a",
".",
"PortStatusMask",
",",
"a"... | // WriteTo implements io.WriterTo interface. It serializes the
// asynchronous configuration into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"asynchronous",
"configuration",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L284-L287 |
136,765 | netrack/openflow | ofp/handshake.go | ReadFrom | func (a *AsyncConfig) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &a.PacketInMask,
&a.PortStatusMask, &a.FlowRemovedMask)
} | go | func (a *AsyncConfig) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &a.PacketInMask,
&a.PortStatusMask, &a.FlowRemovedMask)
} | [
"func",
"(",
"a",
"*",
"AsyncConfig",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"a",
".",
"PacketInMask",
",",
"&",
"a",
".",
"PortStatusMas... | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the asynchronous configuration from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"asynchronous",
"configuration",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/handshake.go#L291-L294 |
136,766 | netrack/openflow | ofp/match.go | readAllXM | func readAllXM(r io.Reader, xms *[]XM, hasPayload bool) (int64, error) {
// Read all available bytes from the reader, they will be
// used to unmarshal them into the list of extensible matchers.
buf, err := ioutil.ReadAll(r)
n := int64(len(buf))
if err != nil {
return n, err
}
rbuf := bytes.NewBuffer(buf)
f... | go | func readAllXM(r io.Reader, xms *[]XM, hasPayload bool) (int64, error) {
// Read all available bytes from the reader, they will be
// used to unmarshal them into the list of extensible matchers.
buf, err := ioutil.ReadAll(r)
n := int64(len(buf))
if err != nil {
return n, err
}
rbuf := bytes.NewBuffer(buf)
f... | [
"func",
"readAllXM",
"(",
"r",
"io",
".",
"Reader",
",",
"xms",
"*",
"[",
"]",
"XM",
",",
"hasPayload",
"bool",
")",
"(",
"int64",
",",
"error",
")",
"{",
"// Read all available bytes from the reader, they will be",
"// used to unmarshal them into the list of extensib... | // readAllXM uses all available bytes retrieved from the reader to
// unmarshal them to the list of extensible matchers. The caller
// responsible of passing limited reader to prevent from read of
// unnecessary data. | [
"readAllXM",
"uses",
"all",
"available",
"bytes",
"retrieved",
"from",
"the",
"reader",
"to",
"unmarshal",
"them",
"to",
"the",
"list",
"of",
"extensible",
"matchers",
".",
"The",
"caller",
"responsible",
"of",
"passing",
"limited",
"reader",
"to",
"prevent",
... | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L319-L342 |
136,767 | netrack/openflow | ofp/match.go | ReadFrom | func (xm *XM) ReadFrom(r io.Reader) (n int64, err error) {
return xm.readFrom(r, true)
} | go | func (xm *XM) ReadFrom(r io.Reader) (n int64, err error) {
return xm.readFrom(r, true)
} | [
"func",
"(",
"xm",
"*",
"XM",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"return",
"xm",
".",
"readFrom",
"(",
"r",
",",
"true",
")",
"\n",
"}"
] | // ReadFrom implements io.ReaderFrom interface. It deserializes
// the OpenFlow extensible match from the given reader. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"OpenFlow",
"extensible",
"match",
"from",
"the",
"given",
"reader",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L346-L348 |
136,768 | netrack/openflow | ofp/match.go | readFrom | func (xm *XM) readFrom(r io.Reader, hasPayload bool) (n int64, err error) {
var length uint8
n, err = encoding.ReadFrom(
r, &xm.Class, &xm.Type, &length)
if err != nil {
return
}
hasmask := (xm.Type & 1) == 1
xm.Type >>= 1
xm.Value, xm.Mask = make(XMValue, length), nil
if hasPayload {
var m int64
m,... | go | func (xm *XM) readFrom(r io.Reader, hasPayload bool) (n int64, err error) {
var length uint8
n, err = encoding.ReadFrom(
r, &xm.Class, &xm.Type, &length)
if err != nil {
return
}
hasmask := (xm.Type & 1) == 1
xm.Type >>= 1
xm.Value, xm.Mask = make(XMValue, length), nil
if hasPayload {
var m int64
m,... | [
"func",
"(",
"xm",
"*",
"XM",
")",
"readFrom",
"(",
"r",
"io",
".",
"Reader",
",",
"hasPayload",
"bool",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"var",
"length",
"uint8",
"\n\n",
"n",
",",
"err",
"=",
"encoding",
".",
"ReadFrom",
"... | // readFrom deserializes the OpenFlow extensible match from the
// given reader. If hasPayload is false, xm.Value and xm.Mask
// will be filled with the zero value. | [
"readFrom",
"deserializes",
"the",
"OpenFlow",
"extensible",
"match",
"from",
"the",
"given",
"reader",
".",
"If",
"hasPayload",
"is",
"false",
"xm",
".",
"Value",
"and",
"xm",
".",
"Mask",
"will",
"be",
"filled",
"with",
"the",
"zero",
"value",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L353-L385 |
136,769 | netrack/openflow | ofp/match.go | WriteTo | func (xm *XM) WriteTo(w io.Writer) (int64, error) {
var hasmask XMType
if len(xm.Mask) > 0 {
hasmask = 1
}
field := (xm.Type << 1) | hasmask
return encoding.WriteTo(
w, xm.Class, field,
uint8(len(xm.Mask)+len(xm.Value)),
xm.Value, xm.Mask)
} | go | func (xm *XM) WriteTo(w io.Writer) (int64, error) {
var hasmask XMType
if len(xm.Mask) > 0 {
hasmask = 1
}
field := (xm.Type << 1) | hasmask
return encoding.WriteTo(
w, xm.Class, field,
uint8(len(xm.Mask)+len(xm.Value)),
xm.Value, xm.Mask)
} | [
"func",
"(",
"xm",
"*",
"XM",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"hasmask",
"XMType",
"\n",
"if",
"len",
"(",
"xm",
".",
"Mask",
")",
">",
"0",
"{",
"hasmask",
"=",
"1",
"\n",
"}",... | // WriteTo implements io.WriterTo interface. It serializes the OpenFlow
// extensible match into given writer. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"OpenFlow",
"extensible",
"match",
"into",
"given",
"writer",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L389-L401 |
136,770 | netrack/openflow | ofp/match.go | UInt32 | func (val XMValue) UInt32() (v uint32) {
encoding.ReadFrom(bytes.NewBuffer(val), &v)
return
} | go | func (val XMValue) UInt32() (v uint32) {
encoding.ReadFrom(bytes.NewBuffer(val), &v)
return
} | [
"func",
"(",
"val",
"XMValue",
")",
"UInt32",
"(",
")",
"(",
"v",
"uint32",
")",
"{",
"encoding",
".",
"ReadFrom",
"(",
"bytes",
".",
"NewBuffer",
"(",
"val",
")",
",",
"&",
"v",
")",
"\n",
"return",
"\n",
"}"
] | // UInt32 returns the value of extensible match as int32. | [
"UInt32",
"returns",
"the",
"value",
"of",
"extensible",
"match",
"as",
"int32",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L407-L410 |
136,771 | netrack/openflow | ofp/match.go | UInt16 | func (val XMValue) UInt16() (v uint16) {
encoding.ReadFrom(bytes.NewBuffer(val), &v)
return
} | go | func (val XMValue) UInt16() (v uint16) {
encoding.ReadFrom(bytes.NewBuffer(val), &v)
return
} | [
"func",
"(",
"val",
"XMValue",
")",
"UInt16",
"(",
")",
"(",
"v",
"uint16",
")",
"{",
"encoding",
".",
"ReadFrom",
"(",
"bytes",
".",
"NewBuffer",
"(",
"val",
")",
",",
"&",
"v",
")",
"\n",
"return",
"\n",
"}"
] | // UInt16 returns the value of extensible match as int16. | [
"UInt16",
"returns",
"the",
"value",
"of",
"extensible",
"match",
"as",
"int16",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L413-L416 |
136,772 | netrack/openflow | ofp/match.go | UInt8 | func (val XMValue) UInt8() (v uint8) {
encoding.ReadFrom(bytes.NewBuffer(val), &v)
return
} | go | func (val XMValue) UInt8() (v uint8) {
encoding.ReadFrom(bytes.NewBuffer(val), &v)
return
} | [
"func",
"(",
"val",
"XMValue",
")",
"UInt8",
"(",
")",
"(",
"v",
"uint8",
")",
"{",
"encoding",
".",
"ReadFrom",
"(",
"bytes",
".",
"NewBuffer",
"(",
"val",
")",
",",
"&",
"v",
")",
"\n",
"return",
"\n",
"}"
] | // UInt8 returns the value of extensible match as uint8. | [
"UInt8",
"returns",
"the",
"value",
"of",
"extensible",
"match",
"as",
"uint8",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L419-L422 |
136,773 | netrack/openflow | ofp/match.go | Field | func (m *Match) Field(mt XMType) *XM {
for _, xm := range m.Fields {
if xm.Type == mt {
return &xm
}
}
return nil
} | go | func (m *Match) Field(mt XMType) *XM {
for _, xm := range m.Fields {
if xm.Type == mt {
return &xm
}
}
return nil
} | [
"func",
"(",
"m",
"*",
"Match",
")",
"Field",
"(",
"mt",
"XMType",
")",
"*",
"XM",
"{",
"for",
"_",
",",
"xm",
":=",
"range",
"m",
".",
"Fields",
"{",
"if",
"xm",
".",
"Type",
"==",
"mt",
"{",
"return",
"&",
"xm",
"\n",
"}",
"\n",
"}",
"\n\... | // Field returns a first entry of OXM by the given type. | [
"Field",
"returns",
"a",
"first",
"entry",
"of",
"OXM",
"by",
"the",
"given",
"type",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L452-L460 |
136,774 | netrack/openflow | ofp/match.go | ReadFrom | func (m *Match) ReadFrom(r io.Reader) (n int64, err error) {
var nn int64
var length uint16
// Initialize the structure attributes with default
// values, so we could read multiple times into the
// same variable.
m.Type, m.Fields = 0, nil
n, err = encoding.ReadFrom(r, &m.Type, &length)
if err != nil {
retu... | go | func (m *Match) ReadFrom(r io.Reader) (n int64, err error) {
var nn int64
var length uint16
// Initialize the structure attributes with default
// values, so we could read multiple times into the
// same variable.
m.Type, m.Fields = 0, nil
n, err = encoding.ReadFrom(r, &m.Type, &length)
if err != nil {
retu... | [
"func",
"(",
"m",
"*",
"Match",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"var",
"nn",
"int64",
"\n",
"var",
"length",
"uint16",
"\n\n",
"// Initialize the structure attributes with default",
"//... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// match from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"match",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L464-L493 |
136,775 | netrack/openflow | ofp/match.go | WriteTo | func (m *Match) WriteTo(w io.Writer) (n int64, err error) {
var buf bytes.Buffer
for _, xm := range m.Fields {
_, err = xm.WriteTo(&buf)
if err != nil {
return
}
}
// Length of Match (excluding padding)
length := buf.Len() + 4
padding := makePad(length)
return encoding.WriteTo(
w, m.Type, uint16(le... | go | func (m *Match) WriteTo(w io.Writer) (n int64, err error) {
var buf bytes.Buffer
for _, xm := range m.Fields {
_, err = xm.WriteTo(&buf)
if err != nil {
return
}
}
// Length of Match (excluding padding)
length := buf.Len() + 4
padding := makePad(length)
return encoding.WriteTo(
w, m.Type, uint16(le... | [
"func",
"(",
"m",
"*",
"Match",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n\n",
"for",
"_",
",",
"xm",
":=",
"range",
"m",
".",
"Fields",
"{",
... | // WriteTo implements io.WriterTo interface. It serializes the match
// into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"match",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/match.go#L497-L513 |
136,776 | netrack/openflow | ofp/queue.go | WriteTo | func (q QueueProps) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
for _, prop := range q {
_, err := prop.WriteTo(&buf)
if err != nil {
return 0, err
}
}
return encoding.WriteTo(w, buf.Bytes())
} | go | func (q QueueProps) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
for _, prop := range q {
_, err := prop.WriteTo(&buf)
if err != nil {
return 0, err
}
}
return encoding.WriteTo(w, buf.Bytes())
} | [
"func",
"(",
"q",
"QueueProps",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n\n",
"for",
"_",
",",
"prop",
":=",
"range",
"q",
"{",
"_",
",",
"err",
":=",
"pr... | // WriteTo implements io.WriterTo interface. It serializes the set
// of queue properties into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"set",
"of",
"queue",
"properties",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L57-L68 |
136,777 | netrack/openflow | ofp/queue.go | ReadFrom | func (q QueueProps) ReadFrom(r io.Reader) (int64, error) {
var queueType QueuePropType
rm := func() (io.ReaderFrom, error) {
if rm, ok := queuePropTypeMap[queueType]; ok {
rd, err := rm.MakeReader()
q = append(q, rd.(QueueProp))
return rd, err
}
format := "ofp: unknown queue property type: '%x'"
re... | go | func (q QueueProps) ReadFrom(r io.Reader) (int64, error) {
var queueType QueuePropType
rm := func() (io.ReaderFrom, error) {
if rm, ok := queuePropTypeMap[queueType]; ok {
rd, err := rm.MakeReader()
q = append(q, rd.(QueueProp))
return rd, err
}
format := "ofp: unknown queue property type: '%x'"
re... | [
"func",
"(",
"q",
"QueueProps",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"queueType",
"QueuePropType",
"\n\n",
"rm",
":=",
"func",
"(",
")",
"(",
"io",
".",
"ReaderFrom",
",",
"error",
")",
"... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// set of queue properties from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"set",
"of",
"queue",
"properties",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L72-L88 |
136,778 | netrack/openflow | ofp/queue.go | WriteTo | func (q *PacketQueue) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
_, err := q.Properties.WriteTo(&buf)
if err != nil {
return 0, err
}
return encoding.WriteTo(w, q.Queue, q.Port,
uint16(buf.Len()+packetQueueLen), pad6{}, buf.Bytes())
} | go | func (q *PacketQueue) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
_, err := q.Properties.WriteTo(&buf)
if err != nil {
return 0, err
}
return encoding.WriteTo(w, q.Queue, q.Port,
uint16(buf.Len()+packetQueueLen), pad6{}, buf.Bytes())
} | [
"func",
"(",
"q",
"*",
"PacketQueue",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"_",
",",
"err",
":=",
"q",
".",
"Properties",
".",
"WriteTo",
"(",
"&",
... | // WriteTo implements io.WriterTo interface. It serializes the packet
// queue into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"packet",
"queue",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L113-L122 |
136,779 | netrack/openflow | ofp/queue.go | ReadFrom | func (q *PacketQueue) ReadFrom(r io.Reader) (int64, error) {
var length uint16
n, err := encoding.ReadFrom(r, &q.Queue, &q.Port,
&length, &defaultPad6)
if err != nil {
return n, err
}
limrd := io.LimitReader(r, int64(length-packetQueueLen))
nn, err := q.Properties.ReadFrom(limrd)
return n + nn, err
} | go | func (q *PacketQueue) ReadFrom(r io.Reader) (int64, error) {
var length uint16
n, err := encoding.ReadFrom(r, &q.Queue, &q.Port,
&length, &defaultPad6)
if err != nil {
return n, err
}
limrd := io.LimitReader(r, int64(length-packetQueueLen))
nn, err := q.Properties.ReadFrom(limrd)
return n + nn, err
} | [
"func",
"(",
"q",
"*",
"PacketQueue",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"length",
"uint16",
"\n",
"n",
",",
"err",
":=",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"q",
".",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// packet queue from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"packet",
"queue",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L126-L138 |
136,780 | netrack/openflow | ofp/queue.go | WriteTo | func (q *QueuePropMinRate) WriteTo(w io.Writer) (int64, error) {
header := queueProp{q.Type(), queuePropLen}
return encoding.WriteTo(w, header, pad4{}, q.Rate, pad6{})
} | go | func (q *QueuePropMinRate) WriteTo(w io.Writer) (int64, error) {
header := queueProp{q.Type(), queuePropLen}
return encoding.WriteTo(w, header, pad4{}, q.Rate, pad6{})
} | [
"func",
"(",
"q",
"*",
"QueuePropMinRate",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"header",
":=",
"queueProp",
"{",
"q",
".",
"Type",
"(",
")",
",",
"queuePropLen",
"}",
"\n",
"return",
"encoding",
... | // WriteTo implements io.WriterTo interface. It serializes the queue property
// into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"queue",
"property",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L174-L177 |
136,781 | netrack/openflow | ofp/queue.go | ReadFrom | func (q *QueuePropMaxRate) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad8, &q.Rate, &defaultPad6)
} | go | func (q *QueuePropMaxRate) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &defaultPad8, &q.Rate, &defaultPad6)
} | [
"func",
"(",
"q",
"*",
"QueuePropMaxRate",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"defaultPad8",
",",
"&",
"q",
".",
"Rate",
",",
"&",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// maximum-rate queue property from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"maximum",
"-",
"rate",
"queue",
"property",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L207-L209 |
136,782 | netrack/openflow | ofp/queue.go | WriteTo | func (q *QueuePropExperimenter) WriteTo(w io.Writer) (int64, error) {
header := queueProp{q.Type(), queuePropLen + uint16(len(q.Data))}
return encoding.WriteTo(w, header, pad4{},
q.Experimenter, &pad4{}, q.Data)
} | go | func (q *QueuePropExperimenter) WriteTo(w io.Writer) (int64, error) {
header := queueProp{q.Type(), queuePropLen + uint16(len(q.Data))}
return encoding.WriteTo(w, header, pad4{},
q.Experimenter, &pad4{}, q.Data)
} | [
"func",
"(",
"q",
"*",
"QueuePropExperimenter",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"header",
":=",
"queueProp",
"{",
"q",
".",
"Type",
"(",
")",
",",
"queuePropLen",
"+",
"uint16",
"(",
"len",
... | // WriteTo implements io.WriterTo interface. It serializes the
// experimental queue property into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"experimental",
"queue",
"property",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L228-L232 |
136,783 | netrack/openflow | ofp/queue.go | ReadFrom | func (q *QueuePropExperimenter) ReadFrom(r io.Reader) (int64, error) {
var header queueProp
n, err := encoding.ReadFrom(r, &header, &defaultPad4,
&q.Experimenter, &defaultPad4)
if err != nil {
return n, err
}
limrd := io.LimitReader(r, int64(header.Len-queuePropLen))
q.Data, err = ioutil.ReadAll(limrd)
ret... | go | func (q *QueuePropExperimenter) ReadFrom(r io.Reader) (int64, error) {
var header queueProp
n, err := encoding.ReadFrom(r, &header, &defaultPad4,
&q.Experimenter, &defaultPad4)
if err != nil {
return n, err
}
limrd := io.LimitReader(r, int64(header.Len-queuePropLen))
q.Data, err = ioutil.ReadAll(limrd)
ret... | [
"func",
"(",
"q",
"*",
"QueuePropExperimenter",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"header",
"queueProp",
"\n",
"n",
",",
"err",
":=",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// queue property from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"queue",
"property",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L236-L248 |
136,784 | netrack/openflow | ofp/queue.go | WriteTo | func (q *QueueStatsRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, q.Port, q.Queue)
} | go | func (q *QueueStatsRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, q.Port, q.Queue)
} | [
"func",
"(",
"q",
"*",
"QueueStatsRequest",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"q",
".",
"Port",
",",
"q",
".",
"Queue",
")",
"\n",
"}"
] | // WriteTo implements io.WriterTo interface. It serializes the queue
// statistics request into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"queue",
"statistics",
"request",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L269-L271 |
136,785 | netrack/openflow | ofp/queue.go | ReadFrom | func (q *QueueStatsRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &q.Port, &q.Queue)
} | go | func (q *QueueStatsRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &q.Port, &q.Queue)
} | [
"func",
"(",
"q",
"*",
"QueueStatsRequest",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"q",
".",
"Port",
",",
"&",
"q",
".",
"Queue",
")",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// queue statistics request from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"queue",
"statistics",
"request",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L275-L277 |
136,786 | netrack/openflow | ofp/queue.go | WriteTo | func (q *QueueStats) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, *q)
} | go | func (q *QueueStats) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, *q)
} | [
"func",
"(",
"q",
"*",
"QueueStats",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"*",
"q",
")",
"\n",
"}"
] | // WriteTo implements io.WriterTo interface. It serializes the queue
// statistics into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"queue",
"statistics",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L308-L310 |
136,787 | netrack/openflow | ofp/queue.go | ReadFrom | func (q *QueueStats) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &q.Port, &q.Queue, &q.TxBytes,
&q.TxPackets, &q.TxErrors, &q.DurationSec, &q.DurationNSec)
} | go | func (q *QueueStats) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &q.Port, &q.Queue, &q.TxBytes,
&q.TxPackets, &q.TxErrors, &q.DurationSec, &q.DurationNSec)
} | [
"func",
"(",
"q",
"*",
"QueueStats",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"q",
".",
"Port",
",",
"&",
"q",
".",
"Queue",
",",
"&",
... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// queue statistics from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"queue",
"statistics",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L314-L317 |
136,788 | netrack/openflow | ofp/queue.go | WriteTo | func (q *QueueGetConfigRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, q.Port, pad4{})
} | go | func (q *QueueGetConfigRequest) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, q.Port, pad4{})
} | [
"func",
"(",
"q",
"*",
"QueueGetConfigRequest",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"q",
".",
"Port",
",",
"pad4",
"{",
"}",
")",
"\n",
"}"... | // WriteTo implements io.WriterTo interface. It serializes the messages
// used to query the switch for configured queues into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"messages",
"used",
"to",
"query",
"the",
"switch",
"for",
"configured",
"queues",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L330-L332 |
136,789 | netrack/openflow | ofp/queue.go | ReadFrom | func (q *QueueGetConfigRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &q.Port, &defaultPad4)
} | go | func (q *QueueGetConfigRequest) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r, &q.Port, &defaultPad4)
} | [
"func",
"(",
"q",
"*",
"QueueGetConfigRequest",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"q",
".",
"Port",
",",
"&",
"defaultPad4",
")",
"\... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// message used to query the switch for configured queues from the wire
// format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"message",
"used",
"to",
"query",
"the",
"switch",
"for",
"configured",
"queues",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L337-L339 |
136,790 | netrack/openflow | ofp/queue.go | WriteTo | func (q *QueueGetConfigReply) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
for _, queue := range q.Queues {
_, err := queue.WriteTo(&buf)
if err != nil {
return 0, err
}
}
return encoding.WriteTo(w, q.Port, pad4{}, buf.Bytes())
} | go | func (q *QueueGetConfigReply) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
for _, queue := range q.Queues {
_, err := queue.WriteTo(&buf)
if err != nil {
return 0, err
}
}
return encoding.WriteTo(w, q.Port, pad4{}, buf.Bytes())
} | [
"func",
"(",
"q",
"*",
"QueueGetConfigReply",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"for",
"_",
",",
"queue",
":=",
"range",
"q",
".",
"Queues",
"{",
... | // WriteTo implements io.WriterTo interface. It serializes the queue
// configuration reply into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"queue",
"configuration",
"reply",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L353-L363 |
136,791 | netrack/openflow | ofp/queue.go | ReadFrom | func (q *QueueGetConfigReply) ReadFrom(r io.Reader) (int64, error) {
n, err := encoding.ReadFrom(r, &q.Port, &defaultPad4)
if err != nil {
return n, err
}
// The passed reader should be limited to the whole
// OpenFlow message, thus return EOF error when the
// messages ends. Otherwise this implementation will... | go | func (q *QueueGetConfigReply) ReadFrom(r io.Reader) (int64, error) {
n, err := encoding.ReadFrom(r, &q.Port, &defaultPad4)
if err != nil {
return n, err
}
// The passed reader should be limited to the whole
// OpenFlow message, thus return EOF error when the
// messages ends. Otherwise this implementation will... | [
"func",
"(",
"q",
"*",
"QueueGetConfigReply",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"n",
",",
"err",
":=",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"q",
".",
"Port",
",",
"&",
"defaultP... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// queue configuration reply from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"queue",
"configuration",
"reply",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/queue.go#L367-L380 |
136,792 | netrack/openflow | ofputil/actions.go | ActionsApply | func ActionsApply(actions ...ofp.Action) ofp.Instructions {
return ofp.Instructions{&ofp.InstructionApplyActions{actions}}
} | go | func ActionsApply(actions ...ofp.Action) ofp.Instructions {
return ofp.Instructions{&ofp.InstructionApplyActions{actions}}
} | [
"func",
"ActionsApply",
"(",
"actions",
"...",
"ofp",
".",
"Action",
")",
"ofp",
".",
"Instructions",
"{",
"return",
"ofp",
".",
"Instructions",
"{",
"&",
"ofp",
".",
"InstructionApplyActions",
"{",
"actions",
"}",
"}",
"\n",
"}"
] | // ActionsApply returns a list of instructions with a single element used
// to apply the set of specified actions. | [
"ActionsApply",
"returns",
"a",
"list",
"of",
"instructions",
"with",
"a",
"single",
"element",
"used",
"to",
"apply",
"the",
"set",
"of",
"specified",
"actions",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/actions.go#L9-L11 |
136,793 | netrack/openflow | ofputil/actions.go | ActionsWrite | func ActionsWrite(actions ...ofp.Action) ofp.Instructions {
return ofp.Instructions{&ofp.InstructionWriteActions{actions}}
} | go | func ActionsWrite(actions ...ofp.Action) ofp.Instructions {
return ofp.Instructions{&ofp.InstructionWriteActions{actions}}
} | [
"func",
"ActionsWrite",
"(",
"actions",
"...",
"ofp",
".",
"Action",
")",
"ofp",
".",
"Instructions",
"{",
"return",
"ofp",
".",
"Instructions",
"{",
"&",
"ofp",
".",
"InstructionWriteActions",
"{",
"actions",
"}",
"}",
"\n",
"}"
] | // ActionsWrite returns a list of instructions with a single element used
// to write the set of specified actions. | [
"ActionsWrite",
"returns",
"a",
"list",
"of",
"instructions",
"with",
"a",
"single",
"element",
"used",
"to",
"write",
"the",
"set",
"of",
"specified",
"actions",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofputil/actions.go#L15-L17 |
136,794 | netrack/openflow | ofp/error.go | WriteTo | func (e *Error) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, e.Type, e.Code, e.Data)
} | go | func (e *Error) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, e.Type, e.Code, e.Data)
} | [
"func",
"(",
"e",
"*",
"Error",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"e",
".",
"Type",
",",
"e",
".",
"Code",
",",
"e",
".",
"Data",
")"... | // WriteTo implements io.WriterTo interface. It serializes the error
// message into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"error",
"message",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/error.go#L743-L745 |
136,795 | netrack/openflow | ofp/error.go | ReadFrom | func (e *Error) ReadFrom(r io.Reader) (n int64, err error) {
n, err = encoding.ReadFrom(r, &e.Type, &e.Code)
if err != nil {
return
}
e.Data, err = ioutil.ReadAll(r)
if err != nil {
return
}
return n + int64(len(e.Data)), nil
} | go | func (e *Error) ReadFrom(r io.Reader) (n int64, err error) {
n, err = encoding.ReadFrom(r, &e.Type, &e.Code)
if err != nil {
return
}
e.Data, err = ioutil.ReadAll(r)
if err != nil {
return
}
return n + int64(len(e.Data)), nil
} | [
"func",
"(",
"e",
"*",
"Error",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"n",
",",
"err",
"=",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"e",
".",
"Type",
",",
"&",
"e",
"... | // ReadFrom implements io.ReadFrom interface. It deserializes the
// error message from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReadFrom",
"interface",
".",
"It",
"deserializes",
"the",
"error",
"message",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/error.go#L749-L761 |
136,796 | netrack/openflow | ofp/error.go | WriteTo | func (e *ErrorExperimenter) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, ErrTypeExperimenter, e.ExpType,
e.Experimenter, e.Data)
} | go | func (e *ErrorExperimenter) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w, ErrTypeExperimenter, e.ExpType,
e.Experimenter, e.Data)
} | [
"func",
"(",
"e",
"*",
"ErrorExperimenter",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"ErrTypeExperimenter",
",",
"e",
".",
"ExpType",
",",
"e",
".",... | // WriteTo implements io.WriterTo interface. It serializes experimenter
// error message into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"experimenter",
"error",
"message",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/error.go#L777-L780 |
136,797 | netrack/openflow | ofp/error.go | ReadFrom | func (e *ErrorExperimenter) ReadFrom(r io.Reader) (n int64, err error) {
var etype ErrType
n, err = encoding.ReadFrom(r, &etype, &e.ExpType, &e.Experimenter)
if err != nil {
return n, err
}
e.Data, err = ioutil.ReadAll(r)
if err != nil {
return
}
return n + int64(len(e.Data)), nil
} | go | func (e *ErrorExperimenter) ReadFrom(r io.Reader) (n int64, err error) {
var etype ErrType
n, err = encoding.ReadFrom(r, &etype, &e.ExpType, &e.Experimenter)
if err != nil {
return n, err
}
e.Data, err = ioutil.ReadAll(r)
if err != nil {
return
}
return n + int64(len(e.Data)), nil
} | [
"func",
"(",
"e",
"*",
"ErrorExperimenter",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"var",
"etype",
"ErrType",
"\n",
"n",
",",
"err",
"=",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
... | // ReadFrom implements io.ReadFrom interface. It deserializes the
// experimenter message from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReadFrom",
"interface",
".",
"It",
"deserializes",
"the",
"experimenter",
"message",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/error.go#L784-L797 |
136,798 | netrack/openflow | ofp/switch.go | WriteTo | func (s *SwitchFeatures) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w,
s.DatapathID, s.NumBuffers, s.NumTables, s.AuxiliaryID,
pad2{}, s.Capabilities, s.Reserved)
} | go | func (s *SwitchFeatures) WriteTo(w io.Writer) (int64, error) {
return encoding.WriteTo(w,
s.DatapathID, s.NumBuffers, s.NumTables, s.AuxiliaryID,
pad2{}, s.Capabilities, s.Reserved)
} | [
"func",
"(",
"s",
"*",
"SwitchFeatures",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"WriteTo",
"(",
"w",
",",
"s",
".",
"DatapathID",
",",
"s",
".",
"NumBuffers",
",",
"s",
... | // WriteTo implements io.WriterTo interface. It serializes the switch
// features into the wire format. | [
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
".",
"It",
"serializes",
"the",
"switch",
"features",
"into",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/switch.go#L99-L103 |
136,799 | netrack/openflow | ofp/switch.go | ReadFrom | func (s *SwitchFeatures) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r,
&s.DatapathID, &s.NumBuffers, &s.NumTables, &s.AuxiliaryID,
&defaultPad2, &s.Capabilities, &s.Reserved)
} | go | func (s *SwitchFeatures) ReadFrom(r io.Reader) (int64, error) {
return encoding.ReadFrom(r,
&s.DatapathID, &s.NumBuffers, &s.NumTables, &s.AuxiliaryID,
&defaultPad2, &s.Capabilities, &s.Reserved)
} | [
"func",
"(",
"s",
"*",
"SwitchFeatures",
")",
"ReadFrom",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"encoding",
".",
"ReadFrom",
"(",
"r",
",",
"&",
"s",
".",
"DatapathID",
",",
"&",
"s",
".",
"NumBuffers",... | // ReadFrom implements io.ReaderFrom interface. It deserializes the
// switch features from the wire format. | [
"ReadFrom",
"implements",
"io",
".",
"ReaderFrom",
"interface",
".",
"It",
"deserializes",
"the",
"switch",
"features",
"from",
"the",
"wire",
"format",
"."
] | 9304e84a549fd9332c278eac544f5efff47c9ab8 | https://github.com/netrack/openflow/blob/9304e84a549fd9332c278eac544f5efff47c9ab8/ofp/switch.go#L107-L111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.