Merge branch 'master' of ssh://bitsetter.de:8090/netsl
This commit is contained in:
commit
9cf94bbcbb
19
src/net.c
19
src/net.c
|
@ -17,16 +17,19 @@
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
||||||
|
|
||||||
// kleiner helfer
|
// little helper
|
||||||
// auch von bejee geguttenbergt
|
static void *get_in_addr(struct sockaddr *sa) {
|
||||||
//
|
switch (sa->sa_family) {
|
||||||
void *get_in_addr(struct sockaddr *sa)
|
case AF_INET:
|
||||||
{
|
|
||||||
if (sa->sa_family == AF_INET) {
|
|
||||||
return &(((struct sockaddr_in*)sa)->sin_addr);
|
return &(((struct sockaddr_in*)sa)->sin_addr);
|
||||||
}
|
break;
|
||||||
|
case AF_INET6:
|
||||||
return &(((struct sockaddr_in6*)sa)->sin6_addr);
|
return &(((struct sockaddr_in6*)sa)->sin6_addr);
|
||||||
|
break;
|
||||||
|
case AF_UNSPEC:
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#include "msg.h" // message serialization
|
#include "msg.h" // message serialization
|
||||||
#include "display.h" // callback
|
#include "display.h" // callback
|
||||||
|
|
||||||
void *get_in_addr(struct sockaddr *sa);
|
|
||||||
int run_server(const struct prog_info *pinfo, char *img, int w, int h);
|
int run_server(const struct prog_info *pinfo, char *img, int w, int h);
|
||||||
int run_client(const struct prog_info *pinfo,void(*framecallback)(const struct message *, const struct prog_info *));
|
int run_client(const struct prog_info *pinfo,void(*framecallback)(const struct message *, const struct prog_info *));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user