visibility.h revision 229970
124139Sjoerg/*- 224139Sjoerg * Copyright (c) 2011 Monthadar Al Jaberi, TerraNet AB 324139Sjoerg * All rights reserved. 424139Sjoerg * 524139Sjoerg * Redistribution and use in source and binary forms, with or without 624139Sjoerg * modification, are permitted provided that the following conditions 724139Sjoerg * are met: 824139Sjoerg * 1. Redistributions of source code must retain the above copyright 924139Sjoerg * notice, this list of conditions and the following disclaimer, 1024139Sjoerg * without modification. 1124139Sjoerg * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1289757Sdwmalone * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 1389757Sdwmalone * redistribution must be conditioned upon including a substantially 1489757Sdwmalone * similar Disclaimer requirement for further binary redistribution. 1566641Simp * 1666641Simp * NO WARRANTY 1724139Sjoerg * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1824139Sjoerg * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1924139Sjoerg * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 2024139Sjoerg * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 2124139Sjoerg * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 2224139Sjoerg * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2324139Sjoerg * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2424139Sjoerg * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 2524139Sjoerg * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2624139Sjoerg * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 2724139Sjoerg * THE POSSIBILITY OF SUCH DAMAGES. 2824139Sjoerg * 2924139Sjoerg * $FreeBSD: head/sys/dev/wtap/plugins/visibility.h 229970 2012-01-11 17:41:14Z adrian $ 3024139Sjoerg */ 3124139Sjoerg#ifndef _VISIBILITY_H_ 3224139Sjoerg#define _VISIBILITY_H_ 3324139Sjoerg 3424139Sjoerg#include "wtap_plugin.h" 3524139Sjoerg#include "visibility_ioctl.h" 3624139Sjoerg 3786042Sdwmalone#define CDEV_GET_SOFTC(x) (x)->si_drv1 3824139Sjoerg 3924139Sjoerg#define ARRAY_SIZE (32) //We support a maximum of 1024 nodes for now 4024139Sjoerg 4124139Sjoergstruct vis_map { 4224139Sjoerg uint32_t map[ARRAY_SIZE]; 4324139Sjoerg}; 4424139Sjoerg 4524139Sjoergstruct visibility_plugin { 4624139Sjoerg struct wtap_plugin base; 4724139Sjoerg struct mtx pl_mtx; 4824139Sjoerg struct vis_map pl_node[MAX_NBR_WTAP]; 4924139Sjoerg}; 5024139Sjoerg 5124139Sjoergvoid visibility_init(struct wtap_plugin *); 5224139Sjoergvoid visibility_deinit(struct wtap_plugin *); 5324139Sjoergvoid visibility_work(struct wtap_plugin *, struct packet *); 5424139Sjoerg 5524139Sjoerg#endif 5624139Sjoerg 5724139Sjoerg