@@ -369,6 +369,49 @@ impl Socket {
369369 self . inner . set_ttl ( ttl)
370370 }
371371
372+ /// Gets the value of the `TCP_MAXSEG` option on this socket.
373+ ///
374+ /// The `TCP_MAXSEG` option denotes the TCP Maximum Segment
375+ /// Size and is only available on TCP sockets.
376+ #[ cfg( unix) ]
377+ pub fn mss ( & self ) -> io:: Result < u32 > {
378+ self . inner . mss ( )
379+ }
380+
381+ /// Sets the value of the `TCP_MAXSEG` option on this socket.
382+ ///
383+ /// The `TCP_MAXSEG` option denotes the TCP Maximum Segment
384+ /// Size and is only available on TCP sockets.
385+ #[ cfg( unix) ]
386+ pub fn set_mss ( & self , mss : u32 ) -> io:: Result < ( ) > {
387+ self . inner . set_mss ( mss)
388+ }
389+
390+ /// Gets the value for the `SO_MARK` option on this socket.
391+ ///
392+ /// This value gets the socket mark field for each packet sent through
393+ /// this socket.
394+ ///
395+ /// This function is only available on Linux and requires the
396+ /// `CAP_NET_ADMIN` capability.
397+ #[ cfg( target_os = "linux" ) ]
398+ pub fn mark ( & self ) -> io:: Result < u32 > {
399+ self . inner . mark ( )
400+ }
401+
402+ /// Sets the value for the `SO_MARK` option on this socket.
403+ ///
404+ /// This value sets the socket mark field for each packet sent through
405+ /// this socket. Changing the mark can be used for mark-based routing
406+ /// without netfilter or for packet filtering.
407+ ///
408+ /// This function is only available on Linux and requires the
409+ /// `CAP_NET_ADMIN` capability.
410+ #[ cfg( target_os = "linux" ) ]
411+ pub fn set_mark ( & self , mark : u32 ) -> io:: Result < ( ) > {
412+ self . inner . set_mark ( mark)
413+ }
414+
372415 /// Gets the value of the `IPV6_UNICAST_HOPS` option for this socket.
373416 ///
374417 /// Specifies the hop limit for ipv6 unicast packets
0 commit comments