Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMRSOCK API: Implementing omrsock_setsockopt and omrsock_getsockopt functions on Unix #5158

Closed
9 tasks done
caohaley opened this issue May 6, 2020 · 0 comments
Closed
9 tasks done

Comments

@caohaley
Copy link
Contributor

caohaley commented May 6, 2020

Working on Issue: #4102
/cc @rwy0717 @mpirvu

The minimal socket api for Unix is done being implemented and is currently waiting to be merged. However, these functions need to be added for the JITServer team functionalities and will be the last functions to be implemented.

Omrsock functions to be implemented:
omrsock_setsockopt_int, omrsock_setsockopt_linger, j9sock_linger_init, omrsock_setsockopt_timeval, j9sock_timeval_init

omrsock_getsockopt_int, omrsock_getsockopt_linger, omrsock_getsockopt_timeval

Descriptions

setsockopt basically configures the socket options at a specifed level, usually at the socket level SOL_SOCKET but could be different depending on what option you set. The function prototype for systemsetsockopt is:

int setsockopt(int s, int optionLevel, int optionName, const void *optionValue, socklen_t optionLength);

Depending on the option you set, it may belong to a different option level, and may require you to input a specific value type, such as a pointer to integer, boolean, linger struct, timeval struct and so on (thus it takes in a void *), and have you specify the length.

getsockopt essentially does the opposite where the users pass in a preallocated buffer and the function call fills in the buffer with the current configuration of the socket for that option. The function prototype for systemgetsockopt is:

int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen);

Implementation Details:

The options that will be supported first will be the ones that JITServer currently uses in the code including:

  • SO_REUSEADDR
  • SO_KEEPALIVE
  • SO_LINGER
  • SO_RCVTIMEO
  • SO_SNDTIMEO
  • TCP_NODELAY

We will introduce two new data types in omrportsocktypes.h:

  • struct omrsock_timeval that contains struct timeval
    and
  • struct omrsock_linger that contains struct linger

We will also introduce two corresponding init functions: j9sock_timeval_init and j9sock_linger_init to fill in the value of these two option values.

Because of the user isolation and they can not directly modify the option values, we will need to implement three different functions rather than the one in system socket api. We will separate the option value types into integer, struct timeval and struct linger.

Thus, there will be a different function call for each of the different option types: omrsock_setsockopt_int, omrsock_setsockopt_linger, omrsock_setsockopt_timeval.

However, all three functions will be just set up to call the system socket api setsockopt and getsockopt functions. It will be tested to see if it works on all Unix systems and if there is anything to be added.

Unix Progress Tracker

caohaley pushed a commit to caohaley/omr that referenced this issue May 20, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 21, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 21, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 22, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 22, 2020
Added internal functions and implementations for sockopt functions

- Added 3 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, one to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 22, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 22, 2020
Added internal functions and implementations for sockopt functions

- Added 3 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, one to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 22, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 26, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 26, 2020
Added internal functions and implementations for sockopt functions

- Added 3 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, one to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 26, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 28, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 28, 2020
Added internal functions and implementations for sockopt functions

- Added 3 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, one to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue May 28, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 15, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 15, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 15, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 15, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.
- Assign the size of option value to socklen_t optlen before passing
  into the setsockopt and getsockopt options to avoid inconsistent
  error due to int to socklen_t conversion.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 15, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 15, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 16, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 16, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 16, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 16, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 22, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 22, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 22, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 22, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 22, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 22, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 24, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 25, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 25, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 26, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 26, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 26, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 29, 2020
Setting up socket option definitions and function prototype

- Set up omrsock_linger_t pointer, OMRLinger struct to be used
  in the linger socket option.
- Set up omrsock_timeval_t pointer, OMRTimeval struct to be used
  in the timeval socket option.
- Set up omr public socket option definitions and private os
  socket option definitions.
- Set up functions prototypes for the socket option related
  functions for types integer, timeval and linger struct.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 29, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 29, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 29, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 29, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 29, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jun 29, 2020
Added a new test socket_options that calls set/get sockopt

- Added test that initializes timeval and linger structs.
- Created a socket and set options including keepalive, linger,
  rcvtimeo, sndtimeo, tcp_nodelay.
- Get the same options and compare with values inputted into
  set options, and make sure they are the same.
- Added new operator equal functions to check if timeval
  and linger structs are equal and custom print functions
  for gtest.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
caohaley pushed a commit to caohaley/omr that referenced this issue Jul 2, 2020
Added internal functions and implementations for sockopt functions

- Added 4 internal functions: one to retrieve OMR to OS mapping
  for socket levels, one to retrieve OMR to OS mapping for socket
  options, two to wrap the code for the socket option functions
  to reduce clutter.
- Added simple implemnentations for the 6 socket options functions.

Issue: eclipse-omr#5158

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
@caohaley caohaley closed this as completed Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants