Skip to content

Commit

Permalink
socket: add Conn.ICMPv6Filter methods
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Layher <mdlayher@gmail.com>
  • Loading branch information
mdlayher committed Aug 29, 2023
1 parent f8fb5bb commit 749bf3b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@ func (c *Conn) Getpeername() (unix.Sockaddr, error) {
return controlT(c, context.Background(), "getpeername", unix.Getpeername)
}

// GetsockoptICMPv6Filter wraps getsockopt(2) for *unix.ICMPv6Filter values.
func (c *Conn) GetsockoptICMPv6Filter(level, opt int) (*unix.ICMPv6Filter, error) {
return controlT(c, context.Background(), "getsockopt", func(fd int) (*unix.ICMPv6Filter, error) {
return unix.GetsockoptICMPv6Filter(fd, level, opt)
})
}

// GetsockoptInt wraps getsockopt(2) for integer values.
func (c *Conn) GetsockoptInt(level, opt int) (int, error) {
return controlT(c, context.Background(), "getsockopt", func(fd int) (int, error) {
Expand Down Expand Up @@ -609,6 +616,13 @@ func (c *Conn) Sendto(ctx context.Context, p []byte, flags int, to unix.Sockaddr
})
}

// SetsockoptICMPv6Filter wraps setsockopt(2) for *unix.ICMPv6Filter values.
func (c *Conn) SetsockoptICMPv6Filter(level, opt int, filter *unix.ICMPv6Filter) error {
return c.control(context.Background(), "setsockopt", func(fd int) error {
return unix.SetsockoptICMPv6Filter(fd, level, opt, filter)
})
}

// SetsockoptInt wraps setsockopt(2) for integer values.
func (c *Conn) SetsockoptInt(level, opt, value int) error {
return c.control(context.Background(), "setsockopt", func(fd int) error {
Expand Down

0 comments on commit 749bf3b

Please # to comment.