Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PolyORB-HI-Ada
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
PolyORB-HI-Ada
Commits
fda31156
Commit
fda31156
authored
Jan 06, 2015
by
yoogx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Add SPARK_Mode Off
parent
691fd18f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
60 deletions
+62
-60
src/drivers/polyorb_hi_drivers_native_tcp_ip.adb
src/drivers/polyorb_hi_drivers_native_tcp_ip.adb
+62
-60
No files found.
src/drivers/polyorb_hi_drivers_native_tcp_ip.adb
View file @
fda31156
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--
Copyright (C) 2012 ESA & ISAE.
--
--
Copyright (C) 2012-2015 ESA & ISAE.
--
-- --
-- PolyORB HI is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
...
...
@@ -50,7 +50,9 @@ with POHICDRIVER_IP;
-- This package provides support for the TCP_IP device driver as
-- defined in the tcp_protocol.aadl AADLv2 model.
package
body
PolyORB_HI_Drivers_Native_TCP_IP
is
package
body
PolyORB_HI_Drivers_Native_TCP_IP
with
SPARK_Mode
=>
Off
is
pragma
Suppress
(
Elaboration_Check
,
PolyORB_HI_Generated
.
Transport
);
-- We do not want a pragma Elaborate_All to be implicitely
...
...
@@ -108,64 +110,64 @@ package body PolyORB_HI_Drivers_Native_TCP_IP is
pragma
Warnings
(
On
);
for
J
in
Name_Table
'
Range
loop
if
Name_Table
(
J
).
Variable
=
System
.
Null_Address
then
if
Name_Table
(
J
).
Location
.
L
=
0
then
Nodes
(
J
).
Address
:=
(
GNAT
.
Sockets
.
Family_Inet
,
GNAT
.
Sockets
.
No_Inet_Addr
,
GNAT
.
Sockets
.
No_Port
);
else
-- The structure of the location information is
-- "ip address port"
declare
S
:
constant
String
:=
PolyORB_HI
.
Utils
.
To_String
(
Name_Table
(
J
).
Location
);
Addr_First
,
Addr_Last
:
Integer
;
Port
:
Integer
;
First
:
Integer
;
Last
:
Integer
;
begin
First
:=
S
'
First
;
-- First parse the prefix "ip"
Last
:=
Parse_String
(
S
,
First
,
' '
);
if
S
(
First
..
Last
)
/=
"ip"
then
raise
Program_Error
with
"Invalid configuration"
;
end
if
;
-- Then, parse the address
First
:=
Last
+
2
;
Last
:=
Parse_String
(
S
,
First
,
' '
);
Addr_First
:=
First
;
Addr_Last
:=
Last
;
-- Finally the port
First
:=
Last
+
2
;
Last
:=
Parse_String
(
S
,
First
,
' '
);
Port
:=
Integer
'
Value
(
S
(
First
..
Last
));
Nodes
(
J
).
Address
:=
(
GNAT
.
Sockets
.
Family_Inet
,
GNAT
.
Sockets
.
Inet_Addr
(
S
(
Addr_First
..
Addr_Last
)),
GNAT
.
Sockets
.
Port_Type
(
Port
));
end
;
end
if
;
else
declare
Configuration
:
constant
IP_Conf_T
:=
To_IP_Conf_T_Acc
(
Name_Table
(
J
).
Variable
).
all
;
begin
Nodes
(
J
).
Address
:=
(
GNAT
.
Sockets
.
Family_Inet
,
GNAT
.
Sockets
.
Inet_Addr
(
Configuration
.
Address
),
GNAT
.
Sockets
.
Port_Type
(
Configuration
.
Port
));
end
;
end
if
;
if
Name_Table
(
J
).
Variable
=
System
.
Null_Address
then
if
Length
(
Name_Table
(
J
).
Location
)
=
0
then
Nodes
(
J
).
Address
:=
(
GNAT
.
Sockets
.
Family_Inet
,
GNAT
.
Sockets
.
No_Inet_Addr
,
GNAT
.
Sockets
.
No_Port
);
else
-- The structure of the location information is
-- "ip address port"
declare
S
:
constant
String
:=
PolyORB_HI
.
Utils
.
To_String
(
Name_Table
(
J
).
Location
);
Addr_First
,
Addr_Last
:
Integer
;
Port
:
Integer
;
First
:
Integer
;
Last
:
Integer
;
begin
First
:=
S
'
First
;
-- First parse the prefix "ip"
Last
:=
Parse_String
(
S
,
First
,
' '
);
if
S
(
First
..
Last
)
/=
"ip"
then
raise
Program_Error
with
"Invalid configuration"
;
end
if
;
-- Then, parse the address
First
:=
Last
+
2
;
Last
:=
Parse_String
(
S
,
First
,
' '
);
Addr_First
:=
First
;
Addr_Last
:=
Last
;
-- Finally the port
First
:=
Last
+
2
;
Last
:=
Parse_String
(
S
,
First
,
' '
);
Port
:=
Integer
'
Value
(
S
(
First
..
Last
));
Nodes
(
J
).
Address
:=
(
GNAT
.
Sockets
.
Family_Inet
,
GNAT
.
Sockets
.
Inet_Addr
(
S
(
Addr_First
..
Addr_Last
)),
GNAT
.
Sockets
.
Port_Type
(
Port
));
end
;
end
if
;
else
declare
Configuration
:
constant
IP_Conf_T
:=
To_IP_Conf_T_Acc
(
Name_Table
(
J
).
Variable
).
all
;
begin
Nodes
(
J
).
Address
:=
(
GNAT
.
Sockets
.
Family_Inet
,
GNAT
.
Sockets
.
Inet_Addr
(
Configuration
.
Address
),
GNAT
.
Sockets
.
Port_Type
(
Configuration
.
Port
));
end
;
end
if
;
end
loop
;
-- Create the local socket if the node is remote-callable
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment