Lines Matching defs:config
7 #include "config.h"
51 void configfree(AFPConfig *configs, const AFPConfig *config)
57 if (p == config)
147 static void dsi_cleanup(const AFPConfig *config)
153 DSI *dsi = (DSI *)config->obj.handle;
186 static void asp_cleanup(const AFPConfig *config)
190 nbp_unrgstr(config->obj.Obj, config->obj.Type, config->obj.Zone,
191 &config->obj.options.ddpaddr);
196 static int asp_start(AFPConfig *config, AFPConfig *configs,
201 if (!(asp = asp_getsession(config->obj.handle, server_children,
202 config->obj.options.tickleval))) {
208 configfree(configs, config); /* free a bunch of stuff */
209 afp_over_asp(&config->obj);
217 static afp_child_t *dsi_start(AFPConfig *config, AFPConfig *configs,
220 DSI *dsi = config->obj.handle;
225 config->obj.options.tickleval))) {
227 configfree(configs, config);
228 afp_over_dsi(&config->obj); /* start a session */
239 AFPConfig *config;
245 if ((config = (AFPConfig *) calloc(1, sizeof(AFPConfig))) == NULL)
250 free(config);
257 free(config);
280 if ((config->obj.Obj = strdup(Obj)) == NULL)
283 if ((config->obj.Type = strdup(Type)) == NULL) {
284 free(config->obj.Obj);
288 if ((config->obj.Zone = strdup(Zone)) == NULL) {
289 free(config->obj.Obj);
290 free(config->obj.Type);
298 free(config->obj.Obj);
299 free(config->obj.Type);
300 free(config->obj.Zone);
309 config->fd = atp_fileno(atp);
310 config->obj.handle = asp;
311 config->obj.config = config;
312 config->obj.proto = AFPPROTO_ASP;
314 memcpy(&config->obj.options, options, sizeof(struct afp_options));
315 config->optcount = refcount;
318 config->server_start = asp_start;
319 config->server_cleanup = asp_cleanup;
321 return config;
325 free(config);
335 AFPConfig *config;
339 if ((config = (AFPConfig *) calloc(1, sizeof(AFPConfig))) == NULL) {
340 LOG(log_error, logtype_afpd, "DSIConfigInit: malloc(config): %s", strerror(errno) );
354 free(config);
436 config->server_cleanup = dsi_cleanup;
443 config->fd = dsi->serversock;
444 config->obj.handle = dsi;
445 dsi->AFPobj = &config->obj;
446 config->obj.config = config;
447 config->obj.proto = AFPPROTO_DSI;
449 memcpy(&config->obj.options, options, sizeof(struct afp_options));
452 p = config->obj.options.server;
456 config->optcount = refcount;
459 config->server_start = dsi_start;
460 return config;
464 * entry in config->last or something like that. that would make
469 AFPConfig *config = NULL, *next = NULL;
481 (config = ASPConfigInit(options, refcount)))
482 config->defoptions = defoptions;
500 ((options->flags & OPTION_PROXY) && config))
513 status_init(config, next, options);
515 /* attach dsi config to tail of asp config */
516 if (config) {
517 config->next = next;
518 return config;
531 AFPConfig *config=NULL, *first = NULL;
533 /* if config file doesn't exist, load defaults */
569 config = first->next ? first->next : first;
570 } else if ((config->next = AFPConfigInit(&options, cmdline))) {
571 config = config->next->next ? config->next->next : config->next;