X-Git-Url: https://roy.marples.name/git diff --git a/src/dhcpcd-gtk/dhcpcd-gtk.h b/src/dhcpcd-gtk/dhcpcd-gtk.h index 610b14e..309c814 100644 --- a/src/dhcpcd-gtk/dhcpcd-gtk.h +++ b/src/dhcpcd-gtk/dhcpcd-gtk.h @@ -27,8 +27,6 @@ #ifndef DHCPCD_GTK_H #define DHCPCD_GTK_H -#include - #include #include @@ -36,24 +34,11 @@ #include #include -#include "libdhcpcd.h" +#include "dhcpcd.h" +#include "queue.h" #define PACKAGE "dhcpcd-gtk" -/* Work out if we have a private address or not - * 10/8 - * 172.16/12 - * 192.168/16 - */ -#ifndef IN_PRIVATE -# define IN_PRIVATE(addr) (((addr & IN_CLASSA_NET) == 0x0a000000) || \ - ((addr & 0xfff00000) == 0xac100000) || \ - ((addr & IN_CLASSB_NET) == 0xc0a80000)) -#endif -#ifndef IN_LINKLOCAL -# define IN_LINKLOCAL(addr) ((addr & IN_CLASSB_NET) == 0xa9fe0000) -#endif - #define UNCONST(a) ((void *)(unsigned long)(const void *)(a)) #ifdef __GNUC__ @@ -62,23 +47,44 @@ # define _unused #endif +typedef struct wi_menu { + TAILQ_ENTRY(wi_menu) next; + DHCPCD_WI_SCAN *scan; + GtkWidget *menu; + GtkWidget *ssid; + GtkWidget *icon; + GtkWidget *bar; +} WI_MENU; +typedef TAILQ_HEAD(wi_menu_head, wi_menu) WI_MENUS; + typedef struct wi_scan { - DHCPCD_CONNECTION *connection; + TAILQ_ENTRY(wi_scan) next; DHCPCD_IF *interface; DHCPCD_WI_SCAN *scans; - struct wi_scan *next; + + GtkWidget *ifmenu; + WI_MENUS menus; } WI_SCAN; -extern WI_SCAN *wi_scans; +typedef TAILQ_HEAD(wi_scan_head, wi_scan) WI_SCANS; +extern WI_SCANS wi_scans; WI_SCAN * wi_scan_find(DHCPCD_WI_SCAN *); void menu_init(GtkStatusIcon *, DHCPCD_CONNECTION *); +void menu_update_scans(WI_SCAN *, DHCPCD_WI_SCAN *); void notify_close(void); -void dhcpcd_prefs_show(DHCPCD_CONNECTION *con); -void dhcpcd_prefs_abort(void); +void prefs_show(DHCPCD_CONNECTION *con); +void prefs_abort(void); +void menu_abort(void); +void wpa_abort(void); + +bool wpa_configure(DHCPCD_WPA *, DHCPCD_WI_SCAN *); + +#if GTK_MAJOR_VERSION == 2 +GtkWidget *gtk_box_new(GtkOrientation, gint); +#endif -bool wpa_configure(DHCPCD_CONNECTION *, DHCPCD_IF *, DHCPCD_WI_SCAN *); #endif