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

Add new method to init the stack with threads but no UDP encapsulation #532

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion usrsctplib/netinet/sctp_usrreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sctp_init(void)
SCTP_BASE_VAR(timer_thread_started) = 0;
#endif
#if defined(__Userspace__)
sctp_pcb_init(start_threads);
sctp_pcb_init(start_threads == 1);
if (start_threads) {
sctp_start_timer_thread();
}
Expand Down
10 changes: 10 additions & 0 deletions usrsctplib/user_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ usrsctp_init(uint16_t port,
}


void
usrsctp_init_noudpthread(uint16_t port,
int (*conn_output)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df),
void (*debug_printf)(const char *format, ...))
{
init_sync();
sctp_init(port, conn_output, debug_printf, 2);
}


void
usrsctp_init_nothreads(uint16_t port,
int (*conn_output)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df),
Expand Down
5 changes: 5 additions & 0 deletions usrsctplib/usrsctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,11 @@ usrsctp_init(uint16_t,
int (*)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df),
void (*)(const char *format, ...));

void
usrsctp_init_noudpthread(uint16_t,
int (*)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df),
void (*)(const char *format, ...));

void
usrsctp_init_nothreads(uint16_t,
int (*)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df),
Expand Down