~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/tipc/server.h

Version: ~ [ linux-5.12-rc5 ] ~ [ linux-5.11.11 ] ~ [ linux-5.10.27 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.109 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.184 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.228 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.264 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.264 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * net/tipc/server.h: Include file for TIPC server code
  3  *
  4  * Copyright (c) 2012-2013, Wind River Systems
  5  * All rights reserved.
  6  *
  7  * Redistribution and use in source and binary forms, with or without
  8  * modification, are permitted provided that the following conditions are met:
  9  *
 10  * 1. Redistributions of source code must retain the above copyright
 11  *    notice, this list of conditions and the following disclaimer.
 12  * 2. Redistributions in binary form must reproduce the above copyright
 13  *    notice, this list of conditions and the following disclaimer in the
 14  *    documentation and/or other materials provided with the distribution.
 15  * 3. Neither the names of the copyright holders nor the names of its
 16  *    contributors may be used to endorse or promote products derived from
 17  *    this software without specific prior written permission.
 18  *
 19  * Alternatively, this software may be distributed under the terms of the
 20  * GNU General Public License ("GPL") version 2 as published by the Free
 21  * Software Foundation.
 22  *
 23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 33  * POSSIBILITY OF SUCH DAMAGE.
 34  */
 35 
 36 #ifndef _TIPC_SERVER_H
 37 #define _TIPC_SERVER_H
 38 
 39 #include <linux/idr.h>
 40 #include <linux/tipc.h>
 41 #include <net/net_namespace.h>
 42 
 43 #define TIPC_SERVER_NAME_LEN    32
 44 
 45 /**
 46  * struct tipc_server - TIPC server structure
 47  * @conn_idr: identifier set of connection
 48  * @idr_lock: protect the connection identifier set
 49  * @idr_in_use: amount of allocated identifier entry
 50  * @net: network namspace instance
 51  * @rcvbuf_cache: memory cache of server receive buffer
 52  * @rcv_wq: receive workqueue
 53  * @send_wq: send workqueue
 54  * @max_rcvbuf_size: maximum permitted receive message length
 55  * @tipc_conn_new: callback will be called when new connection is incoming
 56  * @tipc_conn_release: callback will be called before releasing the connection
 57  * @tipc_conn_recvmsg: callback will be called when message arrives
 58  * @saddr: TIPC server address
 59  * @name: server name
 60  * @imp: message importance
 61  * @type: socket type
 62  */
 63 struct tipc_server {
 64         struct idr conn_idr;
 65         spinlock_t idr_lock;
 66         int idr_in_use;
 67         struct net *net;
 68         struct kmem_cache *rcvbuf_cache;
 69         struct workqueue_struct *rcv_wq;
 70         struct workqueue_struct *send_wq;
 71         int max_rcvbuf_size;
 72         void *(*tipc_conn_new)(int conid);
 73         void (*tipc_conn_release)(int conid, void *usr_data);
 74         void (*tipc_conn_recvmsg)(struct net *net, int conid,
 75                                   struct sockaddr_tipc *addr, void *usr_data,
 76                                   void *buf, size_t len);
 77         struct sockaddr_tipc *saddr;
 78         char name[TIPC_SERVER_NAME_LEN];
 79         int imp;
 80         int type;
 81 };
 82 
 83 int tipc_conn_sendmsg(struct tipc_server *s, int conid,
 84                       struct sockaddr_tipc *addr, void *data, size_t len);
 85 
 86 /**
 87  * tipc_conn_terminate - terminate connection with server
 88  *
 89  * Note: Must call it in process context since it might sleep
 90  */
 91 void tipc_conn_terminate(struct tipc_server *s, int conid);
 92 
 93 int tipc_server_start(struct tipc_server *s);
 94 
 95 void tipc_server_stop(struct tipc_server *s);
 96 
 97 #endif
 98 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp