MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / sndcpWriteHighSide

Method sndcpWriteHighSide

SGSNGGSN/LLC.cpp:625–645  ·  view source on GitHub ↗

downlink data from internet comes in here. It needs to be segmented and sent to LLC Entity for yet another header.

Source from the content-addressed store, hash-verified

623// downlink data from internet comes in here.
624// It needs to be segmented and sent to LLC Entity for yet another header.
625void Sndcp::sndcpWriteHighSide(ByteVector &sdu)
626{
627 // Set the first byte flags.
628 unsigned flags = mNSapi;
629 flags |= T_BIT; // UNITDATA PDU
630 flags |= F_BIT; // First segment.
631 // Segment the pdu.
632 unsigned segnum = 0;
633 unsigned segsize = getMaxPduSize();
634 segsize -= 12; // be safe. If you dont do this, the blackberry rejects the packets.
635 for (; sdu.size() > segsize; segnum++) {
636 flags |= M_BIT; // Not last segment.
637 ByteVector seg(sdu.segment(0,segsize));
638 sndcpWriteSegment(seg,segnum,flags);
639 sdu.trimLeft(segsize);
640 flags &= ~F_BIT; // Not first segment.
641 }
642 flags &= ~M_BIT; // Now it is the last segment.
643 sndcpWriteSegment(sdu,segnum,flags);
644 mSendNPdu = (mSendNPdu+1) % mSNS;
645}
646
647// invert the low width bits of x.
648static uint32_t revbits(uint32_t x, unsigned width)

Callers 1

llcWriteHighSideMethod · 0.80

Calls 3

segmentMethod · 0.80
trimLeftMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected