1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 * 26 * Socket-specific definitions 27 */ 28 29 #ifndef _SOCKET_INET_H 30 #define _SOCKET_INET_H 31 32 #pragma ident "%Z%%M% %I% %E% SMI" 33 34 #include <sys/types.h> 35 #include <sys/socket.h> 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 /* Network configuration protocol definitions */ 42 enum nc_type { NCT_BOOTP_DHCP, NCT_RARP_BOOTPARAMS, NCT_MANUAL }; 43 struct nct_t { 44 char *p_name; 45 enum nc_type p_id; 46 }; 47 #define NCT_DEFAULT NCT_RARP_BOOTPARAMS 48 #define NCT_BUFSIZE (64) 49 extern struct nct_t nct[]; 50 extern int nct_entries; 51 52 /* 53 * Dynamic/private ports can be allocated in the range of 49152-65535. 54 * Source: IANA (www.iana.org) port numbers. 55 */ 56 #define IPPORT_DYNAMIC_START 49152 57 58 extern int dontroute; 59 60 extern int socket_read(int, void *, size_t, int); 61 extern int socket_write(int, const void *, size_t, struct sockaddr_in *); 62 extern int socket_close(int); 63 64 extern int get_netconfig_strategy(void); 65 extern in_port_t get_source_port(boolean_t); 66 67 #ifdef __cplusplus 68 } 69 #endif 70 71 #endif /* _SOCKET_INET_H */ 72