diff options
| author | yangwei <[email protected]> | 2024-04-30 16:09:53 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-04-30 16:09:53 +0800 |
| commit | e32196af5d0d5fb875e84ffa801558db4867babb (patch) | |
| tree | 43b0fb98a4848d5ed5c8cd9fa0a189af60e59d41 /src | |
| parent | f4e5f43b959d1321acd128b76fdc82fa94cd877d (diff) | |
✨ feat(session_get_isn): forward port api from 1.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/stellar_on_sapp/stellar_on_sapp_api.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/stellar_on_sapp/stellar_on_sapp_api.c b/src/stellar_on_sapp/stellar_on_sapp_api.c index 707ceb9..c3c8430 100644 --- a/src/stellar_on_sapp/stellar_on_sapp_api.c +++ b/src/stellar_on_sapp/stellar_on_sapp_api.c @@ -506,4 +506,24 @@ int session_get_current_thread_id(struct session *sess) } } return thread_id; +} + +long long session_get_client_isn(struct session *sess) +{ + if(sess || sess->cur_pkt || sess->cur_pkt->a_stream)return -1; + struct streaminfo *pstream=sess->cur_pkt->a_stream; + uint32_t client_isn=0; + int client_isn_sz=sizeof(client_isn); + if(MESA_get_stream_opt(pstream, MSO_TCP_ISN_C2S, &(client_isn), &client_isn_sz)!=0)return -1; + return client_isn; +} + +long long session_get_server_isn(struct session *sess) +{ + if(sess || sess->cur_pkt || sess->cur_pkt->a_stream)return -1; + struct streaminfo *pstream=sess->cur_pkt->a_stream; + uint32_t server_isn=0; + int server_isn_sz=sizeof(server_isn); + if(MESA_get_stream_opt(pstream, MSO_TCP_ISN_S2C, &(server_isn), &server_isn_sz)!=0)return -1; + return server_isn; }
\ No newline at end of file |
