summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/udp/protocol.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2020-09-28 16:22:09 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-28 16:24:04 -0700
commita5acc0616c9552c7252e3f133f9ad4648422cc5f (patch)
treec62a2f05c8f8aee20671c39862ffe6721df35332 /pkg/tcpip/transport/udp/protocol.go
parenta0e0ba690f3f4946890010e12084db7f081d5bc7 (diff)
Support creating protocol instances with Stack ref
Network or transport protocols may want to reach the stack. Support this by letting the stack create the protocol instances so it can pass a reference to itself at protocol creation time. Note, protocols do not yet use the stack in this CL but later CLs will make use of the stack from protocols. PiperOrigin-RevId: 334260210
Diffstat (limited to 'pkg/tcpip/transport/udp/protocol.go')
-rw-r--r--pkg/tcpip/transport/udp/protocol.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/tcpip/transport/udp/protocol.go b/pkg/tcpip/transport/udp/protocol.go
index a1d0f49d9..e6fc23258 100644
--- a/pkg/tcpip/transport/udp/protocol.go
+++ b/pkg/tcpip/transport/udp/protocol.go
@@ -12,12 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package udp contains the implementation of the UDP transport protocol. To use
-// it in the networking stack, this package must be added to the project, and
-// activated on the stack by passing udp.NewProtocol() as one of the
-// transport protocols when calling stack.New(). Then endpoints can be created
-// by passing udp.ProtocolNumber as the transport protocol number when calling
-// Stack.NewEndpoint().
+// Package udp contains the implementation of the UDP transport protocol.
package udp
import (
@@ -119,6 +114,6 @@ func (*protocol) Parse(pkt *stack.PacketBuffer) bool {
}
// NewProtocol returns a UDP transport protocol.
-func NewProtocol() stack.TransportProtocol {
+func NewProtocol(*stack.Stack) stack.TransportProtocol {
return &protocol{}
}