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

RFC 9177: Add in Q-Block support #611

Merged
merged 1 commit into from
Jul 11, 2023
Merged

RFC 9177: Add in Q-Block support #611

merged 1 commit into from
Jul 11, 2023

Conversation

mrdeep1
Copy link
Collaborator

@mrdeep1 mrdeep1 commented Mar 5, 2021

examples/client.c:
examples/coap-server.c:

Add in Q-Block intelligence.

include/coap2/block.h
include/coap2/coap_block_internal.h
include/coap2/coap_event.h

Add in Q-Block references.
Add in new functions
coap_block_check_q_block1_xmit()
coap_block_check_q_block2_xmit()
coap_send_q_blocks()
coap_send_q_block1()
coap_send_q_block2()
coap_block_drop_resp_q_block_xmit()
coap_block_drop_resp_q_block2_crcv()

include/coap2/coap_session.h:

Add in new Congestion Control defaults and ability to configure them.

include/coap2/coap_subscribe_internal.h:
include/coap2/resource.h:

Support Q-Block2 as well for subscriptions.

include/coap2/pdu.h:

Add in the new options.

libcoap-2.map:
libcoap-2.sym:

Expose external Congestion Control functions.

man/coap-client.txt.in:
man/coap-server.txt.in:
man/coap_block.txt.in:
man/coap_handler.txt.in:

Add in Q-Block information.

src/block.c:

Add in the new functions to support Q-Block.

src/coap_debug.c:

Output the new options as appropriate.

src/coap_io.c:

Check for Q-Block transmission timeouts.

src/coap_session.c:

Add in the Congestion Control support.

src/net.c:
src/pdu.c:
src/resource.c:

Add in Q-Block support.

Copy link
Owner

@obgm obgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a first quick review, and this looks good to me. There is a bit of garbled whitespace that could be cleaned up later. Also, there are some changes that do not directly relate to this PR but I think it would be too difficult to strip them out at this stage.

src/net.c Outdated Show resolved Hide resolved
src/net.c Outdated Show resolved Hide resolved
src/block.c Outdated Show resolved Hide resolved
src/block.c Outdated
coap_delete_pdu(session->saved_pdu);
session->saved_pdu = actual;
return coap_send_internal(session, pdu);
if ((mid = coap_send_internal(session, pdu)) == COAP_INVALID_MID)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much cleaner now. I suggest the following to make the code a bit more readable (as done in other parts):

mid = coap_send_internal(....);
if (mid != COAP_INVALID_MID) {
  session->remote_test_mid = mid;
}
return mid;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with suggestion

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better. But now it reads:

if (x)
  return x;
do_y();
return x;

Which looks a bit weird. But feel free to keep it this way since it is neither wrong nor overly complex.

src/net.c Show resolved Hide resolved
examples/coap-client.c:
examples/coap-server.c:

Add in Q-Block intelligence.

include/coap3/block.h
include/coap3/coap_block_internal.h
include/coap3/coap_event.h

Add in Q-Block references.
Add in new functions
coap_block_check_q_block1_xmit()
coap_block_check_q_block2_xmit()
coap_send_q_blocks()
coap_send_q_block1()
coap_send_q_block2()
coap_block_drop_resp_q_block_xmit()
coap_block_drop_resp_q_block2_crcv()
coap_q_block_is_supported()

include/coap3/coap_session.h:

Add in new Congestion Control defaults and ability to configure them.

include/coap3/pdu.h:

Add in the new options.

libcoap-3.map:
libcoap-3.sym:

Expose external Congestion Control functions.

man/coap-client.txt.in:
man/coap-server.txt.in:
man/coap_block.txt.in:
man/coap_handler.txt.in:
man/coap_recovery.txt.in:
man/coap.txt.in:

Add in Q-Block information.

src/block.c:

Add in the new functions to support Q-Block.

src/coap_debug.c:

Output the new options as appropriate.

src/coap_io.c:

Check for Q-Block transmission timeouts.

src/coap_session.c:

Add in the Congestion Control support.

src/net.c:
src/resource.c:

Add in Q-Block support.

configure.ac
CMakeLists.txt

Add in support for enabling/disabling Q-Block support (enabled by default).
Copy link
Owner

@obgm obgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mrdeep1
Copy link
Collaborator Author

mrdeep1 commented Jul 11, 2023

Thanks for doing the review.

@mrdeep1 mrdeep1 merged commit 57013f3 into obgm:develop Jul 11, 2023
@mrdeep1 mrdeep1 deleted the q-block branch July 11, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants