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

Source address and add new address #41

Open
KatanaBit opened this issue Apr 7, 2022 · 4 comments
Open

Source address and add new address #41

KatanaBit opened this issue Apr 7, 2022 · 4 comments
Assignees

Comments

@KatanaBit
Copy link

Hello, who can tell me how to set a new source address, and how to add new addresses to the created association so that they can be seen by the remote party? Thank you in advance

@p1-bmu p1-bmu self-assigned this Apr 8, 2022
@p1-bmu
Copy link
Contributor

p1-bmu commented Apr 8, 2022

It's probably bindx() that you are looking for:

In [9]: from sctp import *                                                                                                                                

In [10]: sctpsocket.bindx?                                                                                                                                
Signature: sctpsocket.bindx(self, sockaddrs, action=1)
Docstring:
Binds to a list of addresses. This method() allows to bind to any subset 
of available interfaces, while standard bind() allows only one specific
interface, or all of them using the INADDR_ANY pseudo-address. Also, it
allows to *remove* the binding from one or more addresses.

If you don't need the extended functionality of bindx(), standard bind()
can be used and works as expected for SCTP.

Parameters:

sockaddr: List of (address, port) tuples.
action: BINDX_ADD or BINDX_REMOVE. Default is BINDX_ADD.

bindx() raises an exception if bindx() is not successful.
File:      /usr/local/lib/python3.8/dist-packages/pysctp-0.7.1-py3.8-linux-x86_64.egg/sctp.py
Type:      function

@KatanaBit
Copy link
Author

Can I trigger sending an event directly? Let's say after creating an association at one point in time I decided to add new addresses using the method bindx() (notifications about adding addresses are not automatically sent), how do I notify the remote party in this situation that I have added a new address?

@p1-bmu
Copy link
Contributor

p1-bmu commented Apr 11, 2022

There are many configuration possible regarding events and notification in the SCTP kernel API, which are wrapped by pysctp. Unfortunately I don't know how do solve your issue. In case you find a way to trigger such notifications to the remote peer, please keep us updated.
I guess you have to dig in the SCTP kernel API, and then in the docstrings provided in pysctp to see how to call it.

@KatanaBit
Copy link
Author

Then I will look, thanks for the help

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

No branches or pull requests

2 participants