Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
4a2b817f
Commit
4a2b817f
authored
May 22, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed binding to socket when initializing swap-method
parent
52ec0f01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
4 deletions
+59
-4
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
+59
-4
No files found.
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
View file @
4a2b817f
/*
* Proview $Id: rt_io_m_ssab_remoterack.c,v 1.
6 2007-05-18 12:06:05
claes Exp $
* Proview $Id: rt_io_m_ssab_remoterack.c,v 1.
7 2007-05-22 07:14:58
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -40,6 +40,61 @@
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackInitSwap
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
io_sRackLocal
*
local
;
pwr_sClass_Ssab_RemoteRack
*
op
;
int
sts
;
op
=
(
pwr_sClass_Ssab_RemoteRack
*
)
rp
->
op
;
local
=
calloc
(
1
,
sizeof
(
*
local
));
rp
->
Local
=
local
;
/* Create socket, store in local struct */
local
->
s
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
if
(
local
->
s
<
0
)
{
errh_Error
(
"Error creating socket for IO remote rack %s, %d"
,
rp
->
Name
,
local
->
s
);
op
->
Status
=
IO__INITFAIL
;
return
IO__ERRINIDEVICE
;
}
/* Initialize remote address structure */
local
->
rem_addr
.
sin_family
=
AF_INET
;
local
->
rem_addr
.
sin_port
=
htons
(
op
->
RemotePort
);
local
->
rem_addr
.
sin_addr
.
s_addr
=
inet_addr
((
char
*
)
&
(
op
->
Address
));
/* Connect to remote address */
sts
=
connect
(
local
->
s
,
(
struct
sockaddr
*
)
&
local
->
rem_addr
,
sizeof
(
local
->
rem_addr
));
if
(
sts
!=
0
)
{
errh_Error
(
"Error binding remote socket for IO remote rack %s, %d"
,
rp
->
Name
,
sts
);
op
->
Status
=
IO__INITFAIL
;
return
IO__ERRINIDEVICE
;
}
local
->
next_read_req_item
=
0
;
local
->
next_write_req_item
=
0
;
op
->
RX_packets
=
0
;
op
->
TX_packets
=
0
;
/* Log initialization */
errh_Info
(
"Init of IO remote rack %s/%s:%d"
,
rp
->
Name
,
inet_ntoa
(
local
->
rem_addr
.
sin_addr
),
ntohs
(
local
->
rem_addr
.
sin_port
));
op
->
Status
=
IO__NORMAL
;
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackInit
(
...
...
@@ -149,12 +204,12 @@ static pwr_tStatus IoRackSwap (
int
size
;
if
(
!
rp
->
Local
)
{
sts
=
IoRackInit
(
ctx
,
ap
,
rp
);
sts
=
IoRackInitSwap
(
ctx
,
ap
,
rp
);
if
(
sts
!=
IO__SUCCESS
)
return
IO__ERRINIDEVICE
;
}
local
=
(
io_sRackLocal
*
)
rp
->
Local
;
op
=
(
pwr_sClass_Ssab_RemoteRack
*
)
rp
->
op
;
...
...
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