Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
e78c0146
Commit
e78c0146
authored
22 years ago
by
tewk
Browse files
Options
Downloads
Patches
Plain Diff
went back to typedefing sockaddr_in to slurm_addr
parent
735be7c1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/slurm_protocol_common.h
+5
-2
5 additions, 2 deletions
src/common/slurm_protocol_common.h
src/common/slurm_protocol_socket_implementation.c
+8
-8
8 additions, 8 deletions
src/common/slurm_protocol_socket_implementation.c
with
13 additions
and
10 deletions
src/common/slurm_protocol_common.h
+
5
−
2
View file @
e78c0146
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
# include <inttypes.h>
# include <inttypes.h>
#endif
/* HAVE_CONFIG_H */
#endif
/* HAVE_CONFIG_H */
#include
<netinet/in.h>
#define AF_SLURM AF_INET
#define AF_SLURM AF_INET
#define SLURM_INADDR_ANY 0x00000000
#define SLURM_INADDR_ANY 0x00000000
...
@@ -23,12 +24,14 @@
...
@@ -23,12 +24,14 @@
typedef
uint32_t
slurm_fd
;
typedef
uint32_t
slurm_fd
;
/* this is the slurm equivalent of the BSD sockets sockaddr */
/* this is the slurm equivalent of the BSD sockets sockaddr */
typedef
struct
{
typedef
struct
sockaddr_in
slurm_addr
;
/*struct kevin {
int16_t family ;
int16_t family ;
uint16_t port ;
uint16_t port ;
uint32_t address ;
uint32_t address ;
char pad[16 - sizeof ( int16_t ) - sizeof (uint16_t) - sizeof (uint32_t) ] ;
char pad[16 - sizeof ( int16_t ) - sizeof (uint16_t) - sizeof (uint32_t) ] ;
}
slurm_addr
;
} ;
*/
/* SLURM datatypes */
/* SLURM datatypes */
/* this is a custom data type to describe the slurm msg type type that is placed in the slurm protocol header
/* this is a custom data type to describe the slurm msg type type that is placed in the slurm protocol header
...
...
This diff is collapsed.
Click to expand it.
src/common/slurm_protocol_socket_implementation.c
+
8
−
8
View file @
e78c0146
...
@@ -391,9 +391,9 @@ extern int _slurm_ioctl(int d, int request, ...)
...
@@ -391,9 +391,9 @@ extern int _slurm_ioctl(int d, int request, ...)
/* sets the fields of a slurm_addr */
/* sets the fields of a slurm_addr */
void
_slurm_set_addr_uint
(
slurm_addr
*
slurm_address
,
uint16_t
port
,
uint32_t
ip_address
)
void
_slurm_set_addr_uint
(
slurm_addr
*
slurm_address
,
uint16_t
port
,
uint32_t
ip_address
)
{
{
slurm_address
->
family
=
AF_SLURM
;
slurm_address
->
sin_
family
=
AF_SLURM
;
slurm_address
->
port
=
htons
(
port
)
;
slurm_address
->
sin_
port
=
htons
(
port
)
;
slurm_address
->
addr
ess
=
htonl
(
ip_address
)
;
slurm_address
->
sin_addr
.
s_
addr
=
htonl
(
ip_address
)
;
}
}
/* sets the fields of a slurm_addr */
/* sets the fields of a slurm_addr */
...
@@ -404,14 +404,14 @@ void _slurm_set_addr ( slurm_addr * slurm_address , uint16_t port , char * host
...
@@ -404,14 +404,14 @@ void _slurm_set_addr ( slurm_addr * slurm_address , uint16_t port , char * host
void
_slurm_set_addr_char
(
slurm_addr
*
slurm_address
,
uint16_t
port
,
char
*
host
)
void
_slurm_set_addr_char
(
slurm_addr
*
slurm_address
,
uint16_t
port
,
char
*
host
)
{
{
struct
hostent
*
host_info
=
gethostbyname
(
host
)
;
struct
hostent
*
host_info
=
gethostbyname
(
host
)
;
memcpy
(
&
slurm_address
->
addr
ess
,
&
host_info
->
h_addr
,
host_info
->
h_length
)
;
memcpy
(
&
slurm_address
->
sin_addr
.
s_
addr
,
&
host_info
->
h_addr
,
host_info
->
h_length
)
;
slurm_address
->
family
=
AF_SLURM
;
slurm_address
->
sin_
family
=
AF_SLURM
;
slurm_address
->
port
=
htons
(
port
)
;
slurm_address
->
sin_
port
=
htons
(
port
)
;
}
}
void
_slurm_get_addr
(
slurm_addr
*
slurm_address
,
uint16_t
*
port
,
char
*
host
,
unsigned
int
buf_len
)
void
_slurm_get_addr
(
slurm_addr
*
slurm_address
,
uint16_t
*
port
,
char
*
host
,
unsigned
int
buf_len
)
{
{
struct
hostent
*
host_info
=
gethostbyaddr
(
(
char
*
)
&
(
slurm_address
->
address
)
,
sizeof
(
slurm_address
->
addr
ess
)
,
AF_SLURM
)
;
struct
hostent
*
host_info
=
gethostbyaddr
(
(
char
*
)
&
(
slurm_address
->
sin_addr
.
s_addr
)
,
sizeof
(
slurm_address
->
sin_addr
.
s_
addr
)
,
AF_SLURM
)
;
*
port
=
slurm_address
->
port
;
*
port
=
slurm_address
->
sin_
port
;
strncpy
(
host
,
host_info
->
h_name
,
buf_len
)
;
strncpy
(
host
,
host_info
->
h_name
,
buf_len
)
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment