Commit f1cea802 authored by jdelange's avatar jdelange

* src/drivers/configuration/

   include/drivers/configuration/
   - Update drivers data types definition
     with gateway, broadcast and netmask values
     to be used by the RTEMS driver





git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@3093 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 5107c14c
......@@ -2,8 +2,8 @@
#define _INC_1553_H
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:56:58
Date was: 9/1/2011
Time was: 17:02:16
*/
#include "asn1crt.h"
......
......@@ -2,8 +2,8 @@
#define _INC_IP_H
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:56:59
Date was: 9/1/2011
Time was: 17:02:16
*/
#include "asn1crt.h"
......@@ -50,17 +50,25 @@ flag __po_hi_c_Version_T_IsConstraintValid(const __po_hi_c_Version_T* val, int*
typedef struct {
char devname[21];
char address[41];
char broadcast[41];
char netmask[41];
char gateway[41];
char dns[41];
__po_hi_c_Version_T version;
__po_hi_c_Port_T port;
struct {
unsigned int broadcast:1;
unsigned int netmask:1;
unsigned int gateway:1;
unsigned int dns:1;
unsigned int version:1;
} exist;
} __po_hi_c_ip_conf_t;
#define __po_hi_c_ip_conf_t_REQUIRED_BYTES_FOR_ENCODING 56
#define __po_hi_c_ip_conf_t_REQUIRED_BITS_FOR_ENCODING 448
#define __po_hi_c_ip_conf_t_REQUIRED_BYTES_FOR_ACN_ENCODING 64
#define __po_hi_c_ip_conf_t_REQUIRED_BITS_FOR_ACN_ENCODING 508
#define __po_hi_c_ip_conf_t_REQUIRED_BYTES_FOR_ENCODING 200
#define __po_hi_c_ip_conf_t_REQUIRED_BITS_FOR_ENCODING 1596
#define __po_hi_c_ip_conf_t_REQUIRED_BYTES_FOR_ACN_ENCODING 227
#define __po_hi_c_ip_conf_t_REQUIRED_BITS_FOR_ACN_ENCODING 1816
#ifndef ERR___po_hi_c_ip_conf_t_devname
#define ERR___po_hi_c_ip_conf_t_devname 1002 /* (SIZE (1..20)) */
......@@ -68,6 +76,18 @@ typedef struct {
#ifndef ERR___po_hi_c_ip_conf_t_address
#define ERR___po_hi_c_ip_conf_t_address 1003 /* (SIZE (1..40)) */
#endif
#ifndef ERR___po_hi_c_ip_conf_t_broadcast
#define ERR___po_hi_c_ip_conf_t_broadcast 1004 /* (SIZE (1..40)) */
#endif
#ifndef ERR___po_hi_c_ip_conf_t_netmask
#define ERR___po_hi_c_ip_conf_t_netmask 1005 /* (SIZE (1..40)) */
#endif
#ifndef ERR___po_hi_c_ip_conf_t_gateway
#define ERR___po_hi_c_ip_conf_t_gateway 1006 /* (SIZE (1..40)) */
#endif
#ifndef ERR___po_hi_c_ip_conf_t_dns
#define ERR___po_hi_c_ip_conf_t_dns 1007 /* (SIZE (1..40)) */
#endif
void __po_hi_c_ip_conf_t_Initialize(__po_hi_c_ip_conf_t* pVal);
flag __po_hi_c_ip_conf_t_IsConstraintValid(const __po_hi_c_ip_conf_t* val, int* pErrCode);
......
......@@ -2,8 +2,8 @@
#define _INC_SERIAL_H
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:56:59
Date was: 9/1/2011
Time was: 17:02:17
*/
#include "asn1crt.h"
......
......@@ -2,8 +2,8 @@
#define _INC_SPACEWIRE_H
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:57:00
Date was: 9/1/2011
Time was: 17:02:18
*/
#include "asn1crt.h"
......
#if (defined (__PO_HI_NEED_DRIVER_1553_RASTA))\n
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:56:58
Date was: 9/1/2011
Time was: 17:02:16
*/
#include <string.h>
#include <math.h>
......
......@@ -8,6 +8,10 @@ Version-T ::= ENUMERATED {ipv4,ipv6}
IP-Conf-T ::= SEQUENCE {
devname IA5String (SIZE (1..20)),
address IA5String (SIZE (1..40)),
broadcast IA5String (SIZE (1..40)) OPTIONAL,
netmask IA5String (SIZE (1..40)) OPTIONAL,
gateway IA5String (SIZE (1..40)) OPTIONAL,
dns IA5String (SIZE (1..40)) OPTIONAL,
version Version-T DEFAULT ipv4,
port Port-T
}
......
#if (defined (__PO_HI_NEED_DRIVER_SOCKETS) || defined (__PO_HI_NEED_DRIVER_RTEMS_NE2000_SOCKETS))\n
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:56:59
Date was: 9/1/2011
Time was: 17:02:17
*/
#include <string.h>
#include <math.h>
......@@ -62,6 +62,10 @@ void __po_hi_c_ip_conf_t_Initialize(__po_hi_c_ip_conf_t* pVal)
{
memset(pVal->devname, 0x0, 21);
memset(pVal->address, 0x0, 41);
memset(pVal->broadcast, 0x0, 41);
memset(pVal->netmask, 0x0, 41);
memset(pVal->gateway, 0x0, 41);
memset(pVal->dns, 0x0, 41);
pVal->version = __po_hi_c_ipv4;
pVal->port = 0;
}
......@@ -77,6 +81,30 @@ flag __po_hi_c_ip_conf_t_IsConstraintValid(const __po_hi_c_ip_conf_t* pVal, int*
*pErrCode = ERR___po_hi_c_ip_conf_t_address;
return FALSE;
}
if (pVal->exist.broadcast) {
if ( !(((strlen(pVal->broadcast)>=1) && (strlen(pVal->broadcast)<=40))) ) {
*pErrCode = ERR___po_hi_c_ip_conf_t_broadcast;
return FALSE;
}
}
if (pVal->exist.netmask) {
if ( !(((strlen(pVal->netmask)>=1) && (strlen(pVal->netmask)<=40))) ) {
*pErrCode = ERR___po_hi_c_ip_conf_t_netmask;
return FALSE;
}
}
if (pVal->exist.gateway) {
if ( !(((strlen(pVal->gateway)>=1) && (strlen(pVal->gateway)<=40))) ) {
*pErrCode = ERR___po_hi_c_ip_conf_t_gateway;
return FALSE;
}
}
if (pVal->exist.dns) {
if ( !(((strlen(pVal->dns)>=1) && (strlen(pVal->dns)<=40))) ) {
*pErrCode = ERR___po_hi_c_ip_conf_t_dns;
return FALSE;
}
}
if (pVal->exist.version) {
if ( !__po_hi_c_Version_T_IsConstraintValid(&pVal->version, pErrCode))
return FALSE;
......
#if (defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_RECEIVER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_RASTA) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_RECEIVER))\n
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:56:59
Date was: 9/1/2011
Time was: 17:02:17
*/
#include <string.h>
#include <math.h>
......
#if (defined (__PO_HI_NEED_DRIVER_SPACEWIRE_RASTA))\n
/*
Code automatically generated by asn1scc tool
Date was: 7/11/2011
Time was: 15:57:00
Date was: 9/1/2011
Time was: 17:02:18
*/
#include <string.h>
#include <math.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment