Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/wtap/plugins/visibility_ioctl.h
/*- | /*- | ||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD | * SPDX-License-Identifier: BSD-2-Clause-FreeBSD | ||||
* | * | ||||
* Copyright (c) 2011 Monthadar Al Jaberi, TerraNet AB | * Copyright (c) 2011 Monthadar Al Jaberi, TerraNet AB | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Copyright (c) 2023 The FreeBSD Foundation | |||||
* | |||||
* Portions of this software were developed by En-Wei Wu | |||||
* under sponsorship from the FreeBSD Foundation. | |||||
* | |||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer, | * notice, this list of conditions and the following disclaimer, | ||||
* without modification. | * without modification. | ||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer | * 2. Redistributions in binary form must reproduce at minimum a disclaimer | ||||
* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any | * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any | ||||
Show All 20 Lines | |||||
* Ioctl-related defintions for the Wireless TAP plugins. | * Ioctl-related defintions for the Wireless TAP plugins. | ||||
*/ | */ | ||||
#ifndef _VISIBILITY_IOCTL_H | #ifndef _VISIBILITY_IOCTL_H | ||||
#define _VISIBILITY_IOCTL_H | #define _VISIBILITY_IOCTL_H | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#ifndef MAX_NBR_WTAP | |||||
#define MAX_NBR_WTAP (64) // We support a maximum of 64 nodes for now | |||||
#endif | |||||
#ifndef ARRAY_SIZE | |||||
#define ARRAY_SIZE (MAX_NBR_WTAP / (int)(sizeof(uint32_t) * NBBY)) | |||||
#endif | |||||
struct vis_map_req { | |||||
int id; | |||||
uint32_t map[ARRAY_SIZE]; | |||||
}; | |||||
struct link { | struct link { | ||||
int op; //0 remove, 1 link | int op; //0 remove, 1 link | ||||
int id1; | int id1; | ||||
int id2; | int id2; | ||||
}; | }; | ||||
#define VISIOCTLOPEN _IOW('W', 3, int) // 0 close, 1 open | #define VISIOCTLSETOPEN _IOW('W', 4, int) // 0 close, 1 open | ||||
#define VISIOCTLLINK _IOW('W', 4, struct link) // | #define VISIOCTLSETLINK _IOW('W', 5, struct link) // | ||||
#define VISIOCTLGETOPEN _IOR('R', 6, int) | |||||
#define VISIOCTLGETMAP _IOWR('R', 7, struct vis_map_req) | |||||
#endif | #endif |