-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcdp_functions.h
30 lines (25 loc) · 1.35 KB
/
cdp_functions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <EtherCard.h>
#include <Arduino.h>
#include "Packet_Data.h";
#ifndef CDP_FUNCTIONS_H
#define CDP_FUNCTIONS_H
//Main fuctions
unsigned int cdp_check_Packet(int plen, byte EthBuffer[], int bufSize );
PINFO cdp_packet_handler( byte cdpData[], size_t plen);
//Packet Handling Functions
String handleCdpCapabilities( const byte a[], unsigned int offset, unsigned int lengtha);
String handleCdpNumField( const byte a[], unsigned int offset, unsigned int length);
String handleCdpVoiceVLAN( const byte a[], unsigned int offset, unsigned int length);
String handleCdpAddresses(const byte a[], unsigned int offset, unsigned int length);
String handleCdpDuplex(const byte a[], unsigned int offset, unsigned int length);
String handleCdpAsciiField(byte a[], unsigned int offset, unsigned int lengtha);
//Supporting Functions
bool byte_array_contains(const byte a[], unsigned int offset, const byte b[], unsigned int length);
String print_mac(const byte a[], unsigned int offset, unsigned int length);
String CdpCapabilities(String temp);
String print_binary(int v, int num_places);
String print_ip(const byte a[], unsigned int offset, unsigned int length);
String print_mac(const byte a[], unsigned int offset, unsigned int length);
char val2dec(byte b);
String cdp_getHEX(const byte a[], unsigned int offset, unsigned int length) ;
#endif