text:
Rediff.com » News » Bsnl
News for Bsnl
SMS, voice calls restored on prepaid mobiles in J-K
The Jammu and Kashmir administration on Saturday ordered the restoration of the prepaid mobile service in the Valley after over five months of suspension besides the 2G mobile data service on......
SMS restored with glitches in Kashmir; no Internet in govt hospitals yet
The announcement of restoration of SMS services in Kashmir on the New Year Day came as a happy news for residents in the Valley, but some technical glitches prevented several people from reaching......
'Students asking for jobs, Modi is giving them NPR'
'Our country does not need an NRC. We need to improve our economy which is in a bad condition.' IMAGE: A protest against the new citizenship law in New Delhi. Photograph: Danish Siddiqui/Reuters......
Mobile Internet remains suspended in parts of UP; restored in Assam
IMAGE: A police personnel attempts to douse a burning vehicle after protests against the Citizenship Amendment Act (CAA) turned violent at Madeyganj outpost in Lucknow, on Thursday.......
Sister, daughter of Farooq Abdullah released
IMAGE: Police detain sister Suriya Abdullah and daughter Safiyah Abdullah of Member of Parliament Farooq Abdullah, during a protest against the abrogration of Article 370A and bifurcation of J &K......
Setback for telcos as SC dismisses AGR review plea
Telecom Minister Ravi Shankar Prasad had told Parliament in November that Bharti Airtel, Vodafone Idea and other telecom companies owe the government as much as Rs 1.47 lakh crore in past statutory......
Do you know what Modi's AMs are, and what they do?
'The AMs are a different beast and reflect the political play within the government.' 'Prime Minister Modi does not need to assuage any interest group to take the final call on any decision that......
Post-VRS, a leaner BSNL is all set for 4G services
The company, which has a subscriber base of 120 million, also plans to raise funds via a bonds issue. The company's impending 4G launch is also expected in the second half of the current......
Crisis grips world's cheapest, biggest telecom market
When on October 24, the Supreme Court, on a petition moved by the government, ordered payment of past dues according to its new definition of AGR, the country's second-biggest carrier Vodafone-Idea......
No cut in spectrum price as govt okays airwave auction
Although the industry is disappointed with the government decision not to lower spectrum prices at a time telcos are saddled with over Rs 4-trillion debt and an estimated Rs 1.43-trillion licence......
Sports Shorts: Indians win five medals in Asian Indoors
A summary of sports events and sports persons, who made news on Monday IMAGE: Sourav Kothari poses. Photograph: Twitter Indians added five medals, including a gold through cueist Sourav Kothari,......
Videos for Bsnl
Web results for Bsnl
Industry experts are divided over the likely outcome of the sector heading towards a duopoly with two private telcos-Reliance Jio and Bharti Airtel... ...
https://economictimes.indiatimes.com/industry/telecom/telecom-news/government-relief-only-hope-else-telecom-sector-headed-for-duopoly-analysts/articleshow/73323482.cms
Telecom Minister Ravi Shankar Prasad had told Parliament in November that Bharti Airtel, Vodafone Idea and other telecom companies owe the... ...
http://www.rediff.com/money/report/setback-for-telcos-as-sc-dismisses-agr-review-plea/20200116.htm
BSNL seeks to launch 4G services by March 1
Sabka Vishwas: Last day to close your pending excise and service tax disputes is January 15 ...
https://www.thehindubusinessline.com/info-tech/bsnl-looking-to-launch-4g-services-by-march-1/article30568320.ece
BSNL Revises Rs. 74, Rs. 75, Rs. 153 Prepaid Plans, Reduces Validity
BSNL has listed the changes on its Tamil Nadu, Chennai, and Kerala websites. By Jagmeet Singh | Updated: 14 January 2020 18:59 IST BSNL has reduced... ...
https://gadgets.ndtv.com/telecom/news/bsnl-74-75-153-plan-recharge-validity-reduced-2164049
BSNL Launches 200Mbps Broadband Plan With 1.5TB Data FUP at Rs. 1,999
dband plan is for a month, and subscribers will have to pay one month charges as security deposit as well. The broadband plan is live on the BSNL... ...
https://gadgets.ndtv.com/telecom/news/bsnl-rs-1999-bharat-fiber-broadband-plan-launch-1-5tb-data-200mbps-speeds-unlimited-voice-calling-2162342
united progressive alliance
national democratic alliance
jd-u
advani
janata dal-united
find job in bsnl
BSNL Pensioner
News to BSNL Pensioners in India
BSNL JE Admit Card 2017
BSNL JE Admit Card 2017 will be...
bsnl agent in kolkata
Krishnendu Bhattacharya available...
bsnl agent
krishnendu bhattacharya 34A, Huzuri...


Many people believe that pleasure and desire are obstacles to reasonable and intelligent behavior.
In The Pleasure Center, Morten Kringelbach reveals that what we desire, what pleases us-in fact, our most base, animalistic tendencies-are actually very important sources of information.
They motivate us for a good reason. And understanding that reason, taking that reason into account, and harnessing and directing that reason, can make us much more rationaland effective people.
In exploring the many facets of pleasure, desire and emotion, Kringelbach takes us through the whole spectrum of human experience, such as how emotion fuels our interest in things, allowing us to pay attention and learn.
He investigates the reward systems of the brain and sheds light onsome of the most interesting new discoveries about pleasure and desire.
Kringelbach concludes that if we understand and accept how pleasure and desire arise in the complex interaction between the brain's activity and our own experiences, we can discover what helps us enjoy life, enabling us to make better decisions and, ultimately, lead happier lives.


text:
namespace network {
namespace {

typedef uint16_t PacketLength;
const int kPacketHeaderSize = sizeof(PacketLength);
const int kTcpReadBufferSize = 4096;
const int kPacketLengthOffset = 2;
const int kTurnChannelDataHeaderSize = 4;
const int kTcpRecvSocketBufferSize = 128 * 1024;
const int kTcpSendSocketBufferSize = 128 * 1024;

bool IsTlsClientSocket(P2PSocketType type) {
  return (type == P2P_SOCKET_STUN_TLS_CLIENT || type == P2P_SOCKET_TLS_CLIENT);
}

bool IsPseudoTlsClientSocket(P2PSocketType type) {
  return (type == P2P_SOCKET_SSLTCP_CLIENT ||
          type == P2P_SOCKET_STUN_SSLTCP_CLIENT);
}

}  // namespace

P2PSocketTcp::SendBuffer::SendBuffer() : rtc_packet_id(-1) {}
P2PSocketTcp::SendBuffer::SendBuffer(
    int32_t rtc_packet_id,
    scoped_refptr<net::DrainableIOBuffer> buffer,
    const net::NetworkTrafficAnnotationTag traffic_annotation)
    : rtc_packet_id(rtc_packet_id),
      buffer(buffer),
      traffic_annotation(traffic_annotation) {}
P2PSocketTcp::SendBuffer::SendBuffer(const SendBuffer& rhs) = default;
P2PSocketTcp::SendBuffer::~SendBuffer() = default;

P2PSocketTcpBase::P2PSocketTcpBase(
    Delegate* delegate,
    mojo::PendingRemote<mojom::P2PSocketClient> client,
    mojo::PendingReceiver<mojom::P2PSocket> socket,
    P2PSocketType type,
    ProxyResolvingClientSocketFactory* proxy_resolving_socket_factory)
    : P2PSocket(delegate, std::move(client), std::move(socket), P2PSocket::TCP),
      type_(type),
      proxy_resolving_socket_factory_(proxy_resolving_socket_factory) {}

P2PSocketTcpBase::~P2PSocketTcpBase() = default;

void P2PSocketTcpBase::InitAccepted(const net::IPEndPoint& remote_address,
                                    std::unique_ptr<net::StreamSocket> socket) {
  DCHECK(socket);
  remote_address_.ip_address = remote_address;
  // TODO(ronghuawu): Add FakeSSLServerSocket.
  socket_ = std::move(socket);
  DoRead();
}

void P2PSocketTcpBase::Init(const net::IPEndPoint& local_address,
                            uint16_t min_port,
                            uint16_t max_port,
                            const P2PHostAndIPEndPoint& remote_address) {
  DCHECK(!socket_);

  remote_address_ = remote_address;

  net::HostPortPair dest_host_port_pair;
  // If there is a domain name, let's try it first, it's required by some proxy
  // to only take hostname for CONNECT. If it has been DNS resolved, the result
  // is likely cached and shouldn't cause 2nd DNS resolution in the case of
  // direct connect (i.e. no proxy).
  if (!remote_address.hostname.empty()) {
    dest_host_port_pair = net::HostPortPair(remote_address.hostname,
                                            remote_address.ip_address.port());
  } else {
    DCHECK(!remote_address.ip_address.address().empty());
    dest_host_port_pair =
        net::HostPortPair::FromIPEndPoint(remote_address.ip_address);
  }

  // TODO(mallinath) - We are ignoring local_address altogether. We should
  // find a way to inject this into ProxyResolvingClientSocket. This could be
  // a problem on multi-homed host.

  socket_ = proxy_resolving_socket_factory_->CreateSocket(
      GURL("https://" + dest_host_port_pair.ToString()),
      IsTlsClientSocket(type_));

  if (IsPseudoTlsClientSocket(type_)) {
    socket_ =
        std::make_unique<jingle_glue::FakeSSLClientSocket>(std::move(socket_));
  }

  int status = socket_->Connect(
      base::BindOnce(&P2PSocketTcpBase::OnConnected, base::Unretained(this)));
  if (status != net::ERR_IO_PENDING)
    OnConnected(status);
}

void P2PSocketTcpBase::OnConnected(int result) {
  DCHECK_NE(result, net::ERR_IO_PENDING);

  if (result != net::OK) {
    LOG(WARNING) << "Error from connecting socket, result=" << result;
    OnError();
    return;
  }

  OnOpen();
}

void P2PSocketTcpBase::OnOpen() {
  // Setting socket send and receive buffer size.
  if (net::OK != socket_->SetReceiveBufferSize(kTcpRecvSocketBufferSize)) {
    LOG(WARNING) << "Failed to set socket receive buffer size to "
                 << kTcpRecvSocketBufferSize;
  }

  if (net::OK != socket_->SetSendBufferSize(kTcpSendSocketBufferSize)) {
    LOG(WARNING) << "Failed to set socket send buffer size to "
                 << kTcpSendSocketBufferSize;
  }

  if (!DoSendSocketCreateMsg())
    return;

  DoRead();
}

bool P2PSocketTcpBase::DoSendSocketCreateMsg() {
  DCHECK(socket_.get());

  net::IPEndPoint local_address;
  int result = socket_->GetLocalAddress(&local_address);
  if (result < 0) {
    LOG(ERROR) << "P2PSocketTcpBase::OnConnected: unable to get local"
               << " address: " << result;
    OnError();
    return false;
  }

  VLOG(1) << "Local address: " << local_address.ToString();

  net::IPEndPoint remote_address;

  // GetPeerAddress returns ERR_NAME_NOT_RESOLVED if the socket is connected
  // through a proxy.
  result = socket_->GetPeerAddress(&remote_address);
  if (result < 0 && result != net::ERR_NAME_NOT_RESOLVED) {
    LOG(ERROR) << "P2PSocketTcpBase::OnConnected: unable to get peer"
               << " address: " << result;
    OnError();
    return false;
  }

  if (!remote_address.address().empty()) {
    VLOG(1) << "Remote address: " << remote_address.ToString();
    if (remote_address_.ip_address.address().empty()) {
      // Save |remote_address| if address is empty.
      remote_address_.ip_address = remote_address;
    }
  } else {
    VLOG(1) << "Remote address is unknown since connection is proxied";
  }

  // If we are not doing TLS, we are ready to send data now.
  // In case of TLS SignalConnect will be sent only after TLS handshake is
  // successful. So no buffering will be done at socket handlers if any
  // packets sent before that by the application.
  client_->SocketCreated(local_address, remote_address);
  return true;
}

void P2PSocketTcpBase::DoRead() {
  while (true) {
    if (!read_buffer_.get()) {
      read_buffer_ = base::MakeRefCounted<net::GrowableIOBuffer>();
      read_buffer_->SetCapacity(kTcpReadBufferSize);
    } else if (read_buffer_->RemainingCapacity() < kTcpReadBufferSize) {
      // Make sure that we always have at least kTcpReadBufferSize of
      // remaining capacity in the read buffer. Normally all packets
      // are smaller than kTcpReadBufferSize, so this is not really
      // required.
      read_buffer_->SetCapacity(read_buffer_->capacity() + kTcpReadBufferSize -
                                read_buffer_->RemainingCapacity());
    }
    const int result = socket_->Read(
        read_buffer_.get(), read_buffer_->RemainingCapacity(),
        base::BindOnce(&P2PSocketTcp::OnRead, base::Unretained(this)));
    if (result == net::ERR_IO_PENDING || !HandleReadResult(result))
      return;
  }
}

void P2PSocketTcpBase::OnRead(int result) {
  if (HandleReadResult(result))
    DoRead();
}

bool P2PSocketTcpBase::OnPacket(std::vector<int8_t> data) {
  if (!connected_) {
    P2PSocket::StunMessageType type;
    bool stun = GetStunPacketType(reinterpret_cast<uint8_t*>(&*data.begin()),
                                  data.size(), &type);
    if (stun && IsRequestOrResponse(type)) {
      connected_ = true;
    } else if (!stun || type == STUN_DATA_INDICATION) {
      LOG(ERROR) << "Received unexpected data packet from "
                 << remote_address_.ip_address.ToString()
                 << " before STUN binding is finished. "
                 << "Terminating connection.";
      OnError();
      return false;
    }
  }

  if (data.size() == 0) {
    // https://tools.ietf.org/html/rfc4571#section-2 allows null packets which
    // are ignored.
    LOG(WARNING) << "Ignoring empty RTP-over-TCP frame.";
    return true;
  }

  client_->DataReceived(
      remote_address_.ip_address, data,
      base::TimeTicks() + base::TimeDelta::FromNanoseconds(rtc::TimeNanos()));

  delegate_->DumpPacket(
      base::make_span(reinterpret_cast<const uint8_t*>(&data[0]), data.size()),
      true);

  return true;
}

void P2PSocketTcpBase::WriteOrQueue(SendBuffer& send_buffer) {
  IncrementTotalSentPackets();
  if (write_buffer_.buffer.get()) {
    write_queue_.push(send_buffer);
    IncrementDelayedPackets();
    IncrementDelayedBytes(send_buffer.buffer->size());
    return;
  }

  write_buffer_ = send_buffer;
  DoWrite();
}

void P2PSocketTcpBase::DoWrite() {
  while (!write_pending_ && write_buffer_.buffer.get()) {
    int result = socket_->Write(
        write_buffer_.buffer.get(), write_buffer_.buffer->BytesRemaining(),
        base::BindOnce(&P2PSocketTcp::OnWritten, base::Unretained(this)),
        net::NetworkTrafficAnnotationTag(write_buffer_.traffic_annotation));

    if (result == net::ERR_IO_PENDING) {
      write_pending_ = true;
    } else if (!HandleWriteResult(result)) {
      break;
    }
  }
}

void P2PSocketTcpBase::OnWritten(int result) {
  DCHECK(write_pending_);
  DCHECK_NE(result, net::ERR_IO_PENDING);

  write_pending_ = false;

  if (HandleWriteResult(result))
    DoWrite();
}

bool P2PSocketTcpBase::HandleWriteResult(int result) {
  DCHECK(write_buffer_.buffer.get());

  if (result < 0) {
    ReportSocketError(result, "WebRTC.ICE.TcpSocketWriteErrorCode");

    LOG(ERROR) << "Error when sending data in TCP socket: " << result;
    OnError();
    return false;
  }

  write_buffer_.buffer->DidConsume(result);
  if (write_buffer_.buffer->BytesRemaining() == 0) {
    int64_t send_time_ms = rtc::TimeMillis();
    client_->SendComplete(
        P2PSendPacketMetrics(0, write_buffer_.rtc_packet_id, send_time_ms));
    if (write_queue_.empty()) {
      write_buffer_.buffer = nullptr;
      write_buffer_.rtc_packet_id = -1;
    } else {
      write_buffer_ = write_queue_.front();
      write_queue_.pop();
      // Update how many bytes are still waiting to be sent.
      DecrementDelayedBytes(write_buffer_.buffer->size());
    }
  }
  return true;
}

bool P2PSocketTcpBase::HandleReadResult(int result) {
  if (result < 0) {
    LOG(ERROR) << "Error when reading from TCP socket: " << result;
    OnError();
    return false;
  } else if (result == 0) {
    LOG(WARNING) << "Remote peer has shutdown TCP socket.";
    OnError();
    return false;
  }

  read_buffer_->set_offset(read_buffer_->offset() + result);
  char* head = read_buffer_->StartOfBuffer();  // Purely a convenience.
  int pos = 0;
  while (pos <= read_buffer_->offset()) {
    size_t bytes_consumed = 0;
    if (!ProcessInput(head + pos, read_buffer_->offset() - pos,
                      &bytes_consumed)) {
      return false;
    }
    if (!bytes_consumed)
      break;
    pos += bytes_consumed;
  }
  // We've consumed all complete packets from the buffer; now move any remaining
  // bytes to the head of the buffer and set offset to reflect this.
  if (pos && pos <= read_buffer_->offset()) {
    memmove(head, head + pos, read_buffer_->offset() - pos);
    read_buffer_->set_offset(read_buffer_->offset() - pos);
  }

  return true;
}

void P2PSocketTcpBase::Send(
    const std::vector<int8_t>& data,
    const P2PPacketInfo& packet_info,
    const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) {
  // Renderer should use this socket only to send data to |remote_address_|.
  if (data.size() > kMaximumPacketSize ||
      !(packet_info.destination == remote_address_.ip_address)) {
    NOTREACHED();
    OnError();
    return;
  }

  if (!connected_) {
    P2PSocket::StunMessageType type = P2PSocket::StunMessageType();
    bool stun = GetStunPacketType(
        reinterpret_cast<const uint8_t*>(&*data.begin()), data.size(), &type);
    if (!stun || type == STUN_DATA_INDICATION) {
      LOG(ERROR) << "Page tried to send a data packet to "
                 << packet_info.destination.ToString()
                 << " before STUN binding is finished.";
      OnError();
      return;
    }
  }

  DoSend(packet_info.destination, data, packet_info.packet_options,
         net::NetworkTrafficAnnotationTag(traffic_annotation));
}

void P2PSocketTcpBase::SetOption(P2PSocketOption option, int32_t value) {
  switch (option) {
    case P2P_SOCKET_OPT_RCVBUF:
      socket_->SetReceiveBufferSize(value);
      break;
    case P2P_SOCKET_OPT_SNDBUF:
      socket_->SetSendBufferSize(value);
      break;
    case P2P_SOCKET_OPT_DSCP:
      return;  // For TCP sockets DSCP setting is not available.
    default:
      NOTREACHED();
      return;
  }
}

P2PSocketTcp::P2PSocketTcp(
    Delegate* delegate,
    mojo::PendingRemote<mojom::P2PSocketClient> client,
    mojo::PendingReceiver<mojom::P2PSocket> socket,
    P2PSocketType type,
    ProxyResolvingClientSocketFactory* proxy_resolving_socket_factory)
    : P2PSocketTcpBase(delegate,
                       std::move(client),
                       std::move(socket),
                       type,
                       proxy_resolving_socket_factory) {
  DCHECK(type == P2P_SOCKET_TCP_CLIENT || type == P2P_SOCKET_SSLTCP_CLIENT ||
         type == P2P_SOCKET_TLS_CLIENT);
}

P2PSocketTcp::~P2PSocketTcp() {}

bool P2PSocketTcp::ProcessInput(char* input,
                                int input_len,
                                size_t* bytes_consumed) {
  *bytes_consumed = 0;
  if (input_len < kPacketHeaderSize)
    return true;

  int packet_size = base::NetToHost16(*reinterpret_cast<uint16_t*>(input));
  if (input_len < packet_size + kPacketHeaderSize)
    return true;

  char* cur = input + kPacketHeaderSize;
  *bytes_consumed = kPacketHeaderSize + packet_size;

  return OnPacket(std::vector<int8_t>(cur, cur + packet_size));
}

void P2PSocketTcp::DoSend(
    const net::IPEndPoint& to,
    const std::vector<int8_t>& data,
    const rtc::PacketOptions& options,
    const net::NetworkTrafficAnnotationTag traffic_annotation) {
  int size = kPacketHeaderSize + data.size();
  SendBuffer send_buffer(options.packet_id,
                         base::MakeRefCounted<net::DrainableIOBuffer>(
                             base::MakeRefCounted<net::IOBuffer>(size), size),
                         traffic_annotation);
  *reinterpret_cast<uint16_t*>(send_buffer.buffer->data()) =
      base::HostToNet16(data.size());
  memcpy(send_buffer.buffer->data() + kPacketHeaderSize, &data[0], data.size());

  cricket::ApplyPacketOptions(
      reinterpret_cast<uint8_t*>(send_buffer.buffer->data()) +
          kPacketHeaderSize,
      send_buffer.buffer->BytesRemaining() - kPacketHeaderSize,
      options.packet_time_params, rtc::TimeMicros());

  WriteOrQueue(send_buffer);
}

// P2PSocketStunTcp
P2PSocketStunTcp::P2PSocketStunTcp(
    Delegate* delegate,
    mojo::PendingRemote<mojom::P2PSocketClient> client,
    mojo::PendingReceiver<mojom::P2PSocket> socket,
    P2PSocketType type,
    ProxyResolvingClientSocketFactory* proxy_resolving_socket_factory)
    : P2PSocketTcpBase(delegate,
                       std::move(client),
                       std::move(socket),
                       type,
                       proxy_resolving_socket_factory) {
  DCHECK(type == P2P_SOCKET_STUN_TCP_CLIENT ||
         type == P2P_SOCKET_STUN_SSLTCP_CLIENT ||
         type == P2P_SOCKET_STUN_TLS_CLIENT);
}

P2PSocketStunTcp::~P2PSocketStunTcp() {}

bool P2PSocketStunTcp::ProcessInput(char* input,
                                    int input_len,
                                    size_t* bytes_consumed) {
  *bytes_consumed = 0;
  if (input_len < kPacketHeaderSize + kPacketLengthOffset)
    return true;

  int pad_bytes;
  int packet_size = GetExpectedPacketSize(
      reinterpret_cast<const uint8_t*>(input), input_len, &pad_bytes);

  if (input_len < packet_size + pad_bytes)
    return true;

  // We have a complete packet. Read through it.
  char* cur = input;
  *bytes_consumed = packet_size + pad_bytes;
  return OnPacket(std::vector<int8_t>(cur, cur + packet_size));
}

void P2PSocketStunTcp::DoSend(
    const net::IPEndPoint& to,
    const std::vector<int8_t>& data,
    const rtc::PacketOptions& options,
    const net::NetworkTrafficAnnotationTag traffic_annotation) {
  // Each packet is expected to have header (STUN/TURN ChannelData), where
  // header contains message type and and length of message.
  if (data.size() < kPacketHeaderSize + kPacketLengthOffset) {
    NOTREACHED();
    OnError();
    return;
  }

  int pad_bytes;
  size_t expected_len = GetExpectedPacketSize(
      reinterpret_cast<const uint8_t*>(&data[0]), data.size(), &pad_bytes);

  // Accepts only complete STUN/TURN packets.
  if (data.size() != expected_len) {
    NOTREACHED();
    OnError();
    return;
  }

  // Add any pad bytes to the total size.
  int size = data.size() + pad_bytes;

  SendBuffer send_buffer(options.packet_id,
                         base::MakeRefCounted<net::DrainableIOBuffer>(
                             base::MakeRefCounted<net::IOBuffer>(size), size),
                         traffic_annotation);
  memcpy(send_buffer.buffer->data(), &data[0], data.size());

  cricket::ApplyPacketOptions(
      reinterpret_cast<uint8_t*>(send_buffer.buffer->data()), data.size(),
      options.packet_time_params, rtc::TimeMicros());

  if (pad_bytes) {
    char padding[4] = {0};
    DCHECK_LE(pad_bytes, 4);
    memcpy(send_buffer.buffer->data() + data.size(), padding, pad_bytes);
  }

  // WriteOrQueue may free the memory, so dump it first.
  delegate_->DumpPacket(
      base::make_span(reinterpret_cast<uint8_t*>(send_buffer.buffer->data()),
                      data.size()),
      false);

  WriteOrQueue(send_buffer);
}

int P2PSocketStunTcp::GetExpectedPacketSize(const uint8_t* data,
                                            int len,
                                            int* pad_bytes) {
  DCHECK_LE(kTurnChannelDataHeaderSize, len);
  // Both stun and turn had length at offset 2.
  int packet_size = base::NetToHost16(
      *reinterpret_cast<const uint16_t*>(data + kPacketLengthOffset));

  // Get packet type (STUN or TURN).
  uint16_t msg_type =
      base::NetToHost16(*reinterpret_cast<const uint16_t*>(data));

  *pad_bytes = 0;
  // Add heder length to packet length.
  if ((msg_type & 0xC000) == 0) {
    packet_size += kStunHeaderSize;
  } else {
    packet_size += kTurnChannelDataHeaderSize;
    // Calculate any padding if present.
    if (packet_size % 4)
      *pad_bytes = 4 - packet_size % 4;
  }
  return packet_size;
}

}  // namespace network

redpajama_set_name: RedPajamaGithub


text:
The best photos as Liverpool win UEFA Super Cup in Istanbul
Joanna Durkan
Liverpool added another piece of the silverware to the cabinet with a dramatic 5-4 win on penalties in the UEFA Super Cup against Chelsea.
The Reds' quest to continue to add to the honours board brought them back to a city which holds tremendous significance for the club stretching back to that night in 2005.
And the encounter proved to be a momentous occasion for a number of reasons, one of which was the appointment of Stephanie Frappart, who became the first woman to referee a major European men's game.
Jurgen Klopp's side were greeted by a Besiktas Park crowd who were heavily in favour of the team from Merseyside, but there was little to cheer about for large parts of the first-half as Chelsea came out on top to take a lead into the interval.
But they would soon be pegged back after Roberto Firmino made an instant impact to set up Sadio Mane with a stunning deft touch.
A topsy-turvy and controversial encounter would soon follow as the game was forced into extra-time with Mane again finding the net to establish a lead, before Adrian was penalised in the box moments later to allow Chelsea to equalise from the spot.
And while it was a night whereby players were left on a heap on the floor, one final push was required in a penalty shootout.
It was the perfect platform for Adrian to cement his place in club history and he did just that by denying Tammy Abraham to secure a 5-4 win on penalties, earning himself a mass celebration from his teammates and manager.
Jordan Henderson was again on hand to provide the perfect trophy lift as Liverpool's success in Europe in 2019 continued, and the players, rightfully, couldn't wipe the smiles off their faces.
Next on the horizon for Liverpool is a trip to Southampton for the second Premier League fixture of the season, where Klopp's men will look to make it two from two.
Tags Liverpool vs Chelsea, Media, Photos, UEFA Super Cup

redpajama_set_name: RedPajamaCommonCrawl


WKIP (1450 kHz) is a commercial AM radio station licensed to Poughkeepsie, New York. The station is owned by iHeartMedia and broadcasts at 1,000 watts, daytime and nighttime, from a two tower array adjacent to its studios in the Arlington section of the Town of Poughkeepsie. It uses a directional antenna in the daytime, but changes to a non-directional antenna at night, an unusual switch from standard practice where many AM stations are non-directional by day and directional at night.
Weekdays begin with a local morning show, "Hudson Valley Focus Live with Tom Sipos." The rest of the day features nationally syndicated shows, mostly from co-owned Premiere Networks, including Rush Limbaugh, Sean Hannity, Glenn Beck, Mark Levin, Buck Sexton, Clyde Lewis, Coast to Coast AM with George Noory and This Morning, America's First News with Gordon Deal. Weekends feature shows from Kim Komando, Joe Pags, Gary Sullivan, Leo Laporte, Ric Edelman, Bill Handel, Bill Cunningham and The Jesus Christ Show. Some weekend hours are paid brokered programming. Most hours begin with world and national news from Fox News Radio.
To supplement coverage, WKIP programming is also heard on an FM translator station on 98.5 MHz.
Originally owned by Poughkeepsie Newspaper Incorporated, WKIP signed on the air on June 6, 1940, with 250 watts of power at 1420 kilocycles. It was the first radio station in Dutchess County since the move of WOKO from Beacon to Albany a decade earlier. Like many other "local" frequency stations, the Federal Communications Commission had it move to a new frequency in 1941, after the NARBA treaty and realignment, 1450 kHz. WKIP began as an NBC Blue Network affiliate, carrying its schedule of dramas, comedies, news, sports, game shows, soap operas and big band broadcasts during the Golden Age of Radio. In 1945, the Blue Network became today's ABC Radio Network. WKIP's involvement with ABC would last for the remainder of the 20th Century.
With the shift of network programming from AM to TV, WKIP evolved into a full service Middle of the Road and news format in the 1950s, a time where WKIP also added FM coverage when it purchased the former WHVS at 104.7 MHz in 1958. Rechristened WKIP-FM, the station was sold a decade later and is now WSPK.
WKIP maintained its original format and ownership until late 1967 when the station was sold to Star Broadcasting, which changed the format the next year to Top 40. Around the same time, the ABC Radio Network switched to four sub-networks. WKIP signed up with the Top 40-leaning American Contemporary Network feed. The station was not successful with its new format against competitor 950 WHVW and that October returned to its prior MOR format.
In 1970, WKIP was sold again, this time to Olympian Broadcasting (to whom Star had sold WKIP-FM to two years earlier and who would resell that station to WBNR owner Lance Broadcasting). Modifying the format to full service adult contemporary, WKIP rose from being in last place to first place with a combination of increased local involvement and help from format changes at WHVW and WEOK, until the mid-1980s.
When Richard Novick purchased WKIP from Olympian in 1987, assorted changes started to take place starting with Novick allowing veteran morning host Van Risthie to leave for WHVW. This move plus the imminent decline of full-service AM formats led WKIP to go through a short-lived Fun and Games (hybrid oldies/talk) format with the station going to a talk radio format in 1989. At that time, Novick launched FM station 92.1 WRNQ, which had the spirit of WKIP's former format, as well as Van Risthie. WRNQ was an automated station.
The talk radio format would last for the entire 1990s, surviving a simulcast attempt with the Novick-controlled 96.9 MHz which also sported the WKIP-FM calls. After Straus Media purchased Novick's stations in November 1996, elements of WKIP's programming began to be heard on sister stations in Ellenville, Hudson, and Catskill.
WKIP and all of Straus's stations were sold to Clear Channel Communications (now iHeartMedia) in June 2000 with Clear Channel taking control of the stations that October. With the ownership change came a new format, the "Music of Your Life" adult standards format, as part of the Hudson Valley Nostalgia Network (a simulcast, minus commercials, with WELV in Ellenville, WGHQ in Kingston, and WHUC in Hudson).
The "Nostalgia Network" was dismantled in 2004 with WKIP keeping the standards format for three more years. Then in October 2007, the station returned to talk radio programming, carrying mostly shows from iHeart's Premiere Radio Networks.
On June 10, 2008 WKIP dropped Quinn and Rose and began running the syndicated Don Imus morning show until October 1, 2012 when he was replaced by Hudson Valley Focus Live with Tom Sipos.
^ "WKIP Facility Record". United States Federal Communications Commission, audio division.


text:
package org.springframework.boot.maven;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;

import org.assertj.core.api.AbstractAssert;
import org.assertj.core.api.AssertProvider;
import org.assertj.core.api.ListAssert;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.contentOf;

/**
 * Base class for archive (jar or war) related Maven plugin integration tests.
 *
 * @author Andy Wilkinson
 * @author Scott Frederick
 */
abstract class AbstractArchiveIntegrationTests {

	protected String buildLog(File project) {
		return contentOf(new File(project, "target/build.log"));
	}

	protected String launchScript(File jar) {
		String content = contentOf(jar);
		return content.substring(0, content.indexOf(new String(new byte[] { 0x50, 0x4b, 0x03, 0x04 })));
	}

	protected AssertProvider<JarAssert> jar(File file) {
		return new AssertProvider<>() {

			@Override
			@Deprecated(since = "2.3.0", forRemoval = false)
			public JarAssert assertThat() {
				return new JarAssert(file);
			}

		};
	}

	protected Map<String, List<String>> readLayerIndex(JarFile jarFile) throws IOException {
		if (getLayersIndexLocation() == null) {
			return Collections.emptyMap();
		}
		Map<String, List<String>> index = new LinkedHashMap<>();
		String layerPrefix = "- ";
		String entryPrefix = "  - ";
		ZipEntry indexEntry = jarFile.getEntry(getLayersIndexLocation());
		try (BufferedReader reader = new BufferedReader(new InputStreamReader(jarFile.getInputStream(indexEntry)))) {
			String line = reader.readLine();
			String layer = null;
			while (line != null) {
				if (line.startsWith(layerPrefix)) {
					layer = line.substring(layerPrefix.length() + 1, line.length() - 2);
					index.put(layer, new ArrayList<>());
				}
				else if (line.startsWith(entryPrefix)) {
					index.computeIfAbsent(layer, (key) -> new ArrayList<>())
							.add(line.substring(entryPrefix.length() + 1, line.length() - 1));
				}
				line = reader.readLine();
			}
			return index;
		}
	}

	protected String getLayersIndexLocation() {
		return null;
	}

	protected List<String> readClasspathIndex(JarFile jarFile, String location) throws IOException {
		List<String> index = new ArrayList<>();
		String entryPrefix = "- ";
		ZipEntry indexEntry = jarFile.getEntry(location);
		try (BufferedReader reader = new BufferedReader(new InputStreamReader(jarFile.getInputStream(indexEntry)))) {
			String line = reader.readLine();
			while (line != null) {
				if (line.startsWith(entryPrefix)) {
					index.add(line.substring(entryPrefix.length() + 1, line.length() - 1));
				}
				line = reader.readLine();
			}
		}
		return index;
	}

	static final class JarAssert extends AbstractAssert<JarAssert, File> {

		private JarAssert(File actual) {
			super(actual, JarAssert.class);
			assertThat(actual).exists();
		}

		JarAssert doesNotHaveEntryWithName(String name) {
			withJarFile((jarFile) -> {
				withEntries(jarFile, (entries) -> {
					Optional<JarEntry> match = entries.filter((entry) -> entry.getName().equals(name)).findFirst();
					assertThat(match).isNotPresent();
				});
			});
			return this;
		}

		JarAssert hasEntryWithName(String name) {
			withJarFile((jarFile) -> {
				withEntries(jarFile, (entries) -> {
					Optional<JarEntry> match = entries.filter((entry) -> entry.getName().equals(name)).findFirst();
					assertThat(match).hasValueSatisfying((entry) -> assertThat(entry.getComment()).isNull());
				});
			});
			return this;
		}

		JarAssert hasEntryWithNameStartingWith(String prefix) {
			withJarFile((jarFile) -> {
				withEntries(jarFile, (entries) -> {
					Optional<JarEntry> match = entries.filter((entry) -> entry.getName().startsWith(prefix))
							.findFirst();
					assertThat(match).hasValueSatisfying((entry) -> assertThat(entry.getComment()).isNull());
				});
			});
			return this;
		}

		JarAssert hasUnpackEntryWithNameStartingWith(String prefix) {
			withJarFile((jarFile) -> {
				withEntries(jarFile, (entries) -> {
					Optional<JarEntry> match = entries.filter((entry) -> entry.getName().startsWith(prefix))
							.findFirst();
					assertThat(match).as("Name starting with %s", prefix)
							.hasValueSatisfying((entry) -> assertThat(entry.getComment()).startsWith("UNPACK:"));
				});
			});
			return this;
		}

		JarAssert doesNotHaveEntryWithNameStartingWith(String prefix) {
			withJarFile((jarFile) -> {
				withEntries(jarFile, (entries) -> {
					Optional<JarEntry> match = entries.filter((entry) -> entry.getName().startsWith(prefix))
							.findFirst();
					assertThat(match).isNotPresent();
				});
			});
			return this;
		}

		ListAssert<String> entryNamesInPath(String path) {
			List<String> matches = new ArrayList<>();
			withJarFile((jarFile) -> withEntries(jarFile, (entries) -> matches.addAll(entries.map(ZipEntry::getName)
					.filter((name) -> name.startsWith(path) && name.length() > path.length()).toList())));
			return new ListAssert<>(matches);
		}

		JarAssert manifest(Consumer<ManifestAssert> consumer) {
			withJarFile((jarFile) -> {
				try {
					consumer.accept(new ManifestAssert(jarFile.getManifest()));
				}
				catch (IOException ex) {
					throw new RuntimeException(ex);
				}
			});
			return this;
		}

		void withJarFile(Consumer<JarFile> consumer) {
			try (JarFile jarFile = new JarFile(this.actual)) {
				consumer.accept(jarFile);
			}
			catch (Exception ex) {
				throw new RuntimeException(ex);
			}
		}

		void withEntries(JarFile jarFile, Consumer<Stream<JarEntry>> entries) {
			entries.accept(Collections.list(jarFile.entries()).stream());
		}

		static final class ManifestAssert extends AbstractAssert<ManifestAssert, Manifest> {

			private ManifestAssert(Manifest actual) {
				super(actual, ManifestAssert.class);
			}

			ManifestAssert hasStartClass(String expected) {
				assertThat(this.actual.getMainAttributes().getValue("Start-Class")).isEqualTo(expected);
				return this;
			}

			ManifestAssert hasMainClass(String expected) {
				assertThat(this.actual.getMainAttributes().getValue("Main-Class")).isEqualTo(expected);
				return this;
			}

			ManifestAssert hasAttribute(String name, String value) {
				assertThat(this.actual.getMainAttributes().getValue(name)).isEqualTo(value);
				return this;
			}

			ManifestAssert doesNotHaveAttribute(String name) {
				assertThat(this.actual.getMainAttributes().getValue(name)).isNull();
				return this;
			}

		}

	}

}


In 1975, Northwestern students began Northwestern Dance Marathon, an annual event that has gone on to be a pillar of our university's identity. It's been 43 years since the original fundraiser first came into this world in the sweaty bowels of Blomquist. A lot has happened in that time: the Berlin Wall fell, the internet was created, Flappy Bird came and went. The world has changed in ways we could have never imagined. Yet, we still place thousands of students in a tent in hopes of making the world a better place. To the people of Northwestern, I write to you today to urge decisive action: let's close the tent and open our eyes--let's cancel Dance Marathon.
Let's be clear: we have no qualms with NUDM or the wonderful people who run it, at least none that we're aware of. Maybe we got dumped by one of them one time, but that's not what this is about. The truth is we don't hate philanthropy. We don't hate dancing. We just don't see why they have to go hand-in-hand.
For many students, NUDM is a pillar of their Wildcat experience. They want to dance and they want to make an impact. But why must they go hand-in-hand? The year is 2017. We can order tacos from little electronic blocks of metal we keep in our pockets. Surely there must be a way to raise over one million dollars without blindly thrusting body parts until your bones feel like spaghetti.
Fortunately, there is. Through our fundraising efforts, we'll be able to make a difference and keep students from wasting away for a 10-block nightmare. We are so close to hitting our goal, and with your help, we can save these dancers. Morty promised us that Northwestern would remain a safe space. But 30 hours of forced dancing seems like the farthest thing from that. Let's keep this school a bastion of freedom and avoiding real estate tax.
I know NUDM is starting just as we release this statement. By the time you've read this, hundreds of uncertain freshman and a plethora of Greek-affiliated upperclassmen will enter the tents of Cirque-du-soul-pain. But it's not too late. If we can hit our one million, two hundred and one thousand, two hundred and seventeen dollar goal, we can just donate that to charity and stop the gyrating. We can still stop the dancing. We can still start the healing.
As the sun begins to set, I dream of a sunrise that illuminates a world with zero blocks and zero-hour-clubs.


the authentic beauty of is brought to life with all new eye catching ii farmhouse sink an exquisite blend fireclay 33.
kw wood burner fireplace warehouse denver.
backyard discovery castle all cedar playhouse aspen assembly.
farmhouse sink series x stainless steel gauge single bowl kitchen kohler 33.
house color simulator paint colors for exterior visualize ho.


Edible goldflakes, exotic caviar, sounds like a meal fit for Kings. If you are ready to lose your purse strings, then you can tuck into these gastronomical delights. The show also takes a look at JJ Valaya's 'Tasveer' collection.
Ad Spends This Festive Season: Who Were the Big Spenders?