aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-10-22 17:08:48 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-06-17 09:40:35 +0200
commit05efe619b8bb78575a0a91c49070024dcbff1143 (patch)
tree61f41be00892b4d3c5c1216c1fde4468b956690a
parent2fc26faebb5724bf503eb4a7fe0c8eff80fcd829 (diff)
mgcp: Align the variable naming with Appendix A of RFC 3550
Align the naming inside the mgcp_rtp_state with the naming inside the 'source' struct of the appendix. Make first_seq_no/base_seq a uint16_t. This is removing rules for alignments and reduces the struct from 40 bytes to 36.
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h6
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c8
2 files changed, 8 insertions, 6 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index a0d364dc8..89b4391cb 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -46,9 +46,11 @@ struct mgcp_rtp_state {
uint32_t orig_ssrc;
uint32_t ssrc;
- int first_seq_no;
- uint16_t seq_no;
+
+ uint16_t base_seq;
+ uint16_t max_seq;
int seq_offset;
+
uint32_t last_timestamp;
int32_t timestamp_offset;
};
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 3f4e7f046..2ff54673d 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -114,14 +114,14 @@ static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *s
timestamp = ntohl(rtp_hdr->timestamp);
if (!state->initialized) {
- state->first_seq_no = seq;
- state->seq_no = seq - 1;
+ state->base_seq = seq;
+ state->max_seq = seq - 1;
state->ssrc = state->orig_ssrc = rtp_hdr->ssrc;
state->initialized = 1;
state->last_timestamp = timestamp;
} else if (state->ssrc != rtp_hdr->ssrc) {
state->ssrc = rtp_hdr->ssrc;
- state->seq_offset = (state->seq_no + 1) - seq;
+ state->seq_offset = (state->max_seq + 1) - seq;
state->timestamp_offset = state->last_timestamp - timestamp;
#warning "Always allow to patch the SSRC"
state->patch = 1;
@@ -141,7 +141,7 @@ static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *s
rtp_hdr->timestamp = htonl(timestamp);
}
- state->seq_no = seq;
+ state->max_seq = seq;
state->last_timestamp = timestamp;
if (payload < 0)