Changeset 0c20a46 in rtems
- Timestamp:
- Feb 3, 2005, 3:58:18 PM (16 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 5b6111b
- Parents:
- abb63593
- Location:
- cpukit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
rabb63593 r0c20a46 1 2005-02-03 Ralf Corsepius <ralf.corsepius@rtems.org> 2 3 * librpc/include/rpc/types.h: Partial update from FreeBSD. 4 Use stdint.h types instead of sys/types.h. 5 * librpc/src/rpc/bindresvport.c: Partial update from FreeBSD. 6 1 7 2005-02-03 Ralf Corsepius <ralf.corsepius@rtems.org> 2 8 -
cpukit/librpc/include/rpc/types.h
rabb63593 r0c20a46 1 /* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */ 2 1 3 /* 2 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for … … 29 31 * from: @(#)types.h 1.18 87/07/24 SMI 30 32 * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC 31 * $FreeBSD: src/include/rpc/types.h,v 1. 9 1999/08/27 23:45:06 peterExp $33 * $FreeBSD: src/include/rpc/types.h,v 1.11 2003/12/07 21:10:06 marcel Exp $ 32 34 */ 33 35 … … 40 42 #include <rtems/stdint.h> 41 43 42 #define bool_t int32_t 43 #define enum_t int32_t 44 typedef int32_t bool_t; 45 typedef int32_t enum_t; 46 47 typedef uint32_t rpcprog_t; 48 typedef uint32_t rpcvers_t; 49 typedef uint32_t rpcproc_t; 50 typedef uint32_t rpcprot_t; 51 typedef uint32_t rpcport_t; 52 typedef int32_t rpc_inline_t; 53 44 54 #define __dontcare__ -1 45 55 … … 50 60 # define TRUE (1) 51 61 #endif 52 #ifndef NULL53 # define NULL 054 #endif55 62 56 63 #define mem_alloc(bsize) malloc(bsize) 57 64 #define mem_free(ptr, bsize) free(ptr) 58 65 59 #ifndef makedev /* ie, we haven't already included it */60 #include <sys/types.h>61 #endif62 66 #include <sys/time.h> 63 67 -
cpukit/librpc/src/rpc/bindresvport.c
rabb63593 r0c20a46 1 /* $NetBSD: bindresvport.c,v 1.19 2000/07/06 03:03:59 christos Exp $ */ 2 1 3 /* 2 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for … … 42 44 43 45 #include <sys/types.h> 44 #include <sys/errno.h>45 46 #include <sys/socket.h> 47 46 48 #include <netinet/in.h> 49 50 #include <errno.h> 51 #include <string.h> 47 52 #include <unistd.h> 48 #include <string.h> 53 54 #include <rpc/rpc.h> 49 55 50 56 /* 51 * Bind a socket to a privileged port for whatever protocol. 57 * Bind a socket to a privileged IP port 58 */ 59 int 60 bindresvport(sd, sin) 61 int sd; 62 struct sockaddr_in *sin; 63 { 64 return bindresvport_sa(sd, (struct sockaddr *)sin); 65 } 66 67 /* 68 * Bind a socket to a privileged IP port 52 69 */ 53 70 int … … 59 76 struct sockaddr myaddr; 60 77 struct sockaddr_in *sin; 61 #if (defined(AF_INET6) && defined(IPPROTO_IPV6))78 #ifdef INET6 62 79 struct sockaddr_in6 *sin6; 63 80 #endif … … 78 95 af = sa->sa_family; 79 96 80 if (af == AF_INET) { 97 switch (af) { 98 case AF_INET: 81 99 proto = IPPROTO_IP; 82 100 portrange = IP_PORTRANGE; … … 85 103 salen = sizeof(struct sockaddr_in); 86 104 port = sin->sin_port; 87 #if (defined(AF_INET6) && defined(IPPROTO_IPV6)) 88 } else if (af == AF_INET6) { 105 break; 106 #ifdef INET6 107 case AF_INET6: 89 108 proto = IPPROTO_IPV6; 90 109 portrange = IPV6_PORTRANGE; … … 93 112 salen = sizeof(struct sockaddr_in6); 94 113 port = sin6->sin6_port; 114 break; 95 115 #endif 96 } else {116 default: 97 117 errno = EPFNOSUPPORT; 98 118 return (-1); … … 127 147 128 148 if (sa != (struct sockaddr *)&myaddr) { 129 /* Hmm, what did the kernel assign ...*/149 /* Hmm, what did the kernel assign? */ 130 150 if (getsockname(sd, sa, &salen) < 0) 131 151 errno = saved_errno; … … 135 155 return (error); 136 156 } 137 138 /*139 * Bind a socket to a privileged IP port140 */141 int142 bindresvport(sd, sin)143 int sd;144 struct sockaddr_in *sin;145 {146 return bindresvport_sa(sd, (struct sockaddr *)sin);147 }
Note: See TracChangeset
for help on using the changeset viewer.