sync with OpenBSD -current

This commit is contained in:
purplerain 2024-04-16 02:31:24 +00:00
parent 9d8ac7f158
commit 382ecd9441
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
108 changed files with 9152 additions and 5077 deletions

View file

@ -750,6 +750,7 @@ readdir_r
readpassphrase
rewinddir
scandir
scandirat
seekdir
setclasscontext
setdomainname

View file

@ -1,5 +1,3 @@
__bswap16
__bswap32
__mcount
__multf3
_fpgetmask

View file

@ -1,7 +1,7 @@
# $OpenBSD: Makefile.inc,v 1.2 2020/07/06 13:33:05 pirofti Exp $
# $OpenBSD: Makefile.inc,v 1.3 2024/04/15 15:21:11 naddy Exp $
# $NetBSD: Makefile.inc,v 1.6 2003/08/01 17:03:47 lukem Exp $
SRCS+= byte_swap_2.S byte_swap_4.S fabs.c flt_rounds.c infinity.c
SRCS+= fabs.c flt_rounds.c infinity.c
SRCS+= ldexp.c modf.c nan.c
SRCS+= setjmp.S _setjmp.S sigsetjmp.S
SRCS+= clz_tab.c

View file

@ -1,48 +0,0 @@
/* $OpenBSD: byte_swap_2.S,v 1.3 2022/05/24 22:34:02 guenther Exp $ */
/* $NetBSD: byte_swap_2.S,v 1.3 2003/04/05 23:08:51 bjh21 Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Charles M. Hannum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "DEFS.h"
_ENTRY(__bswap16)
_ENTRY_NB(ntohs)
ENTRY_NB(htons)
RETGUARD_SETUP(__bswap16, x15)
and w8, w0, #0xffff
ubfx w0, w0, #8, #8
bfi w0, w8, #8, #16
RETGUARD_CHECK(__bswap16, x15)
ret
END(htons)
_END(ntohs)
_END(__bswap16)
.weak htons
.weak ntohs

View file

@ -1,46 +0,0 @@
/* $OpenBSD: byte_swap_4.S,v 1.3 2022/05/24 22:34:02 guenther Exp $ */
/* $NetBSD: byte_swap_4.S,v 1.2 2003/04/05 23:08:51 bjh21 Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Neil A. Carson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "DEFS.h"
_ENTRY(__bswap32)
_ENTRY_NB(ntohl)
ENTRY_NB(htonl)
RETGUARD_SETUP(__bswap32, x15)
rev w0, w0
RETGUARD_CHECK(__bswap32, x15)
ret
END(htonl)
_END(ntohl)
_END(__bswap32)
.weak htonl
.weak ntohl

View file

@ -1,4 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.4 1996/11/13 22:05:02 niklas Exp $
# $NetBSD: Makefile.inc,v 1.2 1996/04/17 22:36:42 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View file

@ -1,48 +0,0 @@
/* $OpenBSD: byte_swap_2.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: byte_swap_2.S,v 1.2 1996/10/17 03:08:08 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <machine/asm.h>
#ifndef NAME
#define NAME byte_swap_2
#endif
/*
* Byte-swap a 2-byte quantity. (Convert 0x0123 to 0x2301.)
*
* Argument is an unsigned 2-byte integer (u_int16_t).
*/
LEAF(NAME, 1) /* a0 contains 0x0123 */
extbl a0, 0, t0 /* t0 = 0x 23 */
extbl a0, 1, t1 /* t1 = 0x 01 */
sll t0, 8, t0 /* t1 = 0x23 */
or t0, t1, v0 /* v0 = 0x2301 */
RET
END(NAME)

View file

@ -1,54 +0,0 @@
/* $OpenBSD: byte_swap_4.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: byte_swap_4.S,v 1.2 1996/10/17 03:08:09 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <machine/asm.h>
#ifndef NAME
#define NAME byte_swap_4
#endif
/*
* Byte-swap a 4-byte quantity. (Convert 0x01234567 to 0x67452301.)
*
* Argument is an unsigned 4-byte integer (u_int32_t).
*/
LEAF(NAME, 1) /* a0 contains 0x01234567 */
extbl a0, 0, t0 /* t0 = 0x 67 */
extbl a0, 1, t1 /* t1 = 0x 45 */
extbl a0, 2, t2 /* t2 = 0x 23 */
extbl a0, 3, t3 /* t3 = 0x 01 */
sll t0, 24, t0 /* t0 = 0x67 */
sll t1, 16, t1 /* t1 = 0x 45 */
sll t2, 8, t2 /* t2 = 0x 23 */
or t3, t0, v0 /* v0 = 0x67 01 */
or t1, t2, t1 /* t1 = 0x 4523 */
or t1, v0, v0 /* v0 = 0x67452301 */
RET
END(NAME)

View file

@ -1,33 +0,0 @@
/* $OpenBSD: htonl.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: htonl.S,v 1.1 1996/04/17 22:36:52 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME htonl
#include "byte_swap_4.S"

View file

@ -1,33 +0,0 @@
/* $OpenBSD: htons.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: htons.S,v 1.1 1996/04/17 22:36:54 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME htons
#include "byte_swap_2.S"

View file

@ -1,33 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: ntohl.S,v 1.1 1996/04/17 22:36:57 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME ntohl
#include "byte_swap_4.S"

View file

@ -1,33 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: ntohs.S,v 1.1 1996/04/17 22:37:02 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME ntohs
#include "byte_swap_2.S"

View file

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.2 2012/09/04 03:10:42 okan Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View file

@ -1,13 +0,0 @@
/* $OpenBSD: htonl.S,v 1.3 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(htonl)
RETGUARD_SETUP(htonl, r11)
movl %edi,%eax
bswapl %eax
RETGUARD_CHECK(htonl, r11)
ret
END(htonl)

View file

@ -1,13 +0,0 @@
/* $OpenBSD: htons.S,v 1.4 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(htons)
RETGUARD_SETUP(htons, r11)
movl %edi,%eax
xchgb %ah,%al
RETGUARD_CHECK(htons, r11)
ret
END(htons)

View file

@ -1,13 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.4 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(ntohl)
RETGUARD_SETUP(ntohl, r11)
movl %edi,%eax
bswapl %eax
RETGUARD_CHECK(ntohl, r11)
ret
END(ntohl)

View file

@ -1,13 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.4 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(ntohs)
RETGUARD_SETUP(ntohs, r11)
movl %edi,%eax
xchgb %ah,%al
RETGUARD_CHECK(ntohs, r11)
ret
END(ntohs)

View file

@ -1,7 +1,5 @@
__adddf3
__addsf3
__bswap16
__bswap32
__divdf3
__divsf3
__divsi3

View file

@ -1,6 +1,6 @@
# $OpenBSD: Makefile.inc,v 1.16 2020/07/06 13:33:05 pirofti Exp $
# $OpenBSD: Makefile.inc,v 1.17 2024/04/15 15:21:11 naddy Exp $
# $NetBSD: Makefile.inc,v 1.6 2003/08/01 17:03:47 lukem Exp $
SRCS+= byte_swap_2.S byte_swap_4.S divsi3.S fabs.c flt_rounds.c infinity.c
SRCS+= divsi3.S fabs.c flt_rounds.c infinity.c
SRCS+= ldexp.c modf.c nan.c usertc.c
SRCS+= setjmp.S _setjmp.S sigsetjmp.S

View file

@ -1,47 +0,0 @@
/* $OpenBSD: byte_swap_4.S,v 1.4 2022/05/24 17:15:23 guenther Exp $ */
/* $NetBSD: byte_swap_4.S,v 1.2 2003/04/05 23:08:51 bjh21 Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Neil A. Carson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "DEFS.h"
_ENTRY(__bswap32)
_ENTRY_NB(ntohl)
ENTRY_NB(htonl)
eor r1, r0, r0, ror #16
bic r1, r1, #0x00FF0000
mov r0, r0, ror #8
eor r0, r0, r1, lsr #8
mov pc, lr
END(htonl)
_END(ntohl)
_END(__bswap32)
.weak htonl
.weak ntohl

View file

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.2 2004/10/26 04:49:58 mickey Exp $
SRCS+= ntohl.c ntohs.c htons.c htonl.c

View file

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.4 2012/09/04 03:10:42 okan Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View file

@ -1,41 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/* netorder = htonl(hostorder) */
ENTRY(htonl)
movl 4(%esp),%eax
rorw $8,%ax
roll $16,%eax
rorw $8,%ax
ret

View file

@ -1,39 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/* netorder = htons(hostorder) */
ENTRY(htons)
movzwl 4(%esp),%eax
rorw $8,%ax
ret

View file

@ -1,41 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
movl 4(%esp),%eax
rorw $8,%ax
roll $16,%eax
rorw $8,%ax
ret

View file

@ -1,39 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
movzwl 4(%esp),%eax
rorw $8,%ax
ret

View file

@ -1,3 +0,0 @@
# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:58:55 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View file

@ -1,42 +0,0 @@
/* $OpenBSD: htonl.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "DEFS.h"
/* netorder = htonl(hostorder) */
ENTRY(htonl)
jmp %r1
END(htonl)

View file

@ -1,43 +0,0 @@
/* $OpenBSD: htons.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "DEFS.h"
/* hostorder = htons(netorder) */
ENTRY(htons)
jmp.n %r1
clr %r2,%r2,16<16> /* clear the top 16 bits */
END(htons)

View file

@ -1,42 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "DEFS.h"
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
jmp %r1
END(ntohl)

View file

@ -1,43 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "DEFS.h"
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
jmp.n %r1
clr %r2,%r2,16<16> /* clear the top 16 bits */
END(ntohs)

View file

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.2 2012/09/04 03:10:42 okan Exp $
SRCS+= htonl.S htons.S

View file

@ -1,60 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/*
* netorder = htonl(hostorder)
* hostorder = ntohl(netorder)
*/
ALEAF(ntohl)
NLEAF(htonl, 0) # a0 = 0x11223344, return 0x44332211
.set reorder
#ifdef __MIPSEL__
srl v1, a0, 24 # v1 = 0x00000011
sll v0, a0, 24 # v0 = 0x44000000
or v0, v0, v1
and v1, a0, 0xff00
sll v1, v1, 8 # v1 = 0x00330000
or v0, v0, v1
srl v1, a0, 8
and v1, v1, 0xff00 # v1 = 0x00002200
or v0, v0, v1
#else
#ifdef __MIPSEB__
move v0, a0
#else
ERROR
#endif
#endif
j ra
END(htonl)

View file

@ -1,56 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/*
* netorder = htons(hostorder)
* hostorder = ntohs(netorder)
*/
ALEAF(ntohs)
NLEAF(htons, 0)
.set reorder
#ifdef __MIPSEL__
srl v0, a0, 8
and v0, v0, 0xff
sll v1, a0, 8
and v1, v1, 0xff00
or v0, v0, v1
#else
#ifdef __MIPSEB__
move v0, a0
#else
ERROR
#endif
#endif
j ra
END(htons)

View file

@ -1 +0,0 @@
SRCS += ntohl.c ntohs.c htons.c htonl.c

View file

@ -1 +0,0 @@
SRCS += ntohl.c ntohs.c htons.c htonl.c

View file

@ -1 +0,0 @@
SRCS += ntohl.c ntohs.c htons.c htonl.c

View file

@ -1,4 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $
# $NetBSD: Makefile.inc,v 1.1 2000/01/05 14:07:36 msaitoh Exp $
SRCS+= htonl.c htons.c ntohl.c ntohs.c

View file

@ -1,58 +0,0 @@
/* $OpenBSD: htonl.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: htonl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)htonl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef htonl
/* hostorder = htonl(netorder) */
u_int32_t
htonl(x)
u_int32_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_int32_t y = 0;
__asm("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (y));
return y;
#else
return x;
#endif
}

View file

@ -1,52 +0,0 @@
/* $OpenBSD: htons.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: htons.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)htonl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef htons
/* netorder = htons(hostorder) */
u_int16_t
htons(x)
u_int16_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
__asm("swap.b %1, %0" : "=r" (x) : "r" (x));
#endif
return x;
}

View file

@ -1,58 +0,0 @@
/* $OpenBSD: ntohl.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: ntohl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)ntohl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef ntohl
/* netorder = ntohl(hostorder) */
u_int32_t
ntohl(x)
u_int32_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_int32_t y = 0;
__asm("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (y));
return y;
#else
return x;
#endif
}

View file

@ -1,52 +0,0 @@
/* $OpenBSD: ntohs.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: ntohs.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)ntohl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef ntohs
/* hostorder = ntohs(netorder) */
u_int16_t
ntohs(x)
u_int16_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
__asm("swap.b %1, %0" : "=r" (x) : "r" (x));
#endif
return x;
}

View file

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.1 2001/08/28 22:06:44 art Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View file

@ -1,45 +0,0 @@
/* $OpenBSD: htonl.S,v 1.2 2003/06/02 20:18:32 millert Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: Header: htonl.s,v 1.1 92/06/25 12:47:05 torek Exp
*/
#include <machine/asm.h>
/* netorder = htonl(hostorder) */
ENTRY(htonl)
retl
srl %o0, 0, %o0 /* zero extend -- or do we sign extend? */

View file

@ -1,45 +0,0 @@
/* $OpenBSD: htons.S,v 1.2 2003/06/02 20:18:32 millert Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: Header: htons.s,v 1.1 92/06/25 12:47:05 torek Exp
*/
#include <machine/asm.h>
/* netorder = htons(hostorder) */
ENTRY(htons)
sethi %hi(0xffff0000), %o1
signx %o1, %o1
retl
andn %o0, %o1, %o0

View file

@ -1,43 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.2 2003/06/02 20:18:32 millert Exp $ */
/* $NetBSD: ntohl.S,v 1.1 1998/09/11 04:56:31 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: Header: ntohl.s,v 1.1 92/06/25 12:47:06 torek Exp
*/
#include <machine/asm.h>
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
retl
signx %o0, %o0

View file

@ -1,48 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.3 2009/10/28 06:49:55 deraadt Exp $ */
/* $NetBSD: ntohs.S,v 1.1 1998/09/11 04:56:31 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: Header: ntohs.s,v 1.1 92/06/25 12:47:07 torek Exp
*/
#include <machine/asm.h>
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
sethi %hi(0xffff0000), %o1
signx %o1, %o1
retl
andn %o0, %o1, %o0

View file

@ -1,4 +1,4 @@
/* $OpenBSD: opendir.c,v 1.30 2016/09/21 04:38:56 guenther Exp $ */
/* $OpenBSD: opendir.c,v 1.31 2024/04/15 15:47:58 florian Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@ -39,7 +39,6 @@
#include "telldir.h"
static DIR *__fdopendir(int fd);
/*
* Open a directory specified by name.
@ -89,7 +88,7 @@ fdopendir(int fd)
}
DEF_WEAK(fdopendir);
static DIR *
DIR *
__fdopendir(int fd)
{
DIR *dirp;

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: scandir.3,v 1.16 2021/06/17 18:18:15 jmc Exp $
.\" $OpenBSD: scandir.3,v 1.17 2024/04/15 15:47:58 florian Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -27,11 +27,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: June 17 2021 $
.Dd $Mdocdate: April 15 2024 $
.Dt SCANDIR 3
.Os
.Sh NAME
.Nm scandir ,
.Nm scandirat ,
.Nm alphasort
.Nd scan a directory
.Sh SYNOPSIS
@ -45,6 +46,14 @@
.Fa "int (*compar)(const struct dirent **, const struct dirent **)"
.Fc
.Ft int
.Fo scandirat
.Fa "int dirfd"
.Fa "const char *dirname"
.Fa "struct dirent ***namelist"
.Fa "int (*select)(const struct dirent *)"
.Fa "int (*compar)(const struct dirent **, const struct dirent **)"
.Fc
.Ft int
.Fn alphasort "const struct dirent **d1" "const struct dirent **d2"
.Sh DESCRIPTION
The
@ -91,6 +100,30 @@ parameter to sort the array alphabetically.
The memory allocated for the array can be deallocated with
.Xr free 3 ,
by freeing each pointer in the array and then the array itself.
.Pp
The
.Fn scandirat
function is similar to
.Fn scandir ,
but takes an additional
.Fa dirfd
argument.
If
.Fa dirname
is relative,
.Fa dirfd
must be a valid file descriptor referencing a directory, in which case the
.Fa dirname
lookup is performed relative to the directory referenced by
.Fa dirfd .
If
.Fa dirfd
has the special value
.Va AT_FDCWD ,
then the current process directory is used as the base for relative lookups.
See
.Xr openat 2
for additional details.
.Sh DIAGNOSTICS
Returns \-1 if the directory cannot be opened for reading or if
.Xr malloc 3

View file

@ -1,4 +1,4 @@
/* $OpenBSD: scandir.c,v 1.22 2024/04/14 11:21:08 florian Exp $ */
/* $OpenBSD: scandir.c,v 1.23 2024/04/15 15:47:58 florian Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@ -39,9 +39,11 @@
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "telldir.h"
#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
@ -57,8 +59,8 @@
((sizeof(struct dirent) - sizeof(dp)->d_name) + \
(((dp)->d_namlen + 1 + 3) &~ 3))
int
scandir(const char *dirname, struct dirent ***namelist,
static int
scandir_dirp(DIR *dirp, struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **))
{
@ -66,10 +68,7 @@ scandir(const char *dirname, struct dirent ***namelist,
size_t nitems = 0;
struct stat stb;
long arraysz;
DIR *dirp;
if ((dirp = opendir(dirname)) == NULL)
return (-1);
if (fstat(dirp->dd_fd, &stb) == -1)
goto fail;
@ -140,6 +139,38 @@ fail:
return (-1);
}
int
scandir(const char *dirname, struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **))
{
DIR *dirp;
if ((dirp = opendir(dirname)) == NULL)
return (-1);
return (scandir_dirp(dirp, namelist, select, dcomp));
}
int
scandirat(int dirfd, const char *dirname, struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **))
{
DIR *dirp;
int fd;
fd = HIDDEN(openat)(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
if (fd == -1)
return (-1);
dirp = __fdopendir(fd);
if (dirp == NULL) {
HIDDEN(close)(fd);
return (-1);
}
return (scandir_dirp(dirp, namelist, select, dcomp));
}
/*
* Alphabetic order comparison routine for those who want it.
*/

View file

@ -1,4 +1,4 @@
/* $OpenBSD: dirent.h,v 1.1 2015/09/12 13:34:22 guenther Exp $ */
/* $OpenBSD: dirent.h,v 1.2 2024/04/15 15:47:58 florian Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@ -20,6 +20,10 @@
#include_next <dirent.h>
__BEGIN_HIDDEN_DECLS
DIR *__fdopendir(int fd);
__END_HIDDEN_DECLS
PROTO_DEPRECATED(alphasort);
PROTO_NORMAL(closedir);
PROTO_NORMAL(dirfd);
@ -30,6 +34,7 @@ PROTO_NORMAL(readdir);
PROTO_DEPRECATED(readdir_r);
PROTO_DEPRECATED(rewinddir);
PROTO_DEPRECATED(scandir);
PROTO_DEPRECATED(scandirat);
PROTO_NORMAL(seekdir);
PROTO_NORMAL(telldir);

View file

@ -1,7 +1,7 @@
# $OpenBSD: Makefile.inc,v 1.60 2019/08/30 18:33:17 deraadt Exp $
# $OpenBSD: Makefile.inc,v 1.61 2024/04/15 14:30:48 naddy Exp $
# net sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/net ${LIBCSRCDIR}/net
.PATH: ${LIBCSRCDIR}/net
CFLAGS+=-DRESOLVSORT
@ -10,10 +10,11 @@ SRCS+= base64.c ethers.c freeaddrinfo.c \
getifaddrs.c getnameinfo.c getnetent.c \
getnetnamadr.c getpeereid.c getproto.c getprotoent.c getprotoname.c \
getservbyname.c getservbyport.c getservent.c getrrsetbyname.c \
herror.c if_indextoname.c if_nameindex.c if_nametoindex.c inet_addr.c \
herror.c htonl.c htons.c \
if_indextoname.c if_nameindex.c if_nametoindex.c inet_addr.c \
inet_lnaof.c inet_makeaddr.c inet_neta.c inet_netof.c inet_network.c \
inet_net_ntop.c inet_net_pton.c inet_ntoa.c inet_ntop.c inet_pton.c \
linkaddr.c rcmd.c rcmdsh.c ruserok.c \
linkaddr.c ntohl.c ntohs.c rcmd.c rcmdsh.c ruserok.c \
rresvport.c recv.c res_comp.c res_data.c \
res_debug.c res_debug_syms.c res_init.c res_mkquery.c res_query.c \
res_random.c res_send.c \
@ -22,12 +23,6 @@ SRCS+= base64.c ethers.c freeaddrinfo.c \
# IPv6
SRCS+= ip6opt.c rthdr.c vars6.c
# machine-dependent net sources
# m-d Makefile.inc must include sources for:
# htonl() htons() ntohl() ntohs()
.include "${LIBCSRCDIR}/arch/${MACHINE_CPU}/net/Makefile.inc"
MAN+= htobe64.3 ether_aton.3 gai_strerror.3 getaddrinfo.3 gethostbyname.3 \
getifaddrs.3 getnameinfo.3 getnetent.3 getpeereid.3 getprotoent.3 \
getrrsetbyname.3 getservent.3 htonl.3 if_indextoname.3 \

View file

@ -1,6 +1,5 @@
/* $OpenBSD: htonl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: htonl.c,v 1.8 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef htonl
u_int32_t
htonl(u_int32_t x)
uint32_t
htonl(uint32_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *)&x;
return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
#else
return x;
#endif
return htobe32(x);
}

View file

@ -1,6 +1,5 @@
/* $OpenBSD: htons.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: htons.c,v 1.10 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef htons
u_int16_t
htons(u_int16_t x)
uint16_t
htons(uint16_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *) &x;
return (u_int16_t)(s[0] << 8 | s[1]);
#else
return x;
#endif
return htobe16(x);
}

View file

@ -1,6 +1,5 @@
/* $OpenBSD: ntohl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: ntohl.c,v 1.8 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef ntohl
u_int32_t
ntohl(u_int32_t x)
uint32_t
ntohl(uint32_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *)&x;
return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
#else
return x;
#endif
return be32toh(x);
}

View file

@ -1,6 +1,5 @@
/* $OpenBSD: ntohs.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: ntohs.c,v 1.10 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef ntohs
u_int16_t
ntohs(u_int16_t x)
uint16_t
ntohs(uint16_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *) &x;
return (u_int16_t)(s[0] << 8 | s[1]);
#else
return x;
#endif
return be16toh(x);
}

View file

@ -1,4 +1,4 @@
major=99
major=100
minor=0
# note: If changes were made to include/thread_private.h or if system calls
# were added/changed then librthread/shlib_version must also be updated.

View file

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.192 2024/03/29 07:36:38 jsing Exp $
# $OpenBSD: Makefile,v 1.193 2024/04/15 15:55:01 tb Exp $
LIB= crypto
LIBREBUILD=y
@ -69,7 +69,6 @@ SRCS+= malloc-wrapper.c
SRCS+= mem_clr.c
SRCS+= mem_dbg.c
SRCS+= o_fips.c
SRCS+= o_str.c
# aes/
SRCS+= aes.c

View file

@ -197,7 +197,6 @@ ASN1_put_eoc
ASN1_put_object
ASN1_tag2bit
ASN1_tag2str
ASN1_time_tm_clamp_notafter
ASRange_free
ASRange_it
ASRange_new
@ -218,8 +217,6 @@ BF_encrypt
BF_ofb64_encrypt
BF_set_key
BIGNUM_it
BIO_CONNECT_free
BIO_CONNECT_new
BIO_accept
BIO_callback_ctrl
BIO_clear_flags
@ -803,7 +800,6 @@ DH_size
DH_test_flags
DH_up_ref
DHparams_dup
DHparams_it
DHparams_print
DHparams_print_fp
DIRECTORYSTRING_free
@ -824,7 +820,6 @@ DSAPublicKey_it
DSA_OpenSSL
DSA_SIG_free
DSA_SIG_get0
DSA_SIG_it
DSA_SIG_new
DSA_SIG_set0
DSA_bits
@ -880,7 +875,6 @@ ECDSA_SIG_free
ECDSA_SIG_get0
ECDSA_SIG_get0_r
ECDSA_SIG_get0_s
ECDSA_SIG_it
ECDSA_SIG_new
ECDSA_SIG_set0
ECDSA_do_sign
@ -888,12 +882,6 @@ ECDSA_do_verify
ECDSA_sign
ECDSA_size
ECDSA_verify
ECPARAMETERS_free
ECPARAMETERS_it
ECPARAMETERS_new
ECPKPARAMETERS_free
ECPKPARAMETERS_it
ECPKPARAMETERS_new
ECPKParameters_print
ECPKParameters_print_fp
ECParameters_dup
@ -1012,9 +1000,6 @@ EC_POINT_set_compressed_coordinates_GFp
EC_POINT_set_to_infinity
EC_POINTs_make_affine
EC_POINTs_mul
EC_PRIVATEKEY_free
EC_PRIVATEKEY_it
EC_PRIVATEKEY_new
EC_curve_nid2nist
EC_curve_nist2nid
EC_get_builtin_curves
@ -1100,15 +1085,12 @@ ERR_set_mark
ERR_unload_strings
ESS_CERT_ID_dup
ESS_CERT_ID_free
ESS_CERT_ID_it
ESS_CERT_ID_new
ESS_ISSUER_SERIAL_dup
ESS_ISSUER_SERIAL_free
ESS_ISSUER_SERIAL_it
ESS_ISSUER_SERIAL_new
ESS_SIGNING_CERT_dup
ESS_SIGNING_CERT_free
ESS_SIGNING_CERT_it
ESS_SIGNING_CERT_new
EVP_AEAD_CTX_cleanup
EVP_AEAD_CTX_free
@ -1725,8 +1707,6 @@ OPENSSL_init_crypto
OPENSSL_load_builtin_modules
OPENSSL_no_config
OPENSSL_posix_to_tm
OPENSSL_strcasecmp
OPENSSL_strncasecmp
OPENSSL_timegm
OPENSSL_tm_to_posix
OPENSSL_uni2asc
@ -2197,7 +2177,6 @@ TS_ACCURACY_free
TS_ACCURACY_get_micros
TS_ACCURACY_get_millis
TS_ACCURACY_get_seconds
TS_ACCURACY_it
TS_ACCURACY_new
TS_ACCURACY_set_micros
TS_ACCURACY_set_millis
@ -2223,7 +2202,6 @@ TS_MSG_IMPRINT_dup
TS_MSG_IMPRINT_free
TS_MSG_IMPRINT_get_algo
TS_MSG_IMPRINT_get_msg
TS_MSG_IMPRINT_it
TS_MSG_IMPRINT_new
TS_MSG_IMPRINT_print_bio
TS_MSG_IMPRINT_set_algo
@ -2246,7 +2224,6 @@ TS_REQ_get_msg_imprint
TS_REQ_get_nonce
TS_REQ_get_policy_id
TS_REQ_get_version
TS_REQ_it
TS_REQ_new
TS_REQ_print_bio
TS_REQ_set_cert_req
@ -2280,7 +2257,6 @@ TS_RESP_free
TS_RESP_get_status_info
TS_RESP_get_token
TS_RESP_get_tst_info
TS_RESP_it
TS_RESP_new
TS_RESP_print_bio
TS_RESP_set_status_info
@ -2293,7 +2269,6 @@ TS_STATUS_INFO_free
TS_STATUS_INFO_get0_failure_info
TS_STATUS_INFO_get0_status
TS_STATUS_INFO_get0_text
TS_STATUS_INFO_it
TS_STATUS_INFO_new
TS_STATUS_INFO_print_bio
TS_STATUS_INFO_set_status
@ -2318,7 +2293,6 @@ TS_TST_INFO_get_serial
TS_TST_INFO_get_time
TS_TST_INFO_get_tsa
TS_TST_INFO_get_version
TS_TST_INFO_it
TS_TST_INFO_new
TS_TST_INFO_print_bio
TS_TST_INFO_set_accuracy
@ -2540,7 +2514,6 @@ X509_LOOKUP_file
X509_LOOKUP_free
X509_LOOKUP_hash_dir
X509_LOOKUP_mem
X509_NAME_ENTRIES_it
X509_NAME_ENTRY_create_by_NID
X509_NAME_ENTRY_create_by_OBJ
X509_NAME_ENTRY_create_by_txt
@ -2553,7 +2526,6 @@ X509_NAME_ENTRY_new
X509_NAME_ENTRY_set
X509_NAME_ENTRY_set_data
X509_NAME_ENTRY_set_object
X509_NAME_INTERNAL_it
X509_NAME_add_entry
X509_NAME_add_entry_by_NID
X509_NAME_add_entry_by_OBJ
@ -2923,14 +2895,6 @@ X509v3_get_ext_by_NID
X509v3_get_ext_by_OBJ
X509v3_get_ext_by_critical
X509v3_get_ext_count
X9_62_CHARACTERISTIC_TWO_free
X9_62_CHARACTERISTIC_TWO_it
X9_62_CHARACTERISTIC_TWO_new
X9_62_CURVE_it
X9_62_FIELDID_it
X9_62_PENTANOMIAL_free
X9_62_PENTANOMIAL_it
X9_62_PENTANOMIAL_new
ZLONG_it
_CONF_add_string
_CONF_free_data
@ -3007,13 +2971,11 @@ d2i_DSAparams
d2i_DSAparams_bio
d2i_DSAparams_fp
d2i_ECDSA_SIG
d2i_ECPKPARAMETERS
d2i_ECPKParameters
d2i_ECParameters
d2i_ECPrivateKey
d2i_ECPrivateKey_bio
d2i_ECPrivateKey_fp
d2i_EC_PRIVATEKEY
d2i_EC_PUBKEY
d2i_EC_PUBKEY_bio
d2i_EC_PUBKEY_fp
@ -3197,13 +3159,11 @@ i2d_DSAparams
i2d_DSAparams_bio
i2d_DSAparams_fp
i2d_ECDSA_SIG
i2d_ECPKPARAMETERS
i2d_ECPKParameters
i2d_ECParameters
i2d_ECPrivateKey
i2d_ECPrivateKey_bio
i2d_ECPrivateKey_fp
i2d_EC_PRIVATEKEY
i2d_EC_PUBKEY
i2d_EC_PUBKEY_bio
i2d_EC_PUBKEY_fp

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x_name.c,v 1.42 2024/04/09 13:55:02 beck Exp $ */
/* $OpenBSD: x_name.c,v 1.43 2024/04/15 15:52:01 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -159,7 +159,7 @@ static const ASN1_TEMPLATE X509_NAME_ENTRIES_item_tt = {
.item = &X509_NAME_ENTRY_it,
};
const ASN1_ITEM X509_NAME_ENTRIES_it = {
static const ASN1_ITEM X509_NAME_ENTRIES_it = {
.itype = ASN1_ITYPE_PRIMITIVE,
.utype = -1,
.templates = &X509_NAME_ENTRIES_item_tt,
@ -177,7 +177,7 @@ static const ASN1_TEMPLATE X509_NAME_INTERNAL_item_tt = {
.item = &X509_NAME_ENTRIES_it,
};
const ASN1_ITEM X509_NAME_INTERNAL_it = {
static const ASN1_ITEM X509_NAME_INTERNAL_it = {
.itype = ASN1_ITYPE_PRIMITIVE,
.utype = -1,
.templates = &X509_NAME_INTERNAL_item_tt,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bss_conn.c,v 1.39 2023/07/07 19:37:53 beck Exp $ */
/* $OpenBSD: bss_conn.c,v 1.40 2024/04/15 15:40:08 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -105,8 +105,8 @@ static long conn_callback_ctrl(BIO *h, int cmd, BIO_info_cb *);
static int conn_state(BIO *b, BIO_CONNECT *c);
static void conn_close_socket(BIO *data);
BIO_CONNECT *BIO_CONNECT_new(void);
void BIO_CONNECT_free(BIO_CONNECT *a);
static BIO_CONNECT *BIO_CONNECT_new(void);
static void BIO_CONNECT_free(BIO_CONNECT *a);
static const BIO_METHOD methods_connectp = {
.type = BIO_TYPE_CONNECT,
@ -289,7 +289,7 @@ end:
return (ret);
}
BIO_CONNECT *
static BIO_CONNECT *
BIO_CONNECT_new(void)
{
BIO_CONNECT *ret;
@ -310,7 +310,7 @@ BIO_CONNECT_new(void)
return (ret);
}
void
static void
BIO_CONNECT_free(BIO_CONNECT *a)
{
if (a == NULL)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bn_lib.c,v 1.90 2023/07/28 10:35:14 tb Exp $ */
/* $OpenBSD: bn_lib.c,v 1.91 2024/04/15 14:35:25 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -438,6 +438,9 @@ BN_clear_bit(BIGNUM *a, int n)
a->d[i] &= (~(((BN_ULONG)1) << j));
bn_correct_top(a);
BN_set_negative(a, a->neg);
return (1);
}
LCRYPTO_ALIAS(BN_clear_bit);
@ -476,6 +479,9 @@ BN_mask_bits(BIGNUM *a, int n)
a->d[w] &= ~(BN_MASK2 << b);
}
bn_correct_top(a);
BN_set_negative(a, a->neg);
return (1);
}
LCRYPTO_ALIAS(BN_mask_bits);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: dh_asn1.c,v 1.12 2023/07/08 15:29:03 beck Exp $ */
/* $OpenBSD: dh_asn1.c,v 1.13 2024/04/15 15:47:37 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@ -114,7 +114,7 @@ static const ASN1_TEMPLATE DHparams_seq_tt[] = {
},
};
const ASN1_ITEM DHparams_it = {
static const ASN1_ITEM DHparams_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = DHparams_seq_tt,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: dsa_asn1.c,v 1.31 2023/07/08 14:28:15 beck Exp $ */
/* $OpenBSD: dsa_asn1.c,v 1.32 2024/04/15 15:49:37 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@ -109,7 +109,7 @@ static const ASN1_TEMPLATE DSA_SIG_seq_tt[] = {
},
};
const ASN1_ITEM DSA_SIG_it = {
static const ASN1_ITEM DSA_SIG_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = DSA_SIG_seq_tt,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ec.h,v 1.47 2024/04/10 15:01:31 beck Exp $ */
/* $OpenBSD: ec.h,v 1.48 2024/04/15 15:42:23 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@ -237,8 +237,6 @@ int EC_GROUP_get_basis_type(const EC_GROUP *);
#define OPENSSL_EC_EXPLICIT_CURVE 0x000
#define OPENSSL_EC_NAMED_CURVE 0x001
typedef struct ecpk_parameters_st ECPKPARAMETERS;
EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ec_asn1.c,v 1.48 2023/07/07 19:37:53 beck Exp $ */
/* $OpenBSD: ec_asn1.c,v 1.52 2024/04/15 15:46:29 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@ -125,14 +125,14 @@ typedef struct ec_parameters_st {
ASN1_INTEGER *cofactor;
} ECPARAMETERS;
struct ecpk_parameters_st {
typedef struct ecpk_parameters_st {
int type;
union {
ASN1_OBJECT *named_curve;
ECPARAMETERS *parameters;
ASN1_NULL *implicitlyCA;
} value;
} /* ECPKPARAMETERS */ ;
} ECPKPARAMETERS;
/* SEC1 ECPrivateKey */
typedef struct ec_privatekey_st {
@ -167,7 +167,7 @@ static const ASN1_TEMPLATE X9_62_PENTANOMIAL_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_PENTANOMIAL_it = {
static const ASN1_ITEM X9_62_PENTANOMIAL_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_PENTANOMIAL_seq_tt,
@ -177,21 +177,6 @@ const ASN1_ITEM X9_62_PENTANOMIAL_it = {
.sname = "X9_62_PENTANOMIAL",
};
X9_62_PENTANOMIAL *X9_62_PENTANOMIAL_new(void);
void X9_62_PENTANOMIAL_free(X9_62_PENTANOMIAL *a);
X9_62_PENTANOMIAL *
X9_62_PENTANOMIAL_new(void)
{
return (X9_62_PENTANOMIAL*)ASN1_item_new(&X9_62_PENTANOMIAL_it);
}
void
X9_62_PENTANOMIAL_free(X9_62_PENTANOMIAL *a)
{
ASN1_item_free((ASN1_VALUE *)a, &X9_62_PENTANOMIAL_it);
}
static const ASN1_TEMPLATE char_two_def_tt = {
.flags = 0,
.tag = 0,
@ -267,7 +252,7 @@ static const ASN1_TEMPLATE X9_62_CHARACTERISTIC_TWO_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_CHARACTERISTIC_TWO_it = {
static const ASN1_ITEM X9_62_CHARACTERISTIC_TWO_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_CHARACTERISTIC_TWO_seq_tt,
@ -277,21 +262,6 @@ const ASN1_ITEM X9_62_CHARACTERISTIC_TWO_it = {
.sname = "X9_62_CHARACTERISTIC_TWO",
};
X9_62_CHARACTERISTIC_TWO *X9_62_CHARACTERISTIC_TWO_new(void);
void X9_62_CHARACTERISTIC_TWO_free(X9_62_CHARACTERISTIC_TWO *a);
X9_62_CHARACTERISTIC_TWO *
X9_62_CHARACTERISTIC_TWO_new(void)
{
return (X9_62_CHARACTERISTIC_TWO*)ASN1_item_new(&X9_62_CHARACTERISTIC_TWO_it);
}
void
X9_62_CHARACTERISTIC_TWO_free(X9_62_CHARACTERISTIC_TWO *a)
{
ASN1_item_free((ASN1_VALUE *)a, &X9_62_CHARACTERISTIC_TWO_it);
}
static const ASN1_TEMPLATE fieldID_def_tt = {
.flags = 0,
.tag = 0,
@ -349,7 +319,7 @@ static const ASN1_TEMPLATE X9_62_FIELDID_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_FIELDID_it = {
static const ASN1_ITEM X9_62_FIELDID_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_FIELDID_seq_tt,
@ -383,7 +353,7 @@ static const ASN1_TEMPLATE X9_62_CURVE_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_CURVE_it = {
static const ASN1_ITEM X9_62_CURVE_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_CURVE_seq_tt,
@ -448,16 +418,16 @@ const ASN1_ITEM ECPARAMETERS_it = {
.sname = "ECPARAMETERS",
};
ECPARAMETERS *ECPARAMETERS_new(void);
void ECPARAMETERS_free(ECPARAMETERS *a);
static ECPARAMETERS *ECPARAMETERS_new(void);
static void ECPARAMETERS_free(ECPARAMETERS *a);
ECPARAMETERS *
static ECPARAMETERS *
ECPARAMETERS_new(void)
{
return (ECPARAMETERS*)ASN1_item_new(&ECPARAMETERS_it);
}
void
static void
ECPARAMETERS_free(ECPARAMETERS *a)
{
ASN1_item_free((ASN1_VALUE *)a, &ECPARAMETERS_it);
@ -497,31 +467,31 @@ const ASN1_ITEM ECPKPARAMETERS_it = {
.sname = "ECPKPARAMETERS",
};
ECPKPARAMETERS *ECPKPARAMETERS_new(void);
void ECPKPARAMETERS_free(ECPKPARAMETERS *a);
ECPKPARAMETERS *d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len);
int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out);
static ECPKPARAMETERS *ECPKPARAMETERS_new(void);
static void ECPKPARAMETERS_free(ECPKPARAMETERS *a);
static ECPKPARAMETERS *d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len);
static int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out);
ECPKPARAMETERS *
static ECPKPARAMETERS *
d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len)
{
return (ECPKPARAMETERS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ECPKPARAMETERS_it);
}
int
static int
i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out)
{
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ECPKPARAMETERS_it);
}
ECPKPARAMETERS *
static ECPKPARAMETERS *
ECPKPARAMETERS_new(void)
{
return (ECPKPARAMETERS *)ASN1_item_new(&ECPKPARAMETERS_it);
}
void
static void
ECPKPARAMETERS_free(ECPKPARAMETERS *a)
{
ASN1_item_free((ASN1_VALUE *)a, &ECPKPARAMETERS_it);
@ -558,7 +528,7 @@ static const ASN1_TEMPLATE EC_PRIVATEKEY_seq_tt[] = {
},
};
const ASN1_ITEM EC_PRIVATEKEY_it = {
static const ASN1_ITEM EC_PRIVATEKEY_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = EC_PRIVATEKEY_seq_tt,
@ -568,31 +538,31 @@ const ASN1_ITEM EC_PRIVATEKEY_it = {
.sname = "EC_PRIVATEKEY",
};
EC_PRIVATEKEY *EC_PRIVATEKEY_new(void);
void EC_PRIVATEKEY_free(EC_PRIVATEKEY *a);
EC_PRIVATEKEY *d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len);
int i2d_EC_PRIVATEKEY(const EC_PRIVATEKEY *a, unsigned char **out);
static EC_PRIVATEKEY *EC_PRIVATEKEY_new(void);
static void EC_PRIVATEKEY_free(EC_PRIVATEKEY *a);
static EC_PRIVATEKEY *d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len);
static int i2d_EC_PRIVATEKEY(const EC_PRIVATEKEY *a, unsigned char **out);
EC_PRIVATEKEY *
static EC_PRIVATEKEY *
d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len)
{
return (EC_PRIVATEKEY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&EC_PRIVATEKEY_it);
}
int
static int
i2d_EC_PRIVATEKEY(const EC_PRIVATEKEY *a, unsigned char **out)
{
return ASN1_item_i2d((ASN1_VALUE *)a, out, &EC_PRIVATEKEY_it);
}
EC_PRIVATEKEY *
static EC_PRIVATEKEY *
EC_PRIVATEKEY_new(void)
{
return (EC_PRIVATEKEY *)ASN1_item_new(&EC_PRIVATEKEY_it);
}
void
static void
EC_PRIVATEKEY_free(EC_PRIVATEKEY *a)
{
ASN1_item_free((ASN1_VALUE *)a, &EC_PRIVATEKEY_it);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ecdsa.c,v 1.18 2023/08/08 13:09:28 tb Exp $ */
/* $OpenBSD: ecdsa.c,v 1.19 2024/04/15 15:49:37 tb Exp $ */
/* ====================================================================
* Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
*
@ -84,7 +84,7 @@ static const ASN1_TEMPLATE ECDSA_SIG_seq_tt[] = {
},
};
const ASN1_ITEM ECDSA_SIG_it = {
static const ASN1_ITEM ECDSA_SIG_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ECDSA_SIG_seq_tt,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: o_fips.c,v 1.7 2024/04/10 14:51:02 beck Exp $ */
/* $OpenBSD: o_fips.c,v 1.8 2024/04/15 16:05:49 tb Exp $ */
/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
* project 2011.
*/
@ -58,7 +58,7 @@
#include <openssl/err.h>
#include "cryptlib.h"
#include <openssl/crypto.h>
int
FIPS_mode(void)

View file

@ -1,21 +0,0 @@
/* $OpenBSD: o_str.c,v 1.9 2014/07/09 20:22:14 tedu Exp $ */
/*
* Written by Theo de Raadt. Public domain.
*/
#include <string.h>
int OPENSSL_strcasecmp(const char *str1, const char *str2);
int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n);
int
OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n)
{
return strncasecmp(str1, str2, n);
}
int
OPENSSL_strcasecmp(const char *str1, const char *str2)
{
return strcasecmp(str1, str2);
}

View file

@ -1,3 +1,3 @@
# Don't forget to give libssl and libtls the same type of bump!
major=53
major=54
minor=0

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ts_asn1.c,v 1.14 2023/07/07 07:25:21 beck Exp $ */
/* $OpenBSD: ts_asn1.c,v 1.15 2024/04/15 15:52:46 tb Exp $ */
/* Written by Nils Larsch for the OpenSSL project 2004.
*/
/* ====================================================================
@ -80,7 +80,7 @@ static const ASN1_TEMPLATE TS_MSG_IMPRINT_seq_tt[] = {
},
};
const ASN1_ITEM TS_MSG_IMPRINT_it = {
static const ASN1_ITEM TS_MSG_IMPRINT_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_MSG_IMPRINT_seq_tt,
@ -202,7 +202,7 @@ static const ASN1_TEMPLATE TS_REQ_seq_tt[] = {
},
};
const ASN1_ITEM TS_REQ_it = {
static const ASN1_ITEM TS_REQ_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_REQ_seq_tt,
@ -303,7 +303,7 @@ static const ASN1_TEMPLATE TS_ACCURACY_seq_tt[] = {
},
};
const ASN1_ITEM TS_ACCURACY_it = {
static const ASN1_ITEM TS_ACCURACY_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_ACCURACY_seq_tt,
@ -423,7 +423,7 @@ static const ASN1_TEMPLATE TS_TST_INFO_seq_tt[] = {
},
};
const ASN1_ITEM TS_TST_INFO_it = {
static const ASN1_ITEM TS_TST_INFO_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_TST_INFO_seq_tt,
@ -524,7 +524,7 @@ static const ASN1_TEMPLATE TS_STATUS_INFO_seq_tt[] = {
},
};
const ASN1_ITEM TS_STATUS_INFO_it = {
static const ASN1_ITEM TS_STATUS_INFO_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_STATUS_INFO_seq_tt,
@ -640,7 +640,7 @@ static const ASN1_TEMPLATE TS_RESP_seq_tt[] = {
},
};
const ASN1_ITEM TS_RESP_it = {
static const ASN1_ITEM TS_RESP_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_RESP_seq_tt,
@ -734,7 +734,7 @@ static const ASN1_TEMPLATE ESS_ISSUER_SERIAL_seq_tt[] = {
},
};
const ASN1_ITEM ESS_ISSUER_SERIAL_it = {
static const ASN1_ITEM ESS_ISSUER_SERIAL_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ESS_ISSUER_SERIAL_seq_tt,
@ -798,7 +798,7 @@ static const ASN1_TEMPLATE ESS_CERT_ID_seq_tt[] = {
},
};
const ASN1_ITEM ESS_CERT_ID_it = {
static const ASN1_ITEM ESS_CERT_ID_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ESS_CERT_ID_seq_tt,
@ -862,7 +862,7 @@ static const ASN1_TEMPLATE ESS_SIGNING_CERT_seq_tt[] = {
},
};
const ASN1_ITEM ESS_SIGNING_CERT_it = {
static const ASN1_ITEM ESS_SIGNING_CERT_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ESS_SIGNING_CERT_seq_tt,

View file

@ -338,7 +338,6 @@ SSL_use_certificate_chain_file
SSL_use_certificate_file
SSL_verify_client_post_handshake
SSL_version
SSL_version_str
SSL_want
SSL_write
SSL_write_early_data

View file

@ -1,3 +1,3 @@
# Don't forget to give libtls the same type of bump!
major=56
major=57
minor=0

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ssl_lib.c,v 1.322 2024/03/27 06:47:52 tb Exp $ */
/* $OpenBSD: ssl_lib.c,v 1.323 2024/04/15 16:00:05 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -161,8 +161,6 @@
#include "ssl_tlsext.h"
#include "tls12_internal.h"
const char *SSL_version_str = OPENSSL_VERSION_TEXT;
int
SSL_clear(SSL *s)
{

View file

@ -1,2 +1,2 @@
major=29
major=30
minor=0