// $Id: pdinrs_udp.h,v 1.2 2005/01/11 19:56:03 pdi Exp $
/* Copyright 1998-2022 Stonie R. Cooper, Licensed under the auspices of GPLv3,
 *  *  See top-level copyright disclaimer (COPYRIGHT) and license (LICENSE) */
#ifndef PDINRS_UDP
#define PDINRS_UDP

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/select.h>
#include <net/if.h>
#include <sys/ioctl.h>

#include <pdinrs_distribution.h>
#include <pdinrs.h>

typedef struct
{
	unsigned char frame[MAXFRAMESIZE];
  signed short int frameSize;
	unsigned int sequenceNumber;
} UDPOrderFixType;

int pdinrs_udp_connect(struct sockaddr *sockAddress, 
											 socklen_t *sockLength,
											 char *serviceName,
											 char *serviceNumber,
											 char *deviceName);

signed short int pdinrs_udp_receive(int *sock, unsigned char *buffer, int buffer_size, time_t seconds);

// signed short int pdinrs_udp_receive(int *sock, int buffer_size, time_t seconds, UDPOrderFixType *frameArray, int UDPArraySize, int populated);
#endif
