/* 
 * File         : epackage.h
 * Author       : Joe Churchwell
 * Purpose      : Header file for the Ethernet Package
 * Created on February 25, 2013, 8:40 AM
 */

#ifndef EPACKAGE_H
#define	EPACKAGE_H

#ifdef	__cplusplus
extern "C" {
#endif

// STD Include files
#include <stdio.h>
#include <stdlib.h>
#include <cstdlib>
#include <string.h>
#include <sys/types.h> 
#include <WinSock2.h> 

/************************* Define Macros **************************************/

#define MAX_BUFFER_SIZE 65536
#define MAX_DEVICE_IDS 256
#define NO_FLAG 0
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#define IPV4_NETWORK_NUMBER 192
#define IPV4_SUB_NETWORK_NUMBER 168
#define IPV4_LOCAL_GROUP 1
#define DHCP_CONNECTED 1
#define DHCP_NOT_CONNECTED 0
#define NULL 0

#define MSG_DONTWAIT	0x10		/* selective non-blocking operation */
    
// Error messages
#define ERROR_OPENING_SOCKET 255
#define ERROR_ON_BINDING 254
    
// Define Protocol
#define UDP IPPROTO_UDP
#define TCP_IP IPPROTO_TCP
#define PROTOCOL UDP
    
// Define ports
#define COMMUNICATION_SOCKET 5001
    
/*
 * DHCP Define statements
 * DHCP uses the same two ports assigned by IANA for BOOTP: 
 * destination UDP port 67 for sending data to the server, 
 * and UDP port 68 for data to the client. 
 * DHCP communications are connection-less in nature.
 */
#define DHCP_PORT_TO_CLIENT 68
#define DHCP_PORT_TO_SERVER 67


    
/*********************** Define Macro Functions *******************************/
    
    

/************************ Prototypes ******************************************/

    
#ifdef	__cplusplus
}
#endif

#endif	/* EPACKAGE_H */

