new get_in_addr
This commit is contained in:
parent
9a0995dbd0
commit
de9b0555a7
19
src/net.c
19
src/net.c
|
@ -17,16 +17,19 @@
|
|||
#include "net.h"
|
||||
|
||||
|
||||
// kleiner helfer
|
||||
// auch von bejee geguttenbergt
|
||||
//
|
||||
void *get_in_addr(struct sockaddr *sa)
|
||||
{
|
||||
if (sa->sa_family == AF_INET) {
|
||||
// little helper
|
||||
static void *get_in_addr(struct sockaddr *sa) {
|
||||
switch (sa->sa_family) {
|
||||
case AF_INET:
|
||||
return &(((struct sockaddr_in*)sa)->sin_addr);
|
||||
}
|
||||
|
||||
break;
|
||||
case AF_INET6:
|
||||
return &(((struct sockaddr_in6*)sa)->sin6_addr);
|
||||
break;
|
||||
case AF_UNSPEC:
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "msg.h" // message serialization
|
||||
#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_client(const struct prog_info *pinfo,void(*framecallback)(const struct message *, const struct prog_info *));
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user