Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ac000/udp-fwder
Program to post information contained in UDP packets to a web server
https://github.com/ac000/udp-fwder
Last synced: 7 days ago
JSON representation
Program to post information contained in UDP packets to a web server
- Host: GitHub
- URL: https://github.com/ac000/udp-fwder
- Owner: ac000
- License: mit
- Created: 2014-12-01T00:46:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-06T23:07:49.000Z (over 5 years ago)
- Last Synced: 2023-04-14T01:30:47.418Z (over 1 year ago)
- Language: C
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
Getting Started
===============The only requirement to compile this is libcurl.
# yum install make gcc libcurl libcurl-dev
should ensure you have what you need.
Before you compile the server, you should edit the config.h file for your
situation. A simple make should then build the program which can then be
started by$ ./udp-server
NOTE: It does not need to (and really shouldn't) run as root.
Pressing Ctrl-c will terminate the server and display some statistics.
How It Works
============The server is built as a multi-threaded program. The main thread is
responsible for receiving the UDP packets and the other threads then pass
that data onto the destination server.Due to the packet rates required to be handled, in the 5,000 to 10,000
pkts/sec range, it is required to buffer the UDP packet data in the server.This data is stored in a circular buffer that can contain QUEUE_SZ entries.
The main thread upon receiving a UDP packet places its data into the buffer.
The forwarder threads then take the data out of this buffer and send them
to the remote web server via HTTP GET using libcurl.If the web server can't accept the requests as quick as the packets are
comming into the server then it is likely that at some point the buffer
will overflow. If this happens the server will display a "Queue overflow..."
message. This means some packets will have been overwritten in the buffer.
This bahaviour could be easily changed to say, terminate the server on such
instances.License
=======This is licensed under the MIT license. See MIT-LICENSE.txt