1*09938b21SHans Petter Selasky /*- 2*09938b21SHans Petter Selasky * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 3*09938b21SHans Petter Selasky * 4478d3005SHans Petter Selasky * Copyright (c) 2014 Intel Corporation. All rights reserved. 5478d3005SHans Petter Selasky * Copyright (c) 2014 Chelsio, Inc. All rights reserved. 6478d3005SHans Petter Selasky * 7478d3005SHans Petter Selasky * This software is available to you under a choice of one of two 8478d3005SHans Petter Selasky * licenses. You may choose to be licensed under the terms of the GNU 9478d3005SHans Petter Selasky * General Public License (GPL) Version 2, available from the file 10478d3005SHans Petter Selasky * COPYING in the main directory of this source tree, or the 11478d3005SHans Petter Selasky * OpenIB.org BSD license below: 12478d3005SHans Petter Selasky * 13478d3005SHans Petter Selasky * Redistribution and use in source and binary forms, with or 14478d3005SHans Petter Selasky * without modification, are permitted provided that the following 15478d3005SHans Petter Selasky * conditions are met: 16478d3005SHans Petter Selasky * 17478d3005SHans Petter Selasky * - Redistributions of source code must retain the above 18478d3005SHans Petter Selasky * copyright notice, this list of conditions and the following 19478d3005SHans Petter Selasky * disclaimer. 20478d3005SHans Petter Selasky * 21478d3005SHans Petter Selasky * - Redistributions in binary form must reproduce the above 22478d3005SHans Petter Selasky * copyright notice, this list of conditions and the following 23478d3005SHans Petter Selasky * disclaimer in the documentation and/or other materials 24478d3005SHans Petter Selasky * provided with the distribution. 25478d3005SHans Petter Selasky * 26478d3005SHans Petter Selasky * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27478d3005SHans Petter Selasky * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 28478d3005SHans Petter Selasky * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 29478d3005SHans Petter Selasky * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 30478d3005SHans Petter Selasky * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 31478d3005SHans Petter Selasky * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 32478d3005SHans Petter Selasky * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 33478d3005SHans Petter Selasky * SOFTWARE. 34478d3005SHans Petter Selasky */ 35*09938b21SHans Petter Selasky 36478d3005SHans Petter Selasky #ifndef _IW_PORTMAP_H 37478d3005SHans Petter Selasky #define _IW_PORTMAP_H 38478d3005SHans Petter Selasky 39478d3005SHans Petter Selasky #define IWPM_ULIBNAME_SIZE 32 40478d3005SHans Petter Selasky #define IWPM_DEVNAME_SIZE 32 41478d3005SHans Petter Selasky #define IWPM_IFNAME_SIZE 16 42478d3005SHans Petter Selasky #define IWPM_IPADDR_SIZE 16 43478d3005SHans Petter Selasky 44478d3005SHans Petter Selasky enum { 45478d3005SHans Petter Selasky IWPM_INVALID_NLMSG_ERR = 10, 46478d3005SHans Petter Selasky IWPM_CREATE_MAPPING_ERR, 47478d3005SHans Petter Selasky IWPM_DUPLICATE_MAPPING_ERR, 48478d3005SHans Petter Selasky IWPM_UNKNOWN_MAPPING_ERR, 49478d3005SHans Petter Selasky IWPM_CLIENT_DEV_INFO_ERR, 50478d3005SHans Petter Selasky IWPM_USER_LIB_INFO_ERR, 51478d3005SHans Petter Selasky IWPM_REMOTE_QUERY_REJECT 52478d3005SHans Petter Selasky }; 53478d3005SHans Petter Selasky 54478d3005SHans Petter Selasky struct iwpm_dev_data { 55478d3005SHans Petter Selasky char dev_name[IWPM_DEVNAME_SIZE]; 56478d3005SHans Petter Selasky char if_name[IWPM_IFNAME_SIZE]; 57478d3005SHans Petter Selasky }; 58478d3005SHans Petter Selasky 59478d3005SHans Petter Selasky struct iwpm_sa_data { 60478d3005SHans Petter Selasky struct sockaddr_storage loc_addr; 61478d3005SHans Petter Selasky struct sockaddr_storage mapped_loc_addr; 62478d3005SHans Petter Selasky struct sockaddr_storage rem_addr; 63478d3005SHans Petter Selasky struct sockaddr_storage mapped_rem_addr; 64478d3005SHans Petter Selasky }; 65478d3005SHans Petter Selasky 66478d3005SHans Petter Selasky /** 67478d3005SHans Petter Selasky * iwpm_valid_pid - Check if the userspace iwarp port mapper pid is valid 68478d3005SHans Petter Selasky * 69478d3005SHans Petter Selasky * Returns true if the pid is greater than zero, otherwise returns false 70478d3005SHans Petter Selasky */ 71478d3005SHans Petter Selasky int iwpm_valid_pid(void); 72478d3005SHans Petter Selasky 73478d3005SHans Petter Selasky #endif /* _IW_PORTMAP_H */ 74