From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 2/5] storage: add storage_get_ap_path
Date: Fri, 30 Oct 2020 11:48:55 -0700 [thread overview]
Message-ID: <fedf9f52e015a2d323fd07b798c43a30b445e96a.camel@gmail.com> (raw)
In-Reply-To: <aac22e4c-862a-57f5-5f28-7afad5aa9296@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]
Hi Denis,
> >
> > +char *storage_get_ap_path(const char *format, ...)
> > +{
> > + va_list args;
> > + char *fmt, *str;
> > +
> > + if (!format)
> > + return l_strdup(storage_ap_path);
> > +
> > + fmt = l_strdup_printf("%s/%s", storage_ap_path, format);
> > +
> > + va_start(args, format);
> > + str = l_strdup_vprintf(fmt, args);
> > + va_end(args);
> > +
> > + l_free(fmt);
> > + return str;
> > +}
> > +
>
> I think this really isn't necessary, you could use storage_get_path
> for this
> just as well. Or just return storage_ap_path which is all you're
> using this for.
>
> The more useful thing might be to actually obtain the AP path given
> an SSID...
Yeah I was just copying the way network/hotspot did it. But yes your
right, its rather complex for the one or two places it would be used.
And even getting the AP path + SSID should be easy enough:
path = storage_get_path("ap/%s", ssid);
I could also refactor hotspot to do this as well at some point.
>
> > char *storage_get_network_file_path(enum security type, const
> > char *ssid)
> > {
> > char *path;
> > diff --git a/src/storage.h b/src/storage.h
> > index d9b17c7f..a6076d63 100644
> > --- a/src/storage.h
> > +++ b/src/storage.h
> > @@ -36,6 +36,7 @@ bool storage_create_dirs(void);
> > void storage_cleanup_dirs(void);
> > char *storage_get_path(const char *format, ...);
> > char *storage_get_hotspot_path(const char *format, ...);
> > +char *storage_get_ap_path(const char *format, ...);
> >
> > const char *storage_network_filename_from_path(const char *path);
> > const char *storage_network_ssid_from_path(const char *path,
> >
>
> Regards,
> -Denis
next prev parent reply other threads:[~2020-10-30 18:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 16:34 [PATCH 1/5] storage: add storage_network_filename_from_path James Prestwood
2020-10-30 16:34 ` [PATCH 2/5] storage: add storage_get_ap_path James Prestwood
2020-10-30 18:41 ` Denis Kenzior
2020-10-30 18:48 ` James Prestwood [this message]
2020-10-30 16:34 ` [PATCH 3/5] ap: add provisioning file parsing James Prestwood
2020-10-30 16:34 ` [PATCH 4/5] ap: add StartWithConfig DBus method James Prestwood
2020-10-30 18:37 ` Denis Kenzior
2020-10-30 18:42 ` James Prestwood
2020-10-30 16:34 ` [PATCH 5/5] ap: allow DHCP settings in provisioning files James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fedf9f52e015a2d323fd07b798c43a30b445e96a.camel@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.