summaryrefslogtreecommitdiff
path: root/usr.sbin/hoststated/hoststated.h
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2006-12-16 18:50:34 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2006-12-16 18:50:34 +0000
commit19d82ea2d7751a0b7ec8fa66d2a2053a369f0403 (patch)
treed91fc3a03e096ac77beaf625f8687d85b92e7b05 /usr.sbin/hoststated/hoststated.h
parenteb9e468ffdd8750ab38d6914ccb20acb388e2102 (diff)
- allow to use host/service/table names instead of Ids in hostatectl.
- minor change of the "hostatectl show" command output - increase the max service and tag names (max pf tag name size is 64 now!) thanks to pyr who found a bug in my initial diff
Diffstat (limited to 'usr.sbin/hoststated/hoststated.h')
-rw-r--r--usr.sbin/hoststated/hoststated.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/usr.sbin/hoststated/hoststated.h b/usr.sbin/hoststated/hoststated.h
index 0191df4100c..2187d838a3f 100644
--- a/usr.sbin/hoststated/hoststated.h
+++ b/usr.sbin/hoststated/hoststated.h
@@ -23,9 +23,11 @@
#define CONNECT_TIMEOUT 200
#define CHECK_INTERVAL 10
#define EMPTY_TABLE UINT_MAX
-#define TABLE_NAME_SIZE 16
-#define TAG_NAME_SIZE 16
-#define SRV_NAME_SIZE 16
+#define EMPTY_ID UINT_MAX
+#define TABLE_NAME_SIZE 32
+#define TAG_NAME_SIZE 64
+#define SRV_NAME_SIZE 64
+#define MAX_NAME_SIZE 64
#define SRV_MAX_VIRTS 16
#define READ_BUF_SIZE 65535
@@ -113,6 +115,11 @@ struct ctl_status {
int up;
};
+struct ctl_id {
+ objid_t id;
+ char name[MAX_NAME_SIZE];
+};
+
struct address {
struct sockaddr_storage ss;
in_port_t port;
@@ -275,12 +282,12 @@ void imsg_event_add(struct imsgbuf *); /* needs to be provided externally */
/* pfe.c */
pid_t pfe(struct hostated *, int [2], int [2], int [2]);
void show(struct ctl_conn *);
-int enable_service(struct ctl_conn *, objid_t);
-int enable_table(struct ctl_conn *, objid_t);
-int enable_host(struct ctl_conn *, objid_t);
-int disable_service(struct ctl_conn *, objid_t);
-int disable_table(struct ctl_conn *, objid_t);
-int disable_host(struct ctl_conn *, objid_t);
+int enable_service(struct ctl_conn *, struct ctl_id *);
+int enable_table(struct ctl_conn *, struct ctl_id *);
+int enable_host(struct ctl_conn *, struct ctl_id *);
+int disable_service(struct ctl_conn *, struct ctl_id *);
+int disable_table(struct ctl_conn *, struct ctl_id *);
+int disable_host(struct ctl_conn *, struct ctl_id *);
/* pfe_filter.c */
void init_filter(struct hostated *);
@@ -308,3 +315,6 @@ int check_http_digest(struct host *, struct table *);
struct host *host_find(struct hostated *, objid_t);
struct table *table_find(struct hostated *, objid_t);
struct service *service_find(struct hostated *, objid_t);
+struct host *host_findbyname(struct hostated *, const char *);
+struct table *table_findbyname(struct hostated *, const char *);
+struct service *service_findbyname(struct hostated *, const char *);