The Assimilation Project  based on Assimilation version 1.1.7.1474836767
arpdiscovery.c File Reference

vim: number colorcolumn=100 More...

#include <stdio.h>
#include <projectcommon.h>
#include <memory.h>
#include <arpdiscovery.h>
#include <configcontext.h>
#include <netaddr.h>
#include <misc.h>
#include <tlvhelper.h>
#include <nanoprobe.h>
Include dependency graph for arpdiscovery.c:

Go to the source code of this file.

Macros

#define ARP_PKT_OFFSET   14
 Number of bytes before the ARP packet itself starts. More...
 
#define ARP_HRD_LEN   2
 Number of bytes for the Hardware Type field. More...
 
#define ARP_PRO_LEN   2
 Number of bytes for the Protocol Type field. More...
 
#define ARP_HLN_LEN   1
 Number of bytes for the Hardware Address Length field. More...
 
#define ARP_PLN_LEN   1
 Number of bytes for the Protocol Address Length field. More...
 
#define ARP_OP_LEN   2
 Number of bytes for the Opcode field. More...
 
#define ARP_HDR_LEN   (ARP_HRD_LEN + ARP_PRO_LEN + ARP_HLN_LEN + ARP_PLN_LEN + ARP_OP_LEN)
 Number of bytes for the ARP Packet header info (before addresses start) More...
 

Functions

FSTATIC gboolean _arpdiscovery_discover (Discovery *self)
 Discover member function for timed discovery – not applicable – return FALSE. More...
 
FSTATIC void _arpdiscovery_finalize (AssimObj *dself)
 finalize a ArpDiscovery object More...
 
FSTATIC gboolean _arpdiscovery_dispatch (GSource_pcap_t *gsource,pcap_t *capstruct,gconstpointer pkt,gconstpointer pend,const struct pcap_pkthdr *pkthdr,const char *capturedev,gpointer selfptr)
 Internal pcap gsource dispatch routine - called when we get an ARP packet. More...
 
FSTATIC void _arpdiscovery_sendarpcache (ArpDiscovery *self)
 Function for sending the ARP info in JSON to the CMA. More...
 
FSTATIC gboolean _arpdiscovery_gsourcefunc (gpointer gself)
 Function which periodically sends our ARP cache upstream. More...
 
FSTATIC gboolean _arpdiscovery_first_discovery (gpointer gself)
 A GSourceFunc to be called for the first (random) discovery only More...
 
ArpDiscoveryarpdiscovery_new (ConfigContext *arpconfig, gint priority, GMainContext *mcontext, NetGSource *iosrc, ConfigContext *config, gsize objsize)
 ArpDiscovery constructor - good for listening to ARP packets via pcap. More...
 

Detailed Description

vim: number colorcolumn=100

functions for handling standard client incoming ARP packet dispatch.

It passes off incoming ARP packet info to the appropriate functions.

This file is part of the Assimilation Project.

Author
Carrie Oswald (carri.nosp@m.e_os.nosp@m.wald@.nosp@m.yaho.nosp@m.o.com) Copyright (c) 2014,2016 - Assimilation Systems Limited
The Assimilation software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Assimilation software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the Assimilation Project software. If not, see http://www.gnu.org/licenses/

Definition in file arpdiscovery.c.