Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/wtap/plugins/visibility.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 17 Lines | |||||
*/ | */ | ||||
#ifndef _VISIBILITY_H_ | #ifndef _VISIBILITY_H_ | ||||
#define _VISIBILITY_H_ | #define _VISIBILITY_H_ | ||||
#include "wtap_plugin.h" | #include "wtap_plugin.h" | ||||
#include "visibility_ioctl.h" | #include "visibility_ioctl.h" | ||||
#define CDEV_GET_SOFTC(x) (x)->si_drv1 | #define CDEV_GET_SOFTC(x) (x)->si_drv1 | ||||
#define ARRAY_SIZE (32) //We support a maximum of 1024 nodes for now | |||||
struct vis_map { | struct vis_map { | ||||
uint32_t map[ARRAY_SIZE]; | uint32_t map[ARRAY_SIZE]; | ||||
}; | }; | ||||
struct visibility_plugin { | struct visibility_plugin { | ||||
struct wtap_plugin base; | struct wtap_plugin base; | ||||
struct mtx pl_mtx; | struct mtx pl_mtx; | ||||
struct vis_map pl_node[MAX_NBR_WTAP]; | struct vis_map pl_node[MAX_NBR_WTAP]; | ||||
}; | }; | ||||
void visibility_init(struct wtap_plugin *); | void visibility_init(struct wtap_plugin *); | ||||
void visibility_deinit(struct wtap_plugin *); | void visibility_deinit(struct wtap_plugin *); | ||||
void visibility_work(struct wtap_plugin *, struct packet *); | void visibility_work(struct wtap_plugin *, struct packet *); | ||||
#endif | #endif |