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

Fix #1398, separate bind and listen calls for streams #1399

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
Add OS_SocketBindAddress() and OS_SocketListen() to allow users to bind an address without also calling listen(). The use case is for client side connections where the source port needs to be controlled.

Fixes #1398

Testing performed
Steps taken to test the contribution:

  1. Build steps '...'
  2. Execution steps '...'

Expected behavior changes
Users can call OS_SocketBindAddress() to bind a specific port/address for client-side connections

System(s) tested on
Debian

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Add OS_SocketBindAddress() and OS_SocketListen() to allow users to bind
an address without also calling listen().  The use case is for client
side connections where the source port needs to be controlled.
@jphickey jphickey added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Jul 27, 2023
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_SocketBindAddress(osal_id_t sock_id, const OS_SockAddr_t *Addr)

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
* Generated stub function for OS_SocketBindAddress()
* ----------------------------------------------------
*/
int32 OS_SocketBindAddress(osal_id_t sock_id, const OS_SockAddr_t *Addr)

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_SocketListen(osal_id_t sock_id)

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
* Generated stub function for OS_SocketListen()
* ----------------------------------------------------
*/
int32 OS_SocketListen(osal_id_t sock_id)

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
* See prototype for argument/return detail
*
*-----------------------------------------------------------------*/
int32 OS_SocketListen_Impl(const OS_object_token_t *token)

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
@@ -214,16 +214,14 @@
* See prototype for argument/return detail
*
*-----------------------------------------------------------------*/
int32 OS_SocketBind_Impl(const OS_object_token_t *token, const OS_SockAddr_t *Addr)
int32 OS_SocketBindAddress_Impl(const OS_object_token_t *token, const OS_SockAddr_t *Addr)

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
@dzbaker dzbaker added CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Jul 27, 2023
dzbaker added a commit to nasa/cFS that referenced this pull request Jul 27, 2023
*Combines:*

cFE v7.0.0-rc4+dev356
osal v6.0.0-rc4+dev223

**Includes:**

*cFE*
- nasa/cFE#2416

*osal*
- nasa/osal#1397
- nasa/osal#1399

Co-authored by: Joseph Hickey <[email protected]>
@dzbaker dzbaker mentioned this pull request Jul 27, 2023
2 tasks
@dzbaker dzbaker merged commit 4c3426d into nasa:main Jul 27, 2023
19 checks passed
dzbaker added a commit to nasa/cFS that referenced this pull request Jul 27, 2023
*Combines:*

cFE v7.0.0-rc4+dev356
osal v6.0.0-rc4+dev223

**Includes:**

*cFE*
- nasa/cFE#2416

*osal*
- nasa/osal#1397
- nasa/osal#1399

Co-authored by: Joseph Hickey <[email protected]>
@dmknutsen dmknutsen added this to the Equuleus milestone Sep 1, 2023
@jphickey jphickey deleted the fix-1398-socketbind branch November 16, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB Equuleus-rc1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Socket API needs method to control source port for TCP client
3 participants