summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-10-17 10:55:44 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-10-17 10:55:44 +0000
commitb838c9908b402b5f0d3ee5c1a066a43152772c4f (patch)
tree74d8e8f6ab1a284cb2c92e80c5d1548d352e0960
parentd64c3d4f62faefc8dcbdeff42c384dbed992fff2 (diff)
Add version number to aucat protocol. It's not used yet,
but later, it will permit aucat to reject connections from clients statically linked to a unsupported version of libsndio. idea from kittenis, otto and sthen
-rw-r--r--lib/libsndio/aucat.c3
-rw-r--r--usr.bin/aucat/amsg.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index b8d274ef97b..cc1e977b1f1 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.28 2009/08/28 10:52:14 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.29 2009/10/17 10:55:43 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -236,6 +236,7 @@ sio_open_aucat(const char *str, unsigned mode, int nbio)
*/
AMSG_INIT(&hdl->wmsg);
hdl->wmsg.cmd = AMSG_HELLO;
+ hdl->wmsg.u.hello.version = AMSG_VERSION;
hdl->wmsg.u.hello.proto = 0;
if (mode & SIO_PLAY)
hdl->wmsg.u.hello.proto |= AMSG_PLAY;
diff --git a/usr.bin/aucat/amsg.h b/usr.bin/aucat/amsg.h
index 7536f99c7b9..9492f2bb8d1 100644
--- a/usr.bin/aucat/amsg.h
+++ b/usr.bin/aucat/amsg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amsg.h,v 1.10 2009/08/28 06:37:06 ratchov Exp $ */
+/* $OpenBSD: amsg.h,v 1.11 2009/10/17 10:55:43 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -89,7 +89,9 @@ struct amsg {
#define AMSG_MIDIOUT 0x8 /* MIDI thru output */
#define AMSG_MIXER 0x10 /* MIDI mixer */
uint16_t proto; /* protocol type */
- uint8_t reserved1[6]; /* for future use */
+#define AMSG_VERSION 0
+ uint8_t version; /* protocol version */
+ uint8_t reserved1[5]; /* for future use */
char opt[12]; /* profile name */
char who[12]; /* hint for leases */
} hello;