pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-pcap/+/39270?usp=email )
Change subject: cosmetic: server: document functions
......................................................................
cosmetic: server: document functions
Change-Id: I6709b720e236514b8572fe60834a990558e67f5c
---
M src/osmo_server_network.c
1 file changed, 9 insertions(+), 3 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c
index d55b30d..3bf8113 100644
--- a/src/osmo_server_network.c
+++ b/src/osmo_server_network.c
@@ -296,6 +296,7 @@
update_last_write(conn, now);
}
+/* returns >0 on success, <= 0 on failure (closes conn) */
static int rx_link_hdr(struct osmo_pcap_conn *conn, struct osmo_pcap_data *data)
{
struct pcap_file_header *hdr;
@@ -459,9 +460,7 @@
return true;
}
-/*
- * Check if we are past the limit or on a day change
- */
+/* returns >0 on success, <= 0 on failure (closes conn) */
static int rx_link_data(struct osmo_pcap_conn *conn, struct osmo_pcap_data *data)
{
time_t now = time(NULL);
@@ -479,6 +478,7 @@
return -1;
}
+ /* Check if we are past the limit or on a day change. */
if (!check_restart_pcap_max_size(conn, data))
check_restart_pcap_localtime(conn, now);
@@ -610,6 +610,8 @@
return true;
}
+/* Read segment header, struct osmo_pcap_data (without payload)
+ * returns >0 on success, <= 0 on failure (closes conn) */
static int read_cb_initial(struct osmo_pcap_conn *conn)
{
int rc;
@@ -639,6 +641,8 @@
return 1;
}
+/* Read segment payload, of size conn->data->len.
+ * returns >0 on success, <= 0 on failure (closes conn) */
static int read_cb_data(struct osmo_pcap_conn *conn)
{
int rc;
@@ -680,6 +684,7 @@
return 1;
}
+/* returns >0 on success, <= 0 on failure (closes conn) */
static int dispatch_read(struct osmo_pcap_conn *conn)
{
if (conn->state == STATE_INITIAL) {
@@ -760,6 +765,7 @@
rate_ctr_inc2(client->ctrg, PEER_CTR_CONNECT);
+ /* Prepare for first read of segment header: */
client->state = STATE_INITIAL;
client->pend = sizeof(*client->data);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-pcap/+/39270?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I6709b720e236514b8572fe60834a990558e67f5c
Gerrit-Change-Number: 39270
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>