/**
 * Copyright (C) 2021 Eric Martin
 * 
 * This file is part of wec-pcap-utils.
 * 
 * wec-pcap-utils 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.
 * 
 * wec-pcap-utils 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 wec-pcap-utils.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef RADAR_PCAP_H
#include <stdint.h>
#include <sys/time.h>
#include "radar_4g.h"

void pcap_packet_headers(const uint8_t *packet, const uint8_t **ip_header, const uint8_t **payload);
int pcap_fragment_info(const uint8_t * packet, uint16_t id, uint16_t offset, uint8_t flags);
uint8_t pcap_packet_is_fragment(const uint8_t * packet);

int radar_packet_channel(const uint8_t * packet);
uint16_t radar_packet_id(const uint8_t * packet);
uint16_t radar_packet_offset(const uint8_t * packet);
void print_radar_packet_info(const uint8_t * packet);
void print_radar_report_2C99(const uint8_t * packet);
void print_radar_frame(struct radar_frame_pkt * frame, struct timeval ts, char channel);
void decode_radar_frame(struct radar_frame_pkt * frame, struct timeval ts, uint8_t data[SCANS_PER_FRAME][SPOKELEN], double  time[SCANS_PER_FRAME], double angle[SCANS_PER_FRAME], int range[SCANS_PER_FRAME]);

#endif //RADAR_PCAP_H
