summaryrefslogtreecommitdiffstats
path: root/main/afpfs-ng/06-afpfs-ng-0.8.1-boxee4.patch
blob: 3e09f40dc58816ec1b944d63bcb416326bc12566 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- afpfs-ng-0.8.1/lib/identify.c	1970-01-01 01:00:00.000000000 +0100
+++ afpfs-ng-0.8.1/lib/identify.c	2011-08-26 21:33:33.000000000 +0200
@@ -0,0 +1,24 @@
+#include <string.h>
+#include <afpfs-ng/afp.h>
+
+
+/* 
+ * afp_server_identify()
+ *
+ * Identifies a server
+ *
+ * Right now, this only does identification using the machine_type
+ * given in getsrvrinfo, but this could later use mDNS to get 
+ * more details.
+ */
+void afp_server_identify(struct afp_server * s)
+{
+	if (strcmp(s->machine_type,"Netatalk")==0)
+		s->server_type=AFPFS_SERVER_TYPE_NETATALK;
+	else if (strcmp(s->machine_type,"AirPort")==0)
+		s->server_type=AFPFS_SERVER_TYPE_AIRPORT;
+	else if (strcmp(s->machine_type,"Macintosh")==0)
+		s->server_type=AFPFS_SERVER_TYPE_MACINTOSH;
+	else
+		s->server_type=AFPFS_SERVER_TYPE_UNKNOWN;
+}