]> git.sur5r.net Git - ngadmin/commitdiff
Add invalid operation error code
authordarkcoven <admin@darkcoven.tk>
Mon, 7 Apr 2014 22:26:18 +0000 (00:26 +0200)
committerdarkcoven <admin@darkcoven.tk>
Mon, 7 Apr 2014 22:26:18 +0000 (00:26 +0200)
cli/src/common.c
lib/include/ngadmin.h
lib/src/network.c
raw/include/nsdp/protocol.h
wireshark/nsdp.lua

index 74df3356f89ed0eddc280d42956b25a9e41552cf..f7a0acb472eca8998b23248dd10c3c27e1ae321f 100644 (file)
@@ -44,6 +44,10 @@ void printErrCode (int err)
                printf("bad reply from switch\n");
                break;
        
+       case ERR_INVOP:
+               printf("invalid operation\n");
+               break;
+       
        case ERR_UNKNOWN:
                printf("unknown error\n");
                break;
index a98f42959eebd9363e6cd15ab7785339ae9effed..49dc761cd2edbac0798cbf69c174651620e78441 100644 (file)
@@ -50,7 +50,8 @@ enum {
        ERR_MEM = -8,                   /**< out of memory */
        ERR_NOTIMPL = -9,               /**< not implemented */
        ERR_BADREPLY = -10,             /**< bad reply */
-       ERR_UNKNOWN = -11               /**< unknown error */
+       ERR_INVOP = -11,                /**< invalid operation */
+       ERR_UNKNOWN = -12               /**< unknown error */
 };
 
 
index 609d4b560bc8dd4390c4f8ad5489c1b50f54c554..e62b5b89c23fe085433c409cb99351f813f74311 100644 (file)
@@ -149,6 +149,10 @@ static int checkErrorCode (const struct nsdp_cmd *nc)
        case 0:
                return ERR_OK;
        
+       case ERROR_READONLY:
+       case ERROR_WRITEONLY:
+               return ERR_INVOP;
+
        case ERROR_DENIED:
                return (nc->attr_error == ATTR_PASSWORD) ? ERR_BADPASS : ERR_DENIED;
        
index e346de5a3355b530df712d5fd3dcd713d79ae29e..5ab83c027f7192ff14beb380c56dac690d1f9e62 100644 (file)
@@ -18,6 +18,7 @@
 #define CODE_WRITE_REP         4
 
 #define ERROR_READONLY         3
+#define ERROR_WRITEONLY                4
 #define ERROR_INVALID_VALUE    5
 #define ERROR_DENIED           7
 
index 53aea70c3df3e225d40af26989dbdf89209224fa..2518559f103fac802e3f40a41f5dbcfcb6ab1a5c 100644 (file)
@@ -31,6 +31,8 @@ local op_codes = {
 
 local error_codes = {
        [0] = "OK",
+       [3] = "Read Only",
+       [4] = "Write Only",
        [5] = "Invalid Value",
        [7] = "Access Denied"
 }