18826cde6SJon Paul Maloy /* net/tipc/socket.h: Include file for TIPC socket code 28826cde6SJon Paul Maloy * 38826cde6SJon Paul Maloy * Copyright (c) 2014, Ericsson AB 48826cde6SJon Paul Maloy * All rights reserved. 58826cde6SJon Paul Maloy * 68826cde6SJon Paul Maloy * Redistribution and use in source and binary forms, with or without 78826cde6SJon Paul Maloy * modification, are permitted provided that the following conditions are met: 88826cde6SJon Paul Maloy * 98826cde6SJon Paul Maloy * 1. Redistributions of source code must retain the above copyright 108826cde6SJon Paul Maloy * notice, this list of conditions and the following disclaimer. 118826cde6SJon Paul Maloy * 2. Redistributions in binary form must reproduce the above copyright 128826cde6SJon Paul Maloy * notice, this list of conditions and the following disclaimer in the 138826cde6SJon Paul Maloy * documentation and/or other materials provided with the distribution. 148826cde6SJon Paul Maloy * 3. Neither the names of the copyright holders nor the names of its 158826cde6SJon Paul Maloy * contributors may be used to endorse or promote products derived from 168826cde6SJon Paul Maloy * this software without specific prior written permission. 178826cde6SJon Paul Maloy * 188826cde6SJon Paul Maloy * Alternatively, this software may be distributed under the terms of the 198826cde6SJon Paul Maloy * GNU General Public License ("GPL") version 2 as published by the Free 208826cde6SJon Paul Maloy * Software Foundation. 218826cde6SJon Paul Maloy * 228826cde6SJon Paul Maloy * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 238826cde6SJon Paul Maloy * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 248826cde6SJon Paul Maloy * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 258826cde6SJon Paul Maloy * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 268826cde6SJon Paul Maloy * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 278826cde6SJon Paul Maloy * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 288826cde6SJon Paul Maloy * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 298826cde6SJon Paul Maloy * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 308826cde6SJon Paul Maloy * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 318826cde6SJon Paul Maloy * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 328826cde6SJon Paul Maloy * POSSIBILITY OF SUCH DAMAGE. 338826cde6SJon Paul Maloy */ 348826cde6SJon Paul Maloy 358826cde6SJon Paul Maloy #ifndef _TIPC_SOCK_H 368826cde6SJon Paul Maloy #define _TIPC_SOCK_H 378826cde6SJon Paul Maloy 388826cde6SJon Paul Maloy #include <net/sock.h> 3934b78a12SRichard Alpe #include <net/genetlink.h> 408826cde6SJon Paul Maloy 412e84c60bSJon Paul Maloy #define TIPC_CONNACK_INTV 256 422e84c60bSJon Paul Maloy #define TIPC_FLOWCTRL_WIN (TIPC_CONNACK_INTV * 2) 432e84c60bSJon Paul Maloy #define TIPC_CONN_OVERLOAD_LIMIT ((TIPC_FLOWCTRL_WIN * 2 + 1) * \ 442e84c60bSJon Paul Maloy SKB_TRUESIZE(TIPC_MAX_USER_MSG_SIZE)) 45859fc7c0SYing Xue 46859fc7c0SYing Xue int tipc_socket_init(void); 47859fc7c0SYing Xue void tipc_socket_stop(void); 48859fc7c0SYing Xue int tipc_sock_create_local(int type, struct socket **res); 49859fc7c0SYing Xue void tipc_sock_release_local(struct socket *sock); 50859fc7c0SYing Xue int tipc_sock_accept_local(struct socket *sock, struct socket **newsock, 51859fc7c0SYing Xue int flags); 52f2f9800dSYing Xue int tipc_sk_rcv(struct net *net, struct sk_buff *buf); 53*e05b31f4SYing Xue struct sk_buff *tipc_sk_socks_show(struct net *net); 54f2f9800dSYing Xue void tipc_sk_mcast_rcv(struct net *net, struct sk_buff *buf); 55*e05b31f4SYing Xue void tipc_sk_reinit(struct net *net); 56*e05b31f4SYing Xue int tipc_sk_rht_init(struct net *net); 57*e05b31f4SYing Xue void tipc_sk_rht_destroy(struct net *net); 5834b78a12SRichard Alpe int tipc_nl_sk_dump(struct sk_buff *skb, struct netlink_callback *cb); 591a1a143dSRichard Alpe int tipc_nl_publ_dump(struct sk_buff *skb, struct netlink_callback *cb); 60078bec82SJon Paul Maloy 618826cde6SJon Paul Maloy #endif 62