changeset 863:681892f1d3f7

common: use an enum instead of #defines for NRPC opcodes Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Wed, 14 Dec 2022 23:14:55 -0500
parents 9a63d933a60e
children eb2ea1fc3c03
files src/common/include/nomad/rpc_fs.h
diffstat 1 files changed, 21 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/common/include/nomad/rpc_fs.h	Sat Dec 17 17:02:07 2022 -0500
+++ b/src/common/include/nomad/rpc_fs.h	Wed Dec 14 23:14:55 2022 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2015-2020,2022 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  * Copyright (c) 2016 Steve Dougherty
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -29,24 +29,26 @@
 
 #define NRPC_VERSION 0x00000001
 
-#define NRPC_NOP		0x0000
-#define NRPC_LOGIN		0x0001
-#define NRPC_GETATTR		0x0002
-#define NRPC_LOOKUP		0x0003
-#define NRPC_CREATE		0x0004
-#define NRPC_LINK		0x0005
-#define NRPC_UNLINK		0x0006
-#define NRPC_OPEN		0x0008
-#define NRPC_CLOSE		0x0009
-#define NRPC_READ		0x000A
-#define NRPC_WRITE		0x000B
-#define NRPC_SETATTR		0x000C
-#define NRPC_GETDENT		0x000D
-#define NRPC_OBJ_INFO		0x000E
-#define NRPC_VDEV_IMPORT	0x0100
-#define NRPC_VDEV_LIST		0x0101
-#define NRPC_VOL_CREATE		0x0200
-#define NRPC_VOL_LIST		0x0201
+enum nrpc_opcode {
+	NRPC_NOP =		0x0000,
+	NRPC_LOGIN =		0x0001,
+	NRPC_GETATTR =		0x0002,
+	NRPC_LOOKUP =		0x0003,
+	NRPC_CREATE =		0x0004,
+	NRPC_LINK =		0x0005,
+	NRPC_UNLINK =		0x0006,
+	NRPC_OPEN =		0x0008,
+	NRPC_CLOSE =		0x0009,
+	NRPC_READ =		0x000A,
+	NRPC_WRITE =		0x000B,
+	NRPC_SETATTR =		0x000C,
+	NRPC_GETDENT =		0x000D,
+	NRPC_OBJ_INFO =		0x000E,
+	NRPC_VDEV_IMPORT =	0x0100,
+	NRPC_VDEV_LIST =	0x0101,
+	NRPC_VOL_CREATE =	0x0200,
+	NRPC_VOL_LIST =		0x0201,
+};
 
 enum vdev_state {
 	VDEV_IMPORTING,	/* vdev import op in progress */