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 52c9e429eSbrutus * Common Development and Distribution License (the "License"). 62c9e429eSbrutus * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*0f1702c5SYu Xiangning * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_SOCKFS_NL7C_H 277c478bd9Sstevel@tonic-gate #define _SYS_SOCKFS_NL7C_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #ifdef __cplusplus 307c478bd9Sstevel@tonic-gate extern "C" { 317c478bd9Sstevel@tonic-gate #endif 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #include <sys/types.h> 347c478bd9Sstevel@tonic-gate #include <sys/atomic.h> 357c478bd9Sstevel@tonic-gate #include <sys/cmn_err.h> 367c478bd9Sstevel@tonic-gate #include <sys/stropts.h> 377c478bd9Sstevel@tonic-gate #include <sys/socket.h> 387c478bd9Sstevel@tonic-gate #include <sys/socketvar.h> 397c478bd9Sstevel@tonic-gate 40*0f1702c5SYu Xiangning 417c478bd9Sstevel@tonic-gate /* 42*0f1702c5SYu Xiangning * NCA_DEV NCA device 43*0f1702c5SYu Xiangning * 44*0f1702c5SYu Xiangning * NCA_INET_DEV TPI device for the INET based transport that NCA will use. 45*0f1702c5SYu Xiangning */ 46*0f1702c5SYu Xiangning #define NCA_DEV "/dev/nca" 47*0f1702c5SYu Xiangning #define NCA_INET_DEV "/dev/tcp" 48*0f1702c5SYu Xiangning 49*0f1702c5SYu Xiangning /* 50*0f1702c5SYu Xiangning * NL7C (uint64_t)(sotpi_info_t).sti_nl7c_flags: 517c478bd9Sstevel@tonic-gate */ 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate #define NL7C_ENABLED 0x00000001 /* NL7C enabled socket */ 547c478bd9Sstevel@tonic-gate #define NL7C_SOPERSIST 0x00000002 /* NL7C socket is persistent */ 557c478bd9Sstevel@tonic-gate #define NL7C_WAITWRITE 0x00000004 /* NL7C waiting first write */ 567c478bd9Sstevel@tonic-gate #define NL7C_AF_NCA 0x00000008 /* NL7C enabled socket via AF_NCA */ 572c9e429eSbrutus #define NL7C_POLLIN 0x00000010 /* poll() POLLIN prior to read */ 582c9e429eSbrutus #define NL7C_CLOSE 0x00000020 /* NL7C close needed */ 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate #define NL7C_SCHEMEPRIV 0xFFFF0000 /* NL7C scheme private state */ 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate #define NL7C_UNUSED 0xFFFFFFFF00000000 /* Unused bits */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate /* 657c478bd9Sstevel@tonic-gate * Globals ... 667c478bd9Sstevel@tonic-gate */ 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate extern boolean_t nl7c_enabled; 697c478bd9Sstevel@tonic-gate extern clock_t nl7c_uri_ttl; 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate /* 727c478bd9Sstevel@tonic-gate * Function prototypes ... 737c478bd9Sstevel@tonic-gate */ 747c478bd9Sstevel@tonic-gate 752c9e429eSbrutus boolean_t nl7c_process(struct sonode *, boolean_t); 762c9e429eSbrutus int nl7c_data(struct sonode *, uio_t *); 772c9e429eSbrutus void nl7c_urifree(struct sonode *); 787c478bd9Sstevel@tonic-gate void nl7c_close(struct sonode *); 792c9e429eSbrutus boolean_t nl7c_parse(struct sonode *, boolean_t, boolean_t *); 807c478bd9Sstevel@tonic-gate 81*0f1702c5SYu Xiangning extern void *nl7c_lookup_addr(void *, t_uscalar_t); 82*0f1702c5SYu Xiangning extern void *nl7c_add_addr(void *, t_uscalar_t); 83*0f1702c5SYu Xiangning extern void nl7c_listener_addr(void *, struct sonode *); 84*0f1702c5SYu Xiangning 857c478bd9Sstevel@tonic-gate #ifdef __cplusplus 867c478bd9Sstevel@tonic-gate } 877c478bd9Sstevel@tonic-gate #endif 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate #endif /* _SYS_SOCKFS_NL7C_H */ 90