]> www.average.org Git - psmb.git/blobdiff - src/psmb_socket.c
function to set mgrp (IPv6 prefix and length)
[psmb.git] / src / psmb_socket.c
index 4d263526362d5137f5c616d9a2658b8220d0b0dd..c962651bc8ac21f19e7b61c63e9e815c590e1d2e 100644 (file)
@@ -67,6 +67,19 @@ psmb_result_t psmb_set_port(psmb_ctx_t *ctx, unsigned short port)
        }
 }
 
+psmb_result_t psmb_set_mgrp(psmb_ctx_t *ctx, struct in6_addr prefix,
+       unsigned char prefixlen)
+{
+       if (ctx->fd == -1) {
+               ctx->prefix = prefix;
+               ctx->prefixlen = prefixlen;
+               return (psmb_result_t){PSMB_OK};
+       } else {
+               errno = EBUSY;
+               return (psmb_result_t){PSMB_ERROR};
+       }
+}
+
 psmb_result_t psmb_open(psmb_ctx_t *ctx)
 {
        unsigned long on = 1;