Back to home page

OSCL-LXR

 
 

    


0001 /* net/tipc/socket.h: Include file for TIPC socket code
0002  *
0003  * Copyright (c) 2014-2016, Ericsson AB
0004  * All rights reserved.
0005  *
0006  * Redistribution and use in source and binary forms, with or without
0007  * modification, are permitted provided that the following conditions are met:
0008  *
0009  * 1. Redistributions of source code must retain the above copyright
0010  *    notice, this list of conditions and the following disclaimer.
0011  * 2. Redistributions in binary form must reproduce the above copyright
0012  *    notice, this list of conditions and the following disclaimer in the
0013  *    documentation and/or other materials provided with the distribution.
0014  * 3. Neither the names of the copyright holders nor the names of its
0015  *    contributors may be used to endorse or promote products derived from
0016  *    this software without specific prior written permission.
0017  *
0018  * Alternatively, this software may be distributed under the terms of the
0019  * GNU General Public License ("GPL") version 2 as published by the Free
0020  * Software Foundation.
0021  *
0022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0023  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0024  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0025  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0026  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0027  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0028  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0029  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0030  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0031  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0032  * POSSIBILITY OF SUCH DAMAGE.
0033  */
0034 
0035 #ifndef _TIPC_SOCK_H
0036 #define _TIPC_SOCK_H
0037 
0038 #include <net/sock.h>
0039 #include <net/genetlink.h>
0040 
0041 /* Compatibility values for deprecated message based flow control */
0042 #define FLOWCTL_MSG_WIN 512
0043 #define FLOWCTL_MSG_LIM ((FLOWCTL_MSG_WIN * 2 + 1) * SKB_TRUESIZE(MAX_MSG_SIZE))
0044 
0045 #define FLOWCTL_BLK_SZ 1024
0046 
0047 /* Socket receive buffer sizes */
0048 #define RCVBUF_MIN  (FLOWCTL_BLK_SZ * 512)
0049 #define RCVBUF_DEF  (FLOWCTL_BLK_SZ * 1024 * 2)
0050 #define RCVBUF_MAX  (FLOWCTL_BLK_SZ * 1024 * 16)
0051 
0052 struct tipc_sock;
0053 
0054 int tipc_socket_init(void);
0055 void tipc_socket_stop(void);
0056 void tipc_sk_rcv(struct net *net, struct sk_buff_head *inputq);
0057 void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
0058                struct sk_buff_head *inputq);
0059 void tipc_sk_reinit(struct net *net);
0060 int tipc_sk_rht_init(struct net *net);
0061 void tipc_sk_rht_destroy(struct net *net);
0062 int tipc_nl_sk_dump(struct sk_buff *skb, struct netlink_callback *cb);
0063 int tipc_nl_publ_dump(struct sk_buff *skb, struct netlink_callback *cb);
0064 int tipc_sk_fill_sock_diag(struct sk_buff *skb, struct netlink_callback *cb,
0065                struct tipc_sock *tsk, u32 sk_filter_state,
0066                u64 (*tipc_diag_gen_cookie)(struct sock *sk));
0067 int tipc_nl_sk_walk(struct sk_buff *skb, struct netlink_callback *cb,
0068             int (*skb_handler)(struct sk_buff *skb,
0069                        struct netlink_callback *cb,
0070                        struct tipc_sock *tsk));
0071 int tipc_dump_start(struct netlink_callback *cb);
0072 int __tipc_dump_start(struct netlink_callback *cb, struct net *net);
0073 int tipc_dump_done(struct netlink_callback *cb);
0074 u32 tipc_sock_get_portid(struct sock *sk);
0075 bool tipc_sk_overlimit1(struct sock *sk, struct sk_buff *skb);
0076 bool tipc_sk_overlimit2(struct sock *sk, struct sk_buff *skb);
0077 int tipc_sk_bind(struct socket *sock, struct sockaddr *skaddr, int alen);
0078 int tsk_set_importance(struct sock *sk, int imp);
0079 
0080 #endif