2 * Copyright (c) 2014 Intel Corporation. All rights reserved.
3 * Copyright (c) 2014 Chelsio, Inc. All rights reserved.
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36 #include <linux/module.h>
39 #include <linux/in6.h>
40 #include <linux/spinlock.h>
41 #include <linux/kernel.h>
42 #include <linux/netdevice.h>
43 #include <linux/delay.h>
44 #include <linux/workqueue.h>
45 #include <linux/mutex.h>
46 #include <linux/jhash.h>
47 #include <linux/kref.h>
48 #include <linux/errno.h>
49 #include <linux/rwsem.h>
51 #include <rdma/iw_portmap.h>
53 #define IWPM_PID_UNDEFINED -1
54 #define IWPM_PID_UNAVAILABLE -2
56 #define IWPM_REG_UNDEF 0x01
57 #define IWPM_REG_VALID 0x02
58 #define IWPM_REG_INCOMPL 0x04
61 * iwpm_compare_sockaddr - Compare two sockaddr storage structs
63 * Returns 0 if they are holding the same ip/tcp address info,
66 int iwpm_compare_sockaddr(struct sockaddr_storage *a_sockaddr,
67 struct sockaddr_storage *b_sockaddr);
70 * iwpm_print_sockaddr - Print IPv4/IPv6 address and TCP port
71 * @sockaddr: Socket address to print
72 * @msg: Message to print
74 void iwpm_print_sockaddr(struct sockaddr_storage *sockaddr, char *msg);