~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to src/rpc/rpc.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
(* $Id: rpc.ml 459 2006-04-30 19:49:19Z gerd $
 
1
(* $Id: rpc.ml 1547 2011-02-15 01:04:25Z gerd $
2
2
 * ----------------------------------------------------------------------
3
3
 *
4
4
 *)
46
46
  | Auth_too_weak                            (* rejected call  *)
47
47
  | Auth_invalid_resp                        (* rejected call  *)
48
48
  | Auth_failed                              (* rejected call  *)
 
49
  | RPCSEC_GSS_credproblem                   (** rejected call  *)
 
50
  | RPCSEC_GSS_ctxproblem                    (** rejected call  *)
49
51
;;
50
52
 
51
53
 
 
54
let string_of_server_error =
 
55
  function
 
56
    | Unavailable_program -> 
 
57
        "Unavailable_program"
 
58
    | Unavailable_version(v1,v2) ->
 
59
        "Unavailable_version(" ^ 
 
60
          Int64.to_string(Rtypes.int64_of_uint4 v1) ^ ", " ^ 
 
61
          Int64.to_string(Rtypes.int64_of_uint4 v2) ^ ")"
 
62
    | Unavailable_procedure ->
 
63
        "Unavailable_procedure"
 
64
    | Garbage ->
 
65
        "Garbage"
 
66
    | System_err ->
 
67
        "System_err"
 
68
    | Rpc_mismatch(v1,v2) ->
 
69
        "Rpc_mismatch(" ^ 
 
70
          Int64.to_string(Rtypes.int64_of_uint4 v1) ^ ", " ^ 
 
71
          Int64.to_string(Rtypes.int64_of_uint4 v2) ^ ")"
 
72
    | Auth_bad_cred ->
 
73
        "Auth_bad_cred"
 
74
    | Auth_rejected_cred ->
 
75
        "Auth_rejected_cred"
 
76
    | Auth_bad_verf ->
 
77
        "Auth_bad_verf"
 
78
    | Auth_rejected_verf ->
 
79
        "Auth_rejected_verf"
 
80
    | Auth_too_weak ->
 
81
        "Auth_too_weak"
 
82
    | Auth_invalid_resp ->
 
83
        "Auth_invalid_resp"
 
84
    | Auth_failed ->
 
85
        "Auth_failed"
 
86
    | RPCSEC_GSS_credproblem ->
 
87
        "RPCSEC_GSS_credproblem"
 
88
    | RPCSEC_GSS_ctxproblem ->
 
89
        "RPCSEC_GSS_ctxproblem"
 
90
 
 
91
 
52
92
exception Rpc_server of server_error;;
53
93
 
54
94
exception Rpc_cannot_unpack of string;;
55
95
 
 
96
 
 
97
let () =
 
98
  Netexn.register_printer
 
99
    (Rpc_server Unavailable_program)
 
100
    (fun e ->
 
101
       match e with
 
102
         | Rpc_server code ->
 
103
             "Rpc.Rpc_server(" ^ string_of_server_error code ^ ")"
 
104
         | _ ->
 
105
             assert false
 
106
    )