@@ -17,7 +17,7 @@ use core::mem::{align_of, size_of, size_of_val, take};
17
17
use core:: ptr:: addr_of;
18
18
use core:: { ptr, slice} ;
19
19
20
- use super :: { RecvFlags , ReturnFlags , SendFlags , SocketAddrAny , SocketAddrV4 , SocketAddrV6 } ;
20
+ use super :: { RecvFlags , ReturnFlags , SendFlags , SocketAddrAny } ;
21
21
22
22
/// Macro for defining the amount of space to allocate in a buffer for use with
23
23
/// [`RecvAncillaryBuffer::new`] and [`SendAncillaryBuffer::new`].
@@ -122,8 +122,7 @@ pub const fn __cmsg_aligned_space(len: usize) -> usize {
122
122
unsafe { c:: CMSG_SPACE ( converted_len) as usize }
123
123
}
124
124
125
- /// Ancillary message for [`sendmsg`], [`sendmsg_v4`], [`sendmsg_v6`],
126
- /// [`sendmsg_unix`], and [`sendmsg_any`].
125
+ /// Ancillary message for [`sendmsg`] and [`sendmsg_addr`].
127
126
#[ non_exhaustive]
128
127
pub enum SendAncillaryMessage < ' slice , ' fd > {
129
128
/// Send file descriptors.
@@ -160,8 +159,7 @@ pub enum RecvAncillaryMessage<'a> {
160
159
ScmCredentials ( UCred ) ,
161
160
}
162
161
163
- /// Buffer for sending ancillary messages with [`sendmsg`], [`sendmsg_v4`],
164
- /// [`sendmsg_v6`], [`sendmsg_unix`], and [`sendmsg_any`].
162
+ /// Buffer for sending ancillary messages with [`sendmsg`] and [`sendmsg_addr`].
165
163
///
166
164
/// Use the [`push`] function to add messages to send.
167
165
///
@@ -596,8 +594,7 @@ impl FusedIterator for AncillaryDrain<'_> {}
596
594
/// `sendmsg(msghdr)`—Sends a message on a socket.
597
595
///
598
596
/// This function is for use on connected sockets, as it doesn't have
599
- /// a way to specify an address. See the [`sendmsg_v4`], [`sendmsg_v6`]
600
- /// [`sendmsg_unix`], [`sendmsg_xdp`], and [`sendmsg_any`] to send
597
+ /// a way to specify an address. See [`sendmsg_addr`] to send
601
598
/// messages on unconnected sockets.
602
599
///
603
600
/// # References
@@ -659,155 +656,6 @@ pub fn sendmsg_addr(
659
656
backend:: net:: syscalls:: sendmsg_addr ( socket. as_fd ( ) , addr, iov, control, flags)
660
657
}
661
658
662
- /// `sendmsg(msghdr)`—Sends a message on a socket to a specific IPv4 address.
663
- ///
664
- /// # References
665
- /// - [POSIX]
666
- /// - [Linux]
667
- /// - [Apple]
668
- /// - [FreeBSD]
669
- /// - [NetBSD]
670
- /// - [OpenBSD]
671
- /// - [DragonFly BSD]
672
- /// - [illumos]
673
- ///
674
- /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/sendmsg.html
675
- /// [Linux]: https://man7.org/linux/man-pages/man2/sendmsg.2.html
676
- /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendmsg.2.html
677
- /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendmsg&sektion=2
678
- /// [NetBSD]: https://man.netbsd.org/sendmsg.2
679
- /// [OpenBSD]: https://man.openbsd.org/sendmsg.2
680
- /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendmsg§ion=2
681
- /// [illumos]: https://illumos.org/man/3SOCKET/sendmsg
682
- #[ inline]
683
- pub fn sendmsg_v4 < Fd : AsFd > (
684
- socket : Fd ,
685
- addr : & SocketAddrV4 ,
686
- iov : & [ IoSlice < ' _ > ] ,
687
- control : & mut SendAncillaryBuffer < ' _ , ' _ , ' _ > ,
688
- flags : SendFlags ,
689
- ) -> io:: Result < usize > {
690
- backend:: net:: syscalls:: sendmsg_addr ( socket. as_fd ( ) , addr, iov, control, flags)
691
- }
692
-
693
- /// `sendmsg(msghdr)`—Sends a message on a socket to a specific IPv6 address.
694
- ///
695
- /// # References
696
- /// - [POSIX]
697
- /// - [Linux]
698
- /// - [Apple]
699
- /// - [FreeBSD]
700
- /// - [NetBSD]
701
- /// - [OpenBSD]
702
- /// - [DragonFly BSD]
703
- /// - [illumos]
704
- ///
705
- /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/sendmsg.html
706
- /// [Linux]: https://man7.org/linux/man-pages/man2/sendmsg.2.html
707
- /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendmsg.2.html
708
- /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendmsg&sektion=2
709
- /// [NetBSD]: https://man.netbsd.org/sendmsg.2
710
- /// [OpenBSD]: https://man.openbsd.org/sendmsg.2
711
- /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendmsg§ion=2
712
- /// [illumos]: https://illumos.org/man/3SOCKET/sendmsg
713
- #[ inline]
714
- pub fn sendmsg_v6 < Fd : AsFd > (
715
- socket : Fd ,
716
- addr : & SocketAddrV6 ,
717
- iov : & [ IoSlice < ' _ > ] ,
718
- control : & mut SendAncillaryBuffer < ' _ , ' _ , ' _ > ,
719
- flags : SendFlags ,
720
- ) -> io:: Result < usize > {
721
- backend:: net:: syscalls:: sendmsg_addr ( socket. as_fd ( ) , addr, iov, control, flags)
722
- }
723
-
724
- /// `sendmsg(msghdr)`—Sends a message on a socket to a specific Unix-domain
725
- /// address.
726
- ///
727
- /// # References
728
- /// - [POSIX]
729
- /// - [Linux]
730
- /// - [Apple]
731
- /// - [FreeBSD]
732
- /// - [NetBSD]
733
- /// - [OpenBSD]
734
- /// - [DragonFly BSD]
735
- /// - [illumos]
736
- ///
737
- /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/sendmsg.html
738
- /// [Linux]: https://man7.org/linux/man-pages/man2/sendmsg.2.html
739
- /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendmsg.2.html
740
- /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendmsg&sektion=2
741
- /// [NetBSD]: https://man.netbsd.org/sendmsg.2
742
- /// [OpenBSD]: https://man.openbsd.org/sendmsg.2
743
- /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendmsg§ion=2
744
- /// [illumos]: https://illumos.org/man/3SOCKET/sendmsg
745
- #[ inline]
746
- #[ cfg( unix) ]
747
- pub fn sendmsg_unix < Fd : AsFd > (
748
- socket : Fd ,
749
- addr : & super :: SocketAddrUnix ,
750
- iov : & [ IoSlice < ' _ > ] ,
751
- control : & mut SendAncillaryBuffer < ' _ , ' _ , ' _ > ,
752
- flags : SendFlags ,
753
- ) -> io:: Result < usize > {
754
- backend:: net:: syscalls:: sendmsg_addr ( socket. as_fd ( ) , addr, iov, control, flags)
755
- }
756
-
757
- /// `sendmsg(msghdr)`—Sends a message on a socket to a specific XDP address.
758
- ///
759
- /// # References
760
- /// - [Linux]
761
- ///
762
- /// [Linux]: https://man7.org/linux/man-pages/man2/sendmsg.2.html
763
- #[ inline]
764
- #[ cfg( target_os = "linux" ) ]
765
- pub fn sendmsg_xdp < Fd : AsFd > (
766
- socket : Fd ,
767
- addr : & super :: SocketAddrXdp ,
768
- iov : & [ IoSlice < ' _ > ] ,
769
- control : & mut SendAncillaryBuffer < ' _ , ' _ , ' _ > ,
770
- flags : SendFlags ,
771
- ) -> io:: Result < usize > {
772
- backend:: net:: syscalls:: sendmsg_addr ( socket. as_fd ( ) , addr, iov, control, flags)
773
- }
774
-
775
- /// `sendmsg(msghdr)`—Sends a message on a socket to a specific address.
776
- ///
777
- /// # References
778
- /// - [POSIX]
779
- /// - [Linux]
780
- /// - [Apple]
781
- /// - [FreeBSD]
782
- /// - [NetBSD]
783
- /// - [OpenBSD]
784
- /// - [DragonFly BSD]
785
- /// - [illumos]
786
- ///
787
- /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/sendmsg.html
788
- /// [Linux]: https://man7.org/linux/man-pages/man2/sendmsg.2.html
789
- /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendmsg.2.html
790
- /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendmsg&sektion=2
791
- /// [NetBSD]: https://man.netbsd.org/sendmsg.2
792
- /// [OpenBSD]: https://man.openbsd.org/sendmsg.2
793
- /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendmsg§ion=2
794
- /// [illumos]: https://illumos.org/man/3SOCKET/sendmsg
795
- #[ inline]
796
- pub fn sendmsg_any < Fd : AsFd > (
797
- socket : Fd ,
798
- addr : Option < & SocketAddrAny > ,
799
- iov : & [ IoSlice < ' _ > ] ,
800
- control : & mut SendAncillaryBuffer < ' _ , ' _ , ' _ > ,
801
- flags : SendFlags ,
802
- ) -> io:: Result < usize > {
803
- match addr {
804
- None => backend:: net:: syscalls:: sendmsg ( socket. as_fd ( ) , iov, control, flags) ,
805
- Some ( addr) => {
806
- backend:: net:: syscalls:: sendmsg_addr ( socket. as_fd ( ) , addr, iov, control, flags)
807
- }
808
- }
809
- }
810
-
811
659
/// `recvmsg(msghdr)`—Receives a message from a socket.
812
660
///
813
661
/// # References
0 commit comments