mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
first version
This commit is contained in:
commit
f03f55ff92
28 changed files with 5682 additions and 0 deletions
39
src/include/networksocket.h
Normal file
39
src/include/networksocket.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef __DAWN_NETWORKSOCKET_H
|
||||
#define __DAWN_NETWORKSOCKET_H
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
pthread_mutex_t send_mutex;
|
||||
|
||||
/**
|
||||
* Init a socket using the runopts.
|
||||
* @param _ip - ip to use.
|
||||
* @param _port - port to use.
|
||||
* @param _multicast_socket - if socket should be multicast or broadcast.
|
||||
* @return the socket.
|
||||
*/
|
||||
int init_socket_runopts(const char *_ip, int _port, int _multicast_socket);
|
||||
|
||||
/**
|
||||
* Send message via network.
|
||||
* @param msg
|
||||
* @return
|
||||
*/
|
||||
int send_string(char *msg);
|
||||
|
||||
/**
|
||||
* Send encrypted message via network.
|
||||
* @param msg
|
||||
* @return
|
||||
*/
|
||||
int send_string_enc(char *msg);
|
||||
|
||||
/**
|
||||
* Close socket.
|
||||
*/
|
||||
void close_socket();
|
||||
|
||||
// save connections
|
||||
// struct sockaddr_in addr[100];
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue