pysctp icon indicating copy to clipboard operation
pysctp copied to clipboard

Source address and add new address

Open KatanaBit opened this issue 2 years ago • 4 comments

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

KatanaBit avatar Apr 07 '22 20:04 KatanaBit

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

p1-bmu avatar Apr 08 '22 08:04 p1-bmu

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?

KatanaBit avatar Apr 10 '22 20:04 KatanaBit

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.

p1-bmu avatar Apr 11 '22 07:04 p1-bmu

Then I will look, thanks for the help

KatanaBit avatar Apr 11 '22 16:04 KatanaBit