syntax="proto2";
package brpc;
option java_package="com.brpc";
option java_outer_classname="BaiduRpcErrno";

enum Errno {
    // option allow_alias = false; this option is available since 2.5.0
    // Linux system errno are prefixed with SYS_.
    // Since sometimes linux errno such as ENOMEM and ETIMEDOUT is set or
    // checked by some other libaries which are out of control by RPC framework,
    // it's important to make sure that the explanation of an errno is exactly
    // the same in both client-side and server-side. If linux errno is unware
    // (e.g. in JAVA program), it's required to use SYS_*.
    SYS_EPERM               = 1;  // Operation not permitted
    SYS_ENOENT              = 2;  // No such file or directory
    SYS_ESRCH               = 3;  // No such process
    SYS_EINTR               = 4;  // Interrupted system call
    SYS_EIO                 = 5;  // I/O error
    SYS_ENXIO               = 6;  // No such device or address
    SYS_E2BIG               = 7;  // Arg list too long
    SYS_ENOEXEC             = 8;  // Exec format error
    SYS_EBADF               = 9;  // Bad file number
    SYS_ECHILD              = 10;  // No child processes
    SYS_EAGAIN              = 11;  // Try again
    SYS_ENOMEM              = 12;  // Out of memory
    SYS_EACCES              = 13;  // Permission denied
    SYS_EFAULT              = 14;  // Bad address
    SYS_ENOTBLK             = 15;  // Block device required
    SYS_EBUSY               = 16;  // Device or resource busy
    SYS_EEXIST              = 17;  // File exists
    SYS_EXDEV               = 18;  // Cross-device link
    SYS_ENODEV              = 19;  // No such device
    SYS_ENOTDIR             = 20;  // Not a directory
    SYS_EISDIR              = 21;  // Is a directory
    SYS_EINVAL              = 22;  // Invalid argument
    SYS_ENFILE              = 23;  // File table overflow
    SYS_EMFILE              = 24;  // Too many open files
    SYS_ENOTTY              = 25;  // Not a typewriter
    SYS_ETXTBSY             = 26;  // Text file busy
    SYS_EFBIG               = 27;  // File too large
    SYS_ENOSPC              = 28;  // No space left on device
    SYS_ESPIPE              = 29;  // Illegal seek
    SYS_EROFS               = 30;  // Read-only file system
    SYS_EMLINK              = 31;  // Too many links
    SYS_EPIPE               = 32;  // Broken pipe
    SYS_EDOM                = 33;  // Math argument out of domain of func
    SYS_ERANGE              = 34;  // Math result not representable
    SYS_EDEADLK             = 35;  // Resource deadlock would occur
    SYS_ENAMETOOLONG        = 36;  // File name too long
    SYS_ENOLCK              = 37;  // No record locks available
    SYS_ENOSYS              = 38;  // Function not implemented
    SYS_ENOTEMPTY           = 39;  // Directory not empty
    SYS_ELOOP               = 40;  // Too many symbolic links encountered
    SYS_ENOMSG              = 42;  // No message of desired type
    SYS_EIDRM               = 43;  // Identifier removed
    SYS_ECHRNG              = 44;  // Channel number out of range
    SYS_EL2NSYNC            = 45;  // Level= 2;not synchronized
    SYS_EL3HLT              = 46;  // Level= 3;halted
    SYS_EL3RST              = 47;  // Level= 3;reset
    SYS_ELNRNG              = 48;  // Link number out of range
    SYS_EUNATCH             = 49;  // Protocol driver not attached
    SYS_ENOCSI              = 50;  // No CSI structure available
    SYS_EL2HLT              = 51;  // Level= 2;halted
    SYS_EBADE               = 52;  // Invalid exchange
    SYS_EBADR               = 53;  // Invalid request descriptor
    SYS_EXFULL              = 54;  // Exchange full
    SYS_ENOANO              = 55;  // No anode
    SYS_EBADRQC             = 56;  // Invalid request code
    SYS_EBADSLT             = 57;  // Invalid slot
    SYS_EBFONT              = 59;  // Bad font file format
    SYS_ENOSTR              = 60;  // Device not a stream
    SYS_ENODATA             = 61;  // No data available
    SYS_ETIME               = 62;  // Timer expired
    SYS_ENOSR               = 63;  // Out of streams resources
    SYS_ENONET              = 64;  // Machine is not on the network
    SYS_ENOPKG              = 65;  // Package not installed
    SYS_EREMOTE             = 66;  // Object is remote
    SYS_ENOLINK             = 67;  // Link has been severed
    SYS_EADV                = 68;  // Advertise error
    SYS_ESRMNT              = 69;  // Srmount error
    SYS_ECOMM               = 70;  // Communication error on send
    SYS_EPROTO              = 71;  // Protocol error
    SYS_EMULTIHOP           = 72;  // Multihop attempted
    SYS_EDOTDOT             = 73;  // RFS specific error
    SYS_EBADMSG             = 74;  // Not a data message
    SYS_EOVERFLOW           = 75;  // Value too large for defined data type
    SYS_ENOTUNIQ            = 76;  // Name not unique on network
    SYS_EBADFD              = 77;  // File descriptor in bad state
    SYS_EREMCHG             = 78;  // Remote address changed
    SYS_ELIBACC             = 79;  // Can not access a needed shared library
    SYS_ELIBBAD             = 80;  // Accessing a corrupted shared library
    SYS_ELIBSCN             = 81;  // .lib section in a.out corrupted
    SYS_ELIBMAX             = 82;  // Attempting to link in too many shared libraries
    SYS_ELIBEXEC            = 83;  // Cannot exec a shared library directly
    SYS_EILSEQ              = 84;  // Illegal byte sequence
    SYS_ERESTART            = 85;  // Interrupted system call should be restarted
    SYS_ESTRPIPE            = 86;  // Streams pipe error
    SYS_EUSERS              = 87;  // Too many users
    SYS_ENOTSOCK            = 88;  // Socket operation on non-socket
    SYS_EDESTADDRREQ        = 89;  // Destination address required
    SYS_EMSGSIZE            = 90;  // Message too long
    SYS_EPROTOTYPE          = 91;  // Protocol wrong type for socket
    SYS_ENOPROTOOPT         = 92;  // Protocol not available
    SYS_EPROTONOSUPPORT     = 93;  // Protocol not supported
    SYS_ESOCKTNOSUPPORT     = 94;  // Socket type not supported
    SYS_EOPNOTSUPP          = 95;  // Operation not supported on transport endpoint
    SYS_EPFNOSUPPORT        = 96;  // Protocol family not supported
    SYS_EAFNOSUPPORT        = 97;  // Address family not supported by protocol
    SYS_EADDRINUSE          = 98;  // Address already in use
    SYS_EADDRNOTAVAIL       = 99;  // Cannot assign requested address
    SYS_ENETDOWN            = 100;  // Network is down
    SYS_ENETUNREACH         = 101;  // Network is unreachable
    SYS_ENETRESET           = 102;  // Network dropped connection because of reset
    SYS_ECONNABORTED        = 103;  // Software caused connection abort
    SYS_ECONNRESET          = 104;  // Connection reset by peer
    SYS_ENOBUFS             = 105;  // No buffer space available
    SYS_EISCONN             = 106;  // Transport endpoint is already connected
    SYS_ENOTCONN            = 107;  // Transport endpoint is not connected
    SYS_ESHUTDOWN           = 108;  // Cannot send after transport endpoint shutdown
    SYS_ETOOMANYREFS        = 109;  // Too many references: cannot splice
    SYS_ETIMEDOUT           = 110;  // Connection timed out. NOTE: RPC timeout is ERPCTIMEDOUT.
    SYS_ECONNREFUSED        = 111;  // Connection refused
    SYS_EHOSTDOWN           = 112;  // Host is down
    SYS_EHOSTUNREACH        = 113;  // No route to host
    SYS_EALREADY            = 114;  // Operation already in progress
    SYS_EINPROGRESS         = 115;  // Operation now in progress
    SYS_ESTALE              = 116;  // Stale NFS file handle
    SYS_EUCLEAN             = 117;  // Structure needs cleaning
    SYS_ENOTNAM             = 118;  // Not a XENIX named type file
    SYS_ENAVAIL             = 119;  // No XENIX semaphores available
    SYS_EISNAM              = 120;  // Is a named type file
    SYS_EREMOTEIO           = 121;  // Remote I/O error
    SYS_EDQUOT              = 122;  // Quota exceeded
    SYS_ENOMEDIUM           = 123;  // No medium found
    SYS_EMEDIUMTYPE         = 124;  // Wrong medium type
    SYS_ECANCELED           = 125;  // Operation Cancelled
    SYS_ENOKEY              = 126;  // Required key not available
    SYS_EKEYEXPIRED         = 127;  // Key has expired
    SYS_EKEYREVOKED         = 128;  // Key has been revoked
    SYS_EKEYREJECTED        = 129;  // Key was rejected by service

    // Errno caused by client
    ENOSERVICE              = 1001;  // Service not found
    ENOMETHOD               = 1002;  // Method not found
    EREQUEST                = 1003;  // Bad Request
    EAUTH                   = 1004;  // Unauthorized
    ETOOMANYFAILS           = 1005;  // Too many sub calls failed
    EPCHANFINISH            = 1006;  // [Internal] ParallelChannel finished
    EBACKUPREQUEST          = 1007;  // Sending backup request
    ERPCTIMEDOUT            = 1008;  // RPC call is timed out
    EFAILEDSOCKET           = 1009;  // Broken socket
    EHTTP                   = 1010;  // Bad http call
    EOVERCROWDED            = 1011;  // The server is overcrowded
    ERTMPPUBLISHABLE        = 1012;  // RtmpRetryingClientStream is publishable
    ERTMPCREATESTREAM       = 1013;  // createStream was rejected by the RTMP server
    EEOF                    = 1014;  // Got EOF
    EUNUSED                 = 1015;  // The socket was not needed

    // Errno caused by server
    EINTERNAL               = 2001;  // Internal Server Error
    ERESPONSE               = 2002;  // Bad Response
    ELOGOFF                 = 2003;  // Server is stopping
    ELIMIT                  = 2004;  // Reached server's limit on resources
    ECLOSE                  = 2005;  // Close socket initiatively
    EITP                    = 2006;  // Failed Itp response
}
