~ubuntu-branches/ubuntu/intrepid/net-snmp/intrepid-updates

« back to all changes in this revision

Viewing changes to agent/mibgroup/agentx/subagent.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2006-11-28 12:29:34 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20061128122934-82xxzy2zcvypnvy7
Tags: 5.2.3-4ubuntu1
* Merge from debian unstable, remaining changes:
  - remove stop links from rc0 and rc6

Show diffs side-by-side

added added

removed removed

Lines of Context:
323
323
        break;
324
324
 
325
325
    case AGENTX_MSG_RESPONSE:
 
326
        SNMP_FREE(smagic);
326
327
        DEBUGMSGTL(("agentx/subagent", "  -> response\n"));
327
328
        return 1;
328
329
 
333
334
        DEBUGMSGTL(("agentx/subagent", "  -> testset\n"));
334
335
        asi = save_set_vars(session, pdu);
335
336
        if (asi == NULL) {
 
337
            SNMP_FREE(smagic);
336
338
            snmp_log(LOG_WARNING, "save_set_vars() failed\n");
337
339
            return 1;
338
340
        }
345
347
        DEBUGMSGTL(("agentx/subagent", "  -> commitset\n"));
346
348
        asi = restore_set_vars(session, pdu);
347
349
        if (asi == NULL) {
 
350
            SNMP_FREE(smagic);
348
351
            snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
349
352
            return 1;
350
353
        }
351
354
        if (asi->mode != SNMP_MSG_INTERNAL_SET_RESERVE2) {
 
355
            SNMP_FREE(smagic);
352
356
            snmp_log(LOG_WARNING,
353
357
                     "dropping bad AgentX request (wrong mode %d)\n",
354
358
                     asi->mode);
363
367
        DEBUGMSGTL(("agentx/subagent", "  -> cleanupset\n"));
364
368
        asi = restore_set_vars(session, pdu);
365
369
        if (asi == NULL) {
 
370
            SNMP_FREE(smagic);
366
371
            snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
367
372
            return 1;
368
373
        }
375
380
            snmp_log(LOG_WARNING,
376
381
                     "dropping bad AgentX request (wrong mode %d)\n",
377
382
                     asi->mode);
 
383
            SNMP_FREE(retmagic);
378
384
            return 1;
379
385
        }
380
386
        mycallback = handle_subagent_set_response;
385
391
        DEBUGMSGTL(("agentx/subagent", "  -> undoset\n"));
386
392
        asi = restore_set_vars(session, pdu);
387
393
        if (asi == NULL) {
 
394
            SNMP_FREE(smagic);
388
395
            snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
389
396
            return 1;
390
397
        }
394
401
        break;
395
402
 
396
403
    default:
 
404
        SNMP_FREE(smagic);
397
405
        DEBUGMSGTL(("agentx/subagent", "  -> unknown command %d (%02x)\n",
398
406
                    pdu->command, pdu->command));
399
407
        return 0;