~ubuntu-branches/ubuntu/oneiric/likewise-open/oneiric

« back to all changes in this revision

Viewing changes to dcerpc/demos/echo_server/echo_client.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Salley
  • Date: 2010-11-22 12:06:00 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122120600-8lba1fpceot71wlb
Tags: 6.0.0.53010-1
Likewise Open 6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
static void usage()
55
55
{
56
 
    printf("usage: echo_client [-h hostname] [-e endpoint] [-n] [-u] [-t]\n");
 
56
    printf("usage: echo_client [-h hostname] [-a name [-p level]] [-e endpoint] [-n] [-u] [-t]\n");
57
57
    printf("         -h:  specify host of RPC server (default is localhost)\n");
 
58
    printf("         -a:  specify authentication identity\n");
 
59
    printf("         -p:  specify protection level\n");
58
60
    printf("         -e:  specify endpoint for protocol\n");
59
61
    printf("         -n:  use named pipe protocol\n");
60
62
    printf("         -u:  use UDP protocol\n");
83
85
    char * rpc_host = "localhost";
84
86
    char * protocol = PROTOCOL_TCP;
85
87
    char * endpoint = NULL;
 
88
    char * spn = NULL;
 
89
    unsigned32 protect_level = rpc_c_protect_level_pkt_integ;
86
90
 
87
91
    char buf[MAX_LINE+1];
88
92
 
104
108
     * Process the cmd line args
105
109
     */
106
110
 
107
 
    while ((c = getopt(argc, argv, "h:e:nutdg:")) != EOF)
 
111
    while ((c = getopt(argc, argv, "h:a:p:e:nutdg:")) != EOF)
108
112
    {
109
113
        switch (c)
110
114
        {
111
115
        case 'h':
112
116
            rpc_host = optarg;
113
117
            break;
 
118
        case 'a':
 
119
            spn = optarg;
 
120
            break;
 
121
        case 'p':
 
122
            protect_level = atoi(optarg);
 
123
            break;
114
124
        case 'e':
115
125
            endpoint = optarg;
116
126
            break;
158
168
        exit(1);
159
169
    }
160
170
 
 
171
    if (spn)
 
172
    {
 
173
        rpc_binding_set_auth_info(echo_server,
 
174
            spn,
 
175
            protect_level,
 
176
            rpc_c_authn_gss_negotiate,
 
177
            NULL,
 
178
            rpc_c_authz_name, &status);
 
179
        if (status)
 
180
        {
 
181
            printf ("Couldn't set auth info %u. exiting.\n", status);
 
182
            exit(1);
 
183
        }
 
184
    }
161
185
 
162
186
    /*
163
187
     * Allocate an "args" struct with enough room to accomodate