A brief file description. More...
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
Go to the source code of this file.
Data Structures | |
struct | prefetch_udp_header |
struct | Stream |
class | StreamHashTable |
Defines | |
#define | Debug(print) do { if (debug_on) printf print; } while (0) |
#define | UDP_BUF_SIZE (64 * 1024) |
#define | TSPORT 39679 |
#define | STREAM_TIMEOUT_SECS 6000 |
#define | RESPONSE_FLAG (1<<31) |
#define | LAST_PKT_FLAG (1<<30) |
#define | PKT_NUM_MASK ((1<<30)-1) |
#define | PACKET_HDR_SIZE 20 |
Typedefs | |
typedef unsigned int | uint32 |
Functions | |
int | stufferUdpStatShow () |
int | openTSConn () |
int | processPacket (const char *packet, int pkt_sz) |
int | main (int argc, char *argv[]) |
Variables | |
int | debug_on = 0 |
static int | number_of_packets_received = 0 |
static int | number_of_packets_dropped = 0 |
static int | number_of_connections_to_ts = 0 |
static int | number_of_timeouts = 0 |
StreamHashTable * | stream_hash_table |
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file StufferUdpReceiver.cc.
#define Debug | ( | ) | do { if (debug_on) printf print; } while (0) |
Definition at line 41 of file StufferUdpReceiver.cc.
Referenced by main(), and processPacket().
#define LAST_PKT_FLAG (1<<30) |
Definition at line 59 of file StufferUdpReceiver.cc.
Referenced by processPacket().
#define PACKET_HDR_SIZE 20 |
Definition at line 62 of file StufferUdpReceiver.cc.
#define PKT_NUM_MASK ((1<<30)-1) |
Definition at line 60 of file StufferUdpReceiver.cc.
Referenced by processPacket().
#define RESPONSE_FLAG (1<<31) |
Definition at line 58 of file StufferUdpReceiver.cc.
Referenced by processPacket().
#define STREAM_TIMEOUT_SECS 6000 |
Definition at line 47 of file StufferUdpReceiver.cc.
Referenced by StreamHashTable::deleteStaleStreams(), and main().
#define TSPORT 39679 |
Definition at line 45 of file StufferUdpReceiver.cc.
Referenced by openTSConn().
#define UDP_BUF_SIZE (64 * 1024) |
Definition at line 44 of file StufferUdpReceiver.cc.
Referenced by main().
typedef unsigned int uint32 |
Definition at line 48 of file StufferUdpReceiver.cc.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 296 of file StufferUdpReceiver.cc.
References ats_free(), ats_malloc(), Debug, debug_on, StreamHashTable::deleteStaleStreams(), processPacket(), STREAM_TIMEOUT_SECS, and UDP_BUF_SIZE.
int openTSConn | ( | ) |
Definition at line 183 of file StufferUdpReceiver.cc.
References number_of_connections_to_ts, and TSPORT.
Referenced by processPacket().
int processPacket | ( | const char * | packet, | |
int | pkt_sz | |||
) |
Definition at line 208 of file StufferUdpReceiver.cc.
References StreamHashTable::add(), close_socket(), Debug, Stream::fd, Stream::hdr, Stream::last_activity_time, LAST_PKT_FLAG, StreamHashTable::lookup(), Stream::next, number_of_packets_dropped, number_of_packets_received, openTSConn(), prefetch_udp_header::pkt, PKT_NUM_MASK, StreamHashTable::remove(), and RESPONSE_FLAG.
Referenced by main().
int stufferUdpStatShow | ( | ) |
Definition at line 72 of file StufferUdpReceiver.cc.
References number_of_connections_to_ts, number_of_packets_dropped, number_of_packets_received, and number_of_timeouts.
int debug_on = 0 |
Definition at line 42 of file StufferUdpReceiver.cc.
Referenced by main().
int number_of_connections_to_ts = 0 [static] |
Definition at line 67 of file StufferUdpReceiver.cc.
Referenced by openTSConn(), and stufferUdpStatShow().
int number_of_packets_dropped = 0 [static] |
Definition at line 66 of file StufferUdpReceiver.cc.
Referenced by processPacket(), and stufferUdpStatShow().
int number_of_packets_received = 0 [static] |
Definition at line 65 of file StufferUdpReceiver.cc.
Referenced by processPacket(), and stufferUdpStatShow().
int number_of_timeouts = 0 [static] |
Definition at line 68 of file StufferUdpReceiver.cc.
Referenced by StreamHashTable::deleteStaleStreams(), and stufferUdpStatShow().
Definition at line 128 of file StufferUdpReceiver.cc.