#define F_COPYONWRITE 4 /**< flag to tell us a file is exported using
copyonwrite */
#define F_AUTOREADONLY 8 /**< flag to tell us a file is set to autoreadonly */
#define F_COPYONWRITE 4 /**< flag to tell us a file is exported using
copyonwrite */
#define F_AUTOREADONLY 8 /**< flag to tell us a file is set to autoreadonly */
GHashTable *children;
char pidfname[256]; /**< name of our PID file */
char pidftemplate[256]; /**< template to be used for the filename of the PID file */
GHashTable *children;
char pidfname[256]; /**< name of our PID file */
char pidftemplate[256]; /**< template to be used for the filename of the PID file */
{ "copyonwrite", FALSE, PARAM_BOOL, NULL, F_COPYONWRITE },
{ "autoreadonly", FALSE, PARAM_BOOL, NULL, F_AUTOREADONLY },
{ "sparse_cow", FALSE, PARAM_BOOL, NULL, F_SPARSE },
{ "copyonwrite", FALSE, PARAM_BOOL, NULL, F_COPYONWRITE },
{ "autoreadonly", FALSE, PARAM_BOOL, NULL, F_AUTOREADONLY },
{ "sparse_cow", FALSE, PARAM_BOOL, NULL, F_SPARSE },
PARAM gp[] = {
{ "user", FALSE, PARAM_STRING, &runuser, 0 },
{ "group", FALSE, PARAM_STRING, &rungroup, 0 },
PARAM gp[] = {
{ "user", FALSE, PARAM_STRING, &runuser, 0 },
{ "group", FALSE, PARAM_STRING, &rungroup, 0 },
lp[6].target=&(s.prerun);
lp[7].target=&(s.postrun);
lp[8].target=lp[9].target=lp[10].target=
lp[6].target=&(s.prerun);
lp[7].target=&(s.postrun);
lp[8].target=lp[9].target=lp[10].target=
+#ifndef WITH_SDP
+ if(s.flags && F_SDP) {
+ g_set_error(e, errdomain, CFILE_VALUE_UNSUPPORTED, "This nbd-server was built without support for SDP, yet group %s uses it", groups[i]);
+ g_array_free(retval, TRUE);
+ g_key_file_free(cfile);
+ return NULL;
+ }
+#endif
- if ((serve->socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+
+ af = AF_INET;
+#ifdef WITH_SDP
+ if ((serve->flags) && F_SDP) {
+ af = AF_INET_SDP;
+ }
+#endif
+ if ((serve->socket = socket(af, SOCK_STREAM, IPPROTO_TCP)) < 0)
DEBUG("Waiting for connections... bind, ");
addrin.sin_family = AF_INET;
DEBUG("Waiting for connections... bind, ");
addrin.sin_family = AF_INET;
addrin.sin_port = htons(serve->port);
addrin.sin_addr.s_addr = 0;
if (bind(serve->socket, (struct sockaddr *) &addrin, addrinlen) < 0)
addrin.sin_port = htons(serve->port);
addrin.sin_addr.s_addr = 0;
if (bind(serve->socket, (struct sockaddr *) &addrin, addrinlen) < 0)