17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 237c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 247c478bd9Sstevel@tonic-gate 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* 27*ba3594baSGarrett D'Amore * Copyright 2014 Garrett D'Amore <garrett@damore.org> 28*ba3594baSGarrett D'Amore * 297c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 307c478bd9Sstevel@tonic-gate * Use is subject to license terms. 317c478bd9Sstevel@tonic-gate */ 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #ifndef _SYS_NETCONFIG_H 347c478bd9Sstevel@tonic-gate #define _SYS_NETCONFIG_H 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #ifdef __cplusplus 377c478bd9Sstevel@tonic-gate extern "C" { 387c478bd9Sstevel@tonic-gate #endif 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #define NETCONFIG "/etc/netconfig" 417c478bd9Sstevel@tonic-gate #define NETPATH "NETPATH" 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate struct netconfig { 447c478bd9Sstevel@tonic-gate char *nc_netid; /* network identifier */ 457c478bd9Sstevel@tonic-gate unsigned int nc_semantics; /* defined below */ 467c478bd9Sstevel@tonic-gate unsigned int nc_flag; /* defined below */ 477c478bd9Sstevel@tonic-gate char *nc_protofmly; /* protocol family name */ 487c478bd9Sstevel@tonic-gate char *nc_proto; /* protocol name */ 497c478bd9Sstevel@tonic-gate char *nc_device; /* device name for network id */ 507c478bd9Sstevel@tonic-gate unsigned int nc_nlookups; /* # of entries in nc_lookups */ 517c478bd9Sstevel@tonic-gate char **nc_lookups; /* list of lookup directories */ 527c478bd9Sstevel@tonic-gate unsigned int nc_unused[8]; /* borrowed for lockd etc. */ 537c478bd9Sstevel@tonic-gate }; 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate typedef struct { 567c478bd9Sstevel@tonic-gate struct netconfig **nc_head; 577c478bd9Sstevel@tonic-gate struct netconfig **nc_curr; 587c478bd9Sstevel@tonic-gate } NCONF_HANDLE; 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate /* 617c478bd9Sstevel@tonic-gate * Values of nc_semantics 627c478bd9Sstevel@tonic-gate */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate #define NC_TPI_CLTS 1 657c478bd9Sstevel@tonic-gate #define NC_TPI_COTS 2 667c478bd9Sstevel@tonic-gate #define NC_TPI_COTS_ORD 3 677c478bd9Sstevel@tonic-gate #define NC_TPI_RAW 4 687c478bd9Sstevel@tonic-gate /* 697c478bd9Sstevel@tonic-gate * NOT FOR PUBLIC USE, Solaris internal only. 707c478bd9Sstevel@tonic-gate * This value of nc_semantics is strictly for use of Remote Direct 717c478bd9Sstevel@tonic-gate * Memory Access provider interfaces in Solaris only and not for 727c478bd9Sstevel@tonic-gate * general use. Do not use this value for general purpose user or 737c478bd9Sstevel@tonic-gate * kernel programming. If used the behavior is undefined. 747c478bd9Sstevel@tonic-gate * This is a PRIVATE interface to be used by Solaris kRPC only. 757c478bd9Sstevel@tonic-gate */ 767c478bd9Sstevel@tonic-gate #define NC_TPI_RDMA 5 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate /* 797c478bd9Sstevel@tonic-gate * Values of nc_flag 807c478bd9Sstevel@tonic-gate */ 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate #define NC_NOFLAG 00 837c478bd9Sstevel@tonic-gate #define NC_VISIBLE 01 847c478bd9Sstevel@tonic-gate #define NC_BROADCAST 02 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate /* 877c478bd9Sstevel@tonic-gate * Values of nc_protofmly 887c478bd9Sstevel@tonic-gate */ 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate #define NC_NOPROTOFMLY "-" 917c478bd9Sstevel@tonic-gate #define NC_LOOPBACK "loopback" 927c478bd9Sstevel@tonic-gate #define NC_INET "inet" 937c478bd9Sstevel@tonic-gate #define NC_INET6 "inet6" 947c478bd9Sstevel@tonic-gate #define NC_IMPLINK "implink" 957c478bd9Sstevel@tonic-gate #define NC_PUP "pup" 967c478bd9Sstevel@tonic-gate #define NC_CHAOS "chaos" 977c478bd9Sstevel@tonic-gate #define NC_NS "ns" 987c478bd9Sstevel@tonic-gate #define NC_NBS "nbs" 997c478bd9Sstevel@tonic-gate #define NC_ECMA "ecma" 1007c478bd9Sstevel@tonic-gate #define NC_DATAKIT "datakit" 1017c478bd9Sstevel@tonic-gate #define NC_CCITT "ccitt" 1027c478bd9Sstevel@tonic-gate #define NC_SNA "sna" 1037c478bd9Sstevel@tonic-gate #define NC_DECNET "decnet" 1047c478bd9Sstevel@tonic-gate #define NC_DLI "dli" 1057c478bd9Sstevel@tonic-gate #define NC_LAT "lat" 1067c478bd9Sstevel@tonic-gate #define NC_HYLINK "hylink" 1077c478bd9Sstevel@tonic-gate #define NC_APPLETALK "appletalk" 1087c478bd9Sstevel@tonic-gate #define NC_NIT "nit" 1097c478bd9Sstevel@tonic-gate #define NC_IEEE802 "ieee802" 1107c478bd9Sstevel@tonic-gate #define NC_OSI "osi" 1117c478bd9Sstevel@tonic-gate #define NC_X25 "x25" 1127c478bd9Sstevel@tonic-gate #define NC_OSINET "osinet" 1137c478bd9Sstevel@tonic-gate #define NC_GOSIP "gosip" 1147c478bd9Sstevel@tonic-gate /* 1157c478bd9Sstevel@tonic-gate * NOT FOR PUBLIC USE, Solaris internal only. 1167c478bd9Sstevel@tonic-gate * This value of nc_semantics is strictly for use of Remote Direct 1177c478bd9Sstevel@tonic-gate * Memory Access provider interfaces in Solaris only and not for 1187c478bd9Sstevel@tonic-gate * general use. Do not use this value for general purpose user or 1197c478bd9Sstevel@tonic-gate * kernel programming. If used the behavior is undefined. 1207c478bd9Sstevel@tonic-gate * This is a PRIVATE interface to be used by Solaris kRPC only. 1217c478bd9Sstevel@tonic-gate */ 1227c478bd9Sstevel@tonic-gate #define NC_RDMA "rdma" 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate /* 1257c478bd9Sstevel@tonic-gate * Values for nc_proto 1267c478bd9Sstevel@tonic-gate */ 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate #define NC_NOPROTO "-" 1297c478bd9Sstevel@tonic-gate #define NC_TCP "tcp" 1307c478bd9Sstevel@tonic-gate #define NC_UDP "udp" 1317c478bd9Sstevel@tonic-gate #define NC_ICMP "icmp" 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gate /* 1347c478bd9Sstevel@tonic-gate * Values for nc_proto for "rdma" protofmly 1357c478bd9Sstevel@tonic-gate */ 1367c478bd9Sstevel@tonic-gate #define NC_KVIPL "kvipl" 1377c478bd9Sstevel@tonic-gate #define NC_IBTF "ibtf" 1387c478bd9Sstevel@tonic-gate #define NC_KDAPL "kdapl" 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gate extern void *setnetconfig(void); 1417c478bd9Sstevel@tonic-gate extern int endnetconfig(void *); 1427c478bd9Sstevel@tonic-gate extern struct netconfig *getnetconfig(void *); 1437c478bd9Sstevel@tonic-gate extern struct netconfig *getnetconfigent(const char *); 1447c478bd9Sstevel@tonic-gate extern void freenetconfigent(struct netconfig *); 1457c478bd9Sstevel@tonic-gate extern void *setnetpath(void); 1467c478bd9Sstevel@tonic-gate extern int endnetpath(void *); 1477c478bd9Sstevel@tonic-gate extern struct netconfig *getnetpath(void *); 1487c478bd9Sstevel@tonic-gate extern void nc_perror(const char *); 1497c478bd9Sstevel@tonic-gate extern char *nc_sperror(void); 1507c478bd9Sstevel@tonic-gate 1517c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1527c478bd9Sstevel@tonic-gate } 1537c478bd9Sstevel@tonic-gate #endif 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate #endif /* _SYS_NETCONFIG_H */ 156