• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7800-V1.0.2.28/package/qca-nss-ecm/src/

Lines Matching defs:data

121 	uint32_t offset;		/* Offset from skb->data to seq_no (i.e. header size we must skip to get to data) */
129 * data tracking for a host
135 uint32_t seq_no; /* Sequence number of the first data byte we are tracking */
149 * Buffers that have useful in-sequence-order data are added into this list
157 struct sk_buff *in_order_last; /* Fast appending of in-order data buffers */
187 int32_t data_limit; /* Limit for tracked data */
203 struct ecm_tracker_tcp_host_data *data; /* Host data this reader is using */
208 uint32_t offset; /* Logical offset from a start of 0 - i.e. from start of tracker data.
213 uint32_t discarded; /* Tracks the amount of data that has been discarded so far so that we don't try to discard them again.
218 * These 'slide' over the available segments and always represent actual data and positions within a segment.
220 uint32_t segment_offset; /* Offset from the start of the segment at which the next read will occur (header offset + data already advanced over in this segment) */
248 int ecm_tracker_tcp_count = 0; /* Counts the number of TCP data trackers right now */
296 * Check that we have all of the TCP data we're supposed to have
329 static void ecm_tracker_tcp_bytes_discard(struct ecm_tracker_tcp_internal_instance *ttii, struct ecm_tracker_tcp_host_data *data, uint32_t n)
337 DEBUG_ASSERT(n <= data->num_seqs, "%p: discard invalid %u, available %u\n", ttii, n, data->num_seqs);
338 data->num_seqs -= n;
339 data->seq_no += n;
340 DEBUG_TRACE("%p: Discard %u, New seq space for %p, seq_no: %u, num_seqs: %u\n", ttii, n, data, data->seq_no, data->num_seqs);
348 * Examine the buffer at the head of the in order data list
351 skb = data->in_order;
352 DEBUG_ASSERT(skb, "%p: data list invalid\n", ttii);
373 DEBUG_ASSERT(data->recvd_order_last == skb, "%p: bad list\n", ttii);
374 data->recvd_order_last = skb_cb->prev;
382 DEBUG_ASSERT(data->recvd_order == skb, "%p: bad list\n", ttii);
383 data->recvd_order = skb_cb->next;
395 data->in_order = skb->next;
396 if (data->in_order) {
397 data->in_order->prev = NULL;
399 DEBUG_ASSERT(data->in_order_last == skb, "%p: bad list\n", ttii);
400 data->in_order_last = NULL;
406 data->in_order_count--;
407 DEBUG_ASSERT(data->in_order_count >= 0, "%p: bad in order count\n", ttii);
408 data->recvd_count--;
409 DEBUG_ASSERT(data->recvd_count >= 0, "%p: bad count\n", ttii);
410 data->recvd_bytes_total -= skb->truesize;
411 DEBUG_ASSERT(data->recvd_bytes_total >= 0, "%p: bad bytes count\n", ttii);
418 DEBUG_TRACE("%p: BUFFER DISCARD %p, size: %u, new head: %p end: %p, discard remain: %u, in order count: %d\n", ttii, skb, skb_cb->num_seqs, data->in_order, data->in_order_last, n, data->in_order_count);
432 struct ecm_tracker_tcp_host_data *data;
440 data = &ttii->sender_data[sender];
441 ecm_tracker_tcp_bytes_discard(ttii, data, n);
448 * NOTE: This discards from the in_order list - this means that any data in the future list cannot be destroyed by this method.
453 struct ecm_tracker_tcp_host_data *data;
463 data = &ttii->sender_data[sender];
470 skb = data->in_order;
485 ecm_tracker_tcp_bytes_discard(ttii, data, seqs_discard);
490 * Discard all tracked data
492 * NOTE: Calling this will erase all data within the tracker - including any future unsequenced data. FOR BOTH SENDERS.
493 * Sequence space tracking shall pick up again on the next tracked data packets.
495 * it no longer needs any data - and will not, typically, track any further data either.
503 struct ecm_tracker_tcp_host_data *data;
506 * Get sender data
508 data = &ttii->sender_data[s];
513 while (data->recvd_count) {
520 skb = data->recvd_order;
528 data->recvd_order = skb_cb->next;
529 data->recvd_count--;
537 DEBUG_ASSERT(data->recvd_order == NULL, "%p: recvd_count not match recvd_order length: %p\n", ttii, data->recvd_order);
538 data->recvd_order_last = NULL;
539 data->recvd_bytes_total = 0;
540 data->in_order = NULL;
541 data->in_order_last = NULL;
542 data->in_order_count = 0;
543 data->future = NULL;
548 data->seq_no_valid = false;
554 * Discard all tracked data
556 * NOTE: Calling this will erase all data within the tracker - including any future unsequenced data. FOR BOTH SENDERS.
557 * Sequence space tracking shall pick up again on the next tracked data packets.
559 * it no longer needs any data - and will not, typically, track any further data either.
732 * Replay packets in the future data list to see if any are now in sequence.
734 * NOTE: 'Future' is a misnomer here because the arrival of data may have actually cause some future data
739 * As you can see the future data is now rendered old by the arrival of sequences
741 * NOTE: The future data list may also contain duplicate future data - we weren't that fussy when we inserted the segment into the future list.
744 struct ecm_tracker_tcp_host_data *data)
746 while (data->future) {
756 skb = data->future;
763 in_sequence = (int32_t)(skb_cb->seq_no - (data->seq_no + data->num_seqs));
783 data->future = skb->next;
784 if (data->future) {
785 data->future->prev = NULL;
789 * Does the segment contain only old data?
795 DEBUG_TRACE("%p: FUTURE REPLAY OLD SEQ: %u LEN:%u, new future head: %p\n", ttii, skb_cb->seq_no, skb_cb->num_seqs, data->future);
801 DEBUG_ASSERT(data->recvd_order_last == skb, "%p: bad list\n", ttii);
802 data->recvd_order_last = skb_cb->prev;
810 DEBUG_ASSERT(data->recvd_order == skb, "%p: bad list\n", ttii);
811 data->recvd_order = skb_cb->next;
822 data->recvd_count--;
823 DEBUG_ASSERT(data->recvd_count >= 0, "%p: bad count\n", ttii);
824 data->recvd_bytes_total -= skb->truesize;
826 DEBUG_ASSERT(data->recvd_bytes_total >= 0, "%p: bad bytes count\n", ttii);
829 * Release skb containing obsoleted data
836 * We are dealing with new or some new/old data.
844 skb_cb->seq_no += offset; /* Advance sequence space to new data sequences */
849 * Insert the skb onto the end of the data list - it must be the end because the data here is considered in order
852 skb->prev = data->in_order_last;
853 data->in_order_last = skb;
860 DEBUG_ASSERT(data->in_order == NULL, "%p: bad data_end, data points to %p\n", ttii, data->in_order);
861 data->in_order = skb;
863 data->in_order_count++;
864 DEBUG_ASSERT(data->in_order_count > 0, "%p: invalid in_order count %d for data %p\n", ttii, data->in_order_count, data);
869 data->num_seqs += (uint32_t)new_seqs;
872 skb_cb->next, data->seq_no, data->num_seqs, data->in_order_count);
886 struct ecm_tracker_tcp_host_data *data,
913 * Figure out the data length in this TCP segment.
918 DEBUG_TRACE("%p: data offset: %u, data_len = %u\n", ttii, data_offset, data_len);
921 * Set sequence number of first byte of data in the header.
922 * NOTE: If the syn flag is set then this is sequenced like a data byte
931 * First actual byte of data has the next sequence number
940 if (unlikely(!data->seq_no_valid)) {
941 DEBUG_ASSERT(data->in_order == NULL, "%p: in_order not null %p\n", ttii, data->in_order);
942 DEBUG_ASSERT(data->in_order_last == NULL, "%p: in_order_last not null %p\n", ttii, data->in_order_last);
943 DEBUG_ASSERT(data->in_order_count == 0, "%p: in_order_count not 0: %d\n", ttii, data->in_order_count);
948 data->seq_no = seq;
949 data->num_seqs = 0;
950 data->seq_no_valid = true;
956 * Do we have any data?
963 * Examine the data sequence space:
964 * It contains in sequence new data - USE NEW.
965 * It is old data - IGNORE
980 * Number of sequences is now the data length
987 * data->seq data->num_seqs seq num_seqs in_sequence new_seqs Offset Result?
988 * 100 20 120 30 0 30 0 In sequence 30 bytes, new data is from the first data byte in skb
990 * 100 20 119 30 -1 29 1 1 DUP, 29 new, offset to new data is 1
991 * 100 20 100 30 -20 10 20 20 DUP, 10 new, offset to new data is 20
992 * 100 20 99 30 -21 9 21 21 DUP, 9 new, offset to new data is 21
996 in_sequence = (int32_t)(seq - (data->seq_no + data->num_seqs));
1002 * Does the segment contain only old data?
1024 * Note that sequence space here may duplicate other future data but that will be corrected when future data is sorted out.
1034 nskb = data->future;
1063 DEBUG_ASSERT(data->future == nskb, "%p: invalid future list %p != %p\n", ttii, data->future, nskb);
1064 data->future = skb;
1072 * We are dealing with new or some new/old data.
1085 * Insert the skb onto the end of the data list - it must be the end because the data here is considered in order
1088 skb->prev = data->in_order_last;
1089 data->in_order_last = skb;
1096 DEBUG_ASSERT(data->in_order == NULL, "%p: bad data_end, data points to %p\n", ttii, data->in_order);
1097 data->in_order = skb;
1099 data->in_order_count++;
1100 DEBUG_ASSERT(data->in_order_count > 0, "%p: invalid in_order count %d for data %p\n", ttii, data->in_order_count, data);
1105 data->num_seqs += (uint32_t)new_seqs;
1108 ttii, skb_cb->seq_no, skb_cb->num_seqs, skb_cb->prev, skb_cb->next, data->seq_no, data->num_seqs, data->in_order_count);
1111 * Do we have any future data? It's likely we won't as it is rare for packets to arrive out of sequence in this way.
1113 if (likely(!data->future)) {
1118 * We now need to process future data - the reception of seqences here may now release some
1120 _ecm_tracker_tcp_data_future_replay(ttii, data);
1176 struct ecm_tracker_tcp_host_data *data;
1228 data = &ttii->sender_data[sender];
1233 if (unlikely(tcp_hdr->syn) && unlikely(!data->mss_seen)) {
1236 data->mss = mss;
1237 data->mss_seen = true;
1238 DEBUG_TRACE("%p: Seen mss as %u for %p\n", ttii, mss, data);
1245 if (!_ecm_tracker_tcp_stream_segment_add(ttii, data, ip_hdr, ecm_tcp_header, tcp_hdr, skbc, skbc_cb)) {
1263 skbc_cb->prev = data->recvd_order_last;
1264 data->recvd_order_last = skbc;
1266 DEBUG_ASSERT(data->recvd_order == NULL, "%p: bad list\n", ttii);
1267 data->recvd_order = skbc;
1278 data->recvd_count++;
1279 DEBUG_ASSERT(data->recvd_count > 0, "%p: bad count\n", ttii);
1280 data->recvd_bytes_total += skbc->truesize;
1282 ttii, skbc, skbc->prev, skbc->next, data->recvd_count, data->recvd_bytes_total);
1300 struct ecm_tracker_tcp_host_data *data;
1375 data = &ttii->sender_data[sender];
1380 if (unlikely(tcp_hdr->syn) && unlikely(!data->mss_seen)) {
1383 data->mss = mss;
1384 data->mss_seen = true;
1385 DEBUG_TRACE("%p: Seen mss as %u for %p\n", ttii, mss, data);
1392 if (!_ecm_tracker_tcp_stream_segment_add(ttii, data, &ip_hdr, ecm_tcp_header, tcp_hdr, skbc, skbc_cb)) {
1410 skbc_cb->prev = data->recvd_order_last;
1411 data->recvd_order_last = skbc;
1413 DEBUG_ASSERT(data->recvd_order == NULL, "%p: bad list\n", ttii);
1414 data->recvd_order = skbc;
1425 data->recvd_count++;
1426 DEBUG_ASSERT(data->recvd_count > 0, "%p: bad count\n", ttii);
1427 data->recvd_bytes_total += skbc->truesize;
1429 ttii, skbc, skbc->prev, skbc->next, data->recvd_count, data->recvd_bytes_total);
1441 struct ecm_tracker_tcp_host_data *data;
1450 data = &ttii->sender_data[sender];
1456 bytes_avail = data->num_seqs;
1470 struct ecm_tracker_tcp_host_data *data;
1485 data = &ttii->sender_data[sender];
1491 DEBUG_ASSERT((offset + size) <= data->num_seqs, "%p: attempt to read %u bytes from offset %u. Available bytes is %u\n", ttii, size, offset, data->num_seqs);
1492 read_start_seq = data->seq_no + offset;
1493 DEBUG_TRACE("%p: seq: %u, num_seqs: %u, offset: %u, size: %u, read_start_seq: %u\n", ttii, data->seq_no, data->num_seqs, offset, size, read_start_seq);
1498 skb = data->in_order;
1544 * Read that data.
1600 struct ecm_tracker_tcp_host_data *data;
1609 data = &ttii->sender_data[sender];
1612 *mss = data->mss;
1613 res = data->mss_seen;
1623 * Return total tracked data
1641 * Get tracked data limit
1659 * Set tracked data limit
1912 struct ecm_tracker_tcp_host_data *data,
1928 if ((result = ecm_state_write(sfi, "mss_seen", "%s", (data->mss_seen)? "yes" : "no"))) {
1931 if ((result = ecm_state_write(sfi, "mss", "%u", data->mss))) {
1934 if ((result = ecm_state_write(sfi, "seq_no", "%u", data->seq_no))) {
1937 if ((result = ecm_state_write(sfi, "num_seqs", "%u", data->num_seqs))) {
1940 if ((result = ecm_state_write(sfi, "seq_valid", "%s", (data->seq_no_valid)? "yes" : "no"))) {
1943 if ((result = ecm_state_write(sfi, "bytes_total", "%d", data->recvd_bytes_total))) {
1946 if ((result = ecm_state_write(sfi, "buffers_total", "%d", data->recvd_count))) {
2131 * Do we need to advance onto the next segment? Unlikely as most segments contain a lot more than 1 byte of data.
2140 tri->segment = tri->data->in_order;
2152 DEBUG_ASSERT(tri->segment_remain, "%p: Next segment has no data\n", tri);
2183 * This tells us how much data we can retreat over before having to move onto the prior segment
2189 * Is there enough prior data in the current segment to satisfy the retreat?
2268 tri->segment = tri->data->in_order;
2312 * This is so that once a stream is parsed and positions known, data can be discarded without
2340 remain = tri->data->num_seqs - (tri->offset - tri->discarded);
2381 * Discard bytes from beginning of available data before the reader position
2417 ecm_tracker_tcp_bytes_discard(tri->ttii, tri->data, discard);
2427 struct ecm_tracker_tcp_host_data *data;
2439 * Get a pointer to the host data
2441 data = &ttii->sender_data[sender];
2444 * take a copy of the ttii and data pointers for quick reference later on during reading
2447 tri->data = data;
2449 DEBUG_TRACE("%p: Init reader for %p (%d): data %p. \n", tri, ttii, sender, data);