Age | Commit message (Collapse) | Author | Files | Lines |
|
This provides us with proper logical separation between client and
server in the documentation.
Change-Id: I9e037fedaecb78396f435577b1652284b4951ded
|
|
Change-Id: I1196c3b035f495c5dbaa4d47ce3f79a08d0727f2
|
|
Let's enable the OSMO_IO_FD_MODE_RECVMSG_SENDMSG mode for SCTP
sockets, allowing OSMO_STREAM_MODE_OSMO_IO to be used with SCTP.
Change-Id: I6cf5bad5f618e71c80017960c38009b089dbd6a1
Depends: libosmocore Change-Id: I89eb519b22d21011d61a7855b2364bc3c295df82
Closes: OS#5753
|
|
*Move the helper function to stream.c and pass a logging prefix string
so that it can be used by both client and server.
* Adapt log level based on message type.
* Rework logging code to log everything in one line
Change-Id: I0ed84cc2effb71b6ef1f6efb3f8b663c602a5a31
|
|
The dev/user in general is only interested about one side of the stream
when looking at the code. Since the stream.c file is tarting to be quite
large/bloated, this patch splits its content into stream_cli.c and
stream_srv.c to make it easier to improve/extend and review.
Keep common code between cli and srv in stream.c, and add a private header
to contain references to it.
Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
|
|
Change-Id: Id082a9473b788f8de20cdc2ba4430b3289f4ce5a
|
|
Change-Id: I29621ca53cdbdf8b5b2d128307fcb6432db669d3
Depends: Ieed10bc94c8aad821c0a8f7764db0e05c054c1e3 (libosmocore.git)
|
|
That function is used by the srv_link object, not the srv object. Rename
it to avoid confusion.
Change-Id: I1a3870b3a269b84ac2a9285ee6fe3389c5c96a94
|
|
Specially important is the change where we now print the remote port
which connected to us, not our local port (which is already printed as
part of LOGSLNK).
Change-Id: I6e556f8263496ded41bb221ccc8e193c5361697f
|
|
It was later decided that since setting a name is not really required,
it is best to leave it out of the create() function and let the user use
the osmo_stream_srv_set_name() API if needed (otherwise a dynamic name
based on socket is selected)
Change-Id: I5d677ef57b7db0aedd8c43282568c845097cb12b
|
|
It was later decided that since setting a name is not really required,
it is best to leave it out of the create() function and let the user use
the osmo_stream_cli_set_name() API if needed (otherwise a dynamic name
based on socket is selected).
Change-Id: I2a2fad318ef22c2ac117f95588a078ca3beccea5
|
|
Since the local port is logged now in stream_test, it must be set to
a specific value in order to have deterministic log output being
validated.
Change-Id: I17ef699dab72c1b613708070d22e9f040b0fe069
|
|
Depends: libosmocore.git Change-Id If2772a3ccaa98616e0189862a49ab0243435e343
Change-Id: I539a0d29d11348efe702f971965a55cf56db5c59
|
|
Fixes recent crashes in ttcn-cbc-test
Change-Id: I40ceb17c32d1f58f8d0eeda8d1d794cf3f478e83
Related: OS#6063
|
|
This function should never be called if we don't have a valid fd.
Change-Id: If0bed2bae556e0a8233e9e66e82c70a5c677fc3c
Fixes: Coverity CID#321045
|
|
Simply call osmo_stream_cli_create2() with name ""
Change-Id: I0652361a6bdf194545f36edc5e12e5d26798163a
|
|
Change-Id: I0c2f46e02d94c3459e4043a9db7fccd906521dd2
|
|
Don't reset the osmo_fd data in osmo_stream_cli_set_read_cb().
osmo_ss7_asp_restart() in libosmo-sccp calls
osmo_stream_cli_set_read_cb() which causes the fd to be set to -1.
osmo_stream_cli_open() which is called after that then doesn't close the
old fd and opening the new one fails.
osmo_fd priv_nr, callback and data are never modified in osmo_stream_cli
so simply use these values in osmo_stream_cli_open()
Change-Id: Id9b4db06d5ea1f29cbd1817cab3c71765ab30a53
|
|
Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c
|
|
If cli is in STREAM_CLI_STATE_WAIT_RECONNECT cli->timer is scheduled.
Delete the timer if osmo_steam_cli_close() called so we don't end up
reconnecting. Also fixes the recent test failures in
master-libosmo-sccp Jenkins jobs.
Change-Id: Ic5227432192c4007f861f171ae961a8f4dea6522
|
|
Change-Id: I92231528da08f8891e20c1226b61989a65e00ccd
|
|
Change-Id: I418377eabd465ee4ffce9b4440e96287c7734924
|
|
Change-Id: Ife20b9d18e6ca86a06991d68165694e31052c58a
|
|
Change-Id: I8a9d27856ebdd5405b1977d12e91f8dcbdcd1d6b
|
|
Change-Id: I12d74e9b407f1ea7af83fb3ec4d03ad7228a27cf
|
|
to cli
Change-Id: I742db401165477f85e66bb428f156ecbbd5d6665
|
|
This will become useful once osmo_io can be used as a backend.
Change-Id: I7e964dea0adee8edbb9b75d2d17e7d0c5d8917d5
|
|
In osmo_stream_srv_send(), call msgb_free() if the msgb is not enqueued.
Before this, osmo_stream_srv_send() enqueues a msgb, assuming the queue
will free it. But if OSMO_STREAM_SRV_F_FLUSH_DESTROY is set, it just
returns and drops the msgb. There is no rc, so the caller cannot know.
Change-Id: I994c5e06a9030cfbf4fca8ab42588c61f7121cee
|
|
We use file descriptor of -1 as an indicator for unopened link internally.
However, since all the structs of libosmo-netif are opaque, using it from external
applications looks like a leaky abstraction.
Let's remedy this by adding function which properly check this for the library user.
Related: OS#5568
Change-Id: I91aa7da5f09ec4e8e2d21c827b45ed92e6b0e3d9
|
|
Related: OS#5568
Change-Id: Ie15bb3dc99bfe18065e03fde68d517b0d389b7ad
|
|
On some stream socket types like TCP it is expected that the send()
syscall may return a short write, ie not all bytes being copied to the
socket. In that case we need to keep the bytes not copied and attempt to
submit them later.
Related: OS#5836
Change-Id: I3755aada02ceb186fb990604e3496126fe47e1fb
|
|
Before this patch, the WRITE poll flag was being left ON and waited to
be polled again by the kernel in order to disable it.
Let's spate that extra polling cycle which only creates more polling
triggers, context switches, etc.
Change-Id: I1dd2145249a7322ad95e49be588fd472f00734e1
|
|
This is clearly a problem on TCP streams which needs to be addressed in
the future.
Related: OS#5836
Change-Id: I9bd257b80a378b779df84e204673f8e394eca5b6
|
|
Change-Id: I5b5d6f7a5a1722bd01c13d32557c21d8a0889966
|
|
Change-Id: I57b064fa0498be76579ae9597ab9217d659aae41
|
|
We implicitly rely on conn->srv availability in several functions.
Let's ensure it's available in function creating conn.
Change-Id: If494eac5dcce6c5ae30e928b92e57067d5681a42
|
|
Related: SYS#6113
Change-Id: Iecb0a4bc281647673d2930d1f1586a2df231af52
|
|
Related: SYS#6113
Change-Id: Ieebc6e623874b4770ec7cd8b934244ffecaa089d
|
|
Avoid logging confusion when -1 == ENOTSUP.
Change-Id: Iaa7e16e717c56466c5d9a64deb438776ca88022e
|
|
Change-Id: I47b066f26e63afd4bdb135f822667d1cd9479920
|
|
It was seen on a real pcap trace (sctp & gsmtap_log) that the Linux
kernel stack may decide to kill the connection (sending an ABORT) if
it fails to transmit some data after a while:
ABORT Cause code: "Protocol violation (0x000d)",
Cause Information: "Association exceeded its max_retrans count".
When this occurs, the kernel sends the
MSG_NOTIFICATION,SCTP_ASSOC_CHANGE,SCTP_COMM_LOST notification when
reading from the socket with sctp_recvmsg(). This basically signals that
the socket conn is dead, and subsequent writes to it will result in
send() failures (and receive SCTP_SEND_FAILED notification upon follow
up reads).
It's important to notice that after those events, there's no other sort
of different event like SHUTDOWN coming in, so that's the time at which
we must tell the user to close the socket.
Hence, let's signal the caller that the socket is dead by returning 0,
to comply with usual recv() API.
Related: SYS#6113
Change-Id: If94d44f25b76a96a5ea402fec9fc14c4e6296ba3
|
|
Change-Id: Iaa36a3661fc3d049f656342ee6dc3aafd45498bb
|
|
Let's set these values in all cases.
Change-Id: I99f6098d8d9fc1c06bc28373bf7ee76f15d5f525
|
|
Change-Id: I16d3ed950d4da3b13cca25bcd8f29af0d880c23e
|
|
It could be that the user reuses the msgb passed to
osmo_stream_srv_recv() all the time, hence we need to reset the flags,
otherwise it may end up being set forever.
Change-Id: Id358140db82b018e3973111e530834589c0b7224
|
|
This allows the user to properly check the size of the content in case
the struct ABI changes.
-EAGAIN is still returned to avoid older users of the API reading SCTP
notifications as user data.
Change-Id: I95e2457498fd8e0d790d221cb97695ace0dd673e
|
|
The user may want to check the flags in order to know if the content
pointed at by msgb is an sctp_notification structure, and not in-band
data.
This is useful for the user in order to gain connection state such as
SCTP RESET notification, which means the client reconnected reusing the
same socket, loosing all higher layers state.
The MSG_NOTIFICATION from netinet/sctp.h is not reused, and instead an
osmocom specific flag (and bitmask) is used. This is done in order to
fit the flags in one byte, since for instance MSG_NOTIFICATION requires
2 bytes in my system (0x8000).
Related: SYS#6113
Change-Id: I0ee94846a15a23950b9d70eaaef1251267296bdd
|
|
The fd is not valid anymore after close() call, so let's set it to a
clearly invalid value, to avoid confusion on closed_cb() users
attempting to use the fd get info about the socket at that time.
Change-Id: I82d9bdfb38cf5e9f689eca0d9a4c19ddd5541af7
|
|
Change-Id: I9e49e222c254c89d182402501024badfd3bf9d9c
|
|
Change-Id: If9b80e855b740254d5414ea50b4ce594855da8e9
|