core.h 3.2 KB
Newer Older
P
Per Liden 已提交
1 2
/*
 * net/tipc/core.h: Include file for TIPC global declarations
3
 *
4 5
 * Copyright (c) 2005-2006, 2013 Ericsson AB
 * Copyright (c) 2005-2007, 2010-2013, Wind River Systems
P
Per Liden 已提交
6 7
 * All rights reserved.
 *
P
Per Liden 已提交
8
 * Redistribution and use in source and binary forms, with or without
P
Per Liden 已提交
9 10
 * modification, are permitted provided that the following conditions are met:
 *
P
Per Liden 已提交
11 12 13 14 15 16 17 18
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the names of the copyright holders nor the names of its
 *    contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
P
Per Liden 已提交
19
 *
P
Per Liden 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
P
Per Liden 已提交
34 35 36 37 38 39
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _TIPC_CORE_H
#define _TIPC_CORE_H

J
Jon Maloy 已提交
40 41
#include <linux/tipc.h>
#include <linux/tipc_config.h>
42
#include <linux/tipc_netlink.h>
P
Per Liden 已提交
43 44 45 46 47 48
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/timer.h>
#include <linux/string.h>
49
#include <linux/uaccess.h>
P
Per Liden 已提交
50
#include <linux/interrupt.h>
A
Arun Sharma 已提交
51
#include <linux/atomic.h>
P
Per Liden 已提交
52 53
#include <asm/hardirq.h>
#include <linux/netdevice.h>
54
#include <linux/in.h>
P
Per Liden 已提交
55
#include <linux/list.h>
56
#include <linux/slab.h>
P
Per Liden 已提交
57
#include <linux/vmalloc.h>
58
#include <linux/rtnetlink.h>
59
#include <linux/etherdevice.h>
60
#include <net/netns/generic.h>
61

62 63
#include "node.h"

64 65
#define TIPC_MOD_VER "2.0.0"

66
int tipc_snprintf(char *buf, int len, const char *fmt, ...);
67

P
Per Liden 已提交
68 69 70
/*
 * Global configuration variables
 */
71 72
extern u32 tipc_own_addr __read_mostly;
extern int tipc_net_id __read_mostly;
73
extern int sysctl_tipc_rmem[3] __read_mostly;
74
extern int sysctl_tipc_named_timeout __read_mostly;
P
Per Liden 已提交
75 76 77 78

/*
 * Other global variables
 */
79
extern int tipc_random __read_mostly;
P
Per Liden 已提交
80

81 82
struct tipc_net {
	int net_id;
83 84 85 86 87 88 89

	/* Node table and node list */
	spinlock_t node_list_lock;
	struct hlist_head node_htable[NODE_HTABLE_SIZE];
	struct list_head node_list;
	u32 num_nodes;
	u32 num_links;
90 91
};

92
#ifdef CONFIG_SYSCTL
93 94
int tipc_register_sysctl(void);
void tipc_unregister_sysctl(void);
95 96 97 98 99
#else
#define tipc_register_sysctl() 0
#define tipc_unregister_sysctl()
#endif

100
#endif