serval-dna/socket.h
Daniel O'Connor c4f19f8a82 Factor out code to fill in a sockaddr_un to a single function and remove overlay_mdp.c's duplicate socket handling (which was incomplete).
All platforms except Android use normal sockets (although this is easy to change and the choice is keyed off a single define).
This gives consistent handling to unix domain sockets which were previously a mishmash where some were always normal, some always abstract and some chose (but in different ways). It also gives consistent error checking.

Doesn't pass tests yet though.
2012-06-24 00:38:47 +09:30

6 lines
158 B
C

int socket_bind(const char *name);
void socket_setname(struct sockaddr_un *sockname, const char *name, socklen_t *len);
void socket_done(const char *name);