~ubuntu-branches/ubuntu/jaunty/xorp/jaunty

« back to all changes in this revision

Viewing changes to mibs/bgp4_mib_1657_bgplocalas.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jose Calhariz, Javier Fernandez-Sanguino, Jose Calhariz
  • Date: 2008-01-23 01:24:37 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123012437-7l2u9r0k8e7op8st
Tags: 1.5~cvs.20080128-1
[ Javier Fernandez-Sanguino ]
* Update to latest CVS contents
* Modify debian/rules to prevent autobuilders from building 
  the binary-independent components: (Closes: #441121)
  - Create a new Build-Depends-Indep with all the TeX
  components used to build documentation
  - Since autobuilders call build, which in turns calls build-indep, hack
    the debian rules file so that the documentation is only built if ps2pdf,
    dvips and pslatex are available. 
* Modify the init.d script:
  - restart action: Do not attempt to stop xorp if not running
  - stop function: fix errors in the script
  - add a try-restart action
  - restructure the init.d script, move the restart code to a function
  - review the use of echo calls and exit values
* Use, as examples, the new boot files at rtrmgr/config/

[ Jose Calhariz ]
* Add depends on ncurses-dev, I don't know why xorp use tigetstr
  function from curses.  This way the depends field change less between
  build environments.
* Removed pushd and popd commands from Makefile and replaced with cd
  commands, was a bashism and FTBFS (closes: #453637)
* debian/control converted to utf-8 (closes: #454026) (closes: #453485)
* init.d/xorp now returns 0 if disabled.
* Added Vcs-Browser and Vcs-Svn fields pointing to the repository of the
  package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
2
2
 
3
 
// Copyright (c) 2001-2007 International Computer Science Institute
 
3
// Copyright (c) 2001-2008 International Computer Science Institute
4
4
//
5
5
// Permission is hereby granted, free of charge, to any person obtaining a
6
6
// copy of this software and associated documentation files (the "Software")
12
12
// notice is a summary of the XORP LICENSE file; the license in that file is
13
13
// legally binding.
14
14
 
15
 
#ident "$XORP: xorp/mibs/bgp4_mib_1657_bgplocalas.cc,v 1.7 2007/02/16 22:46:33 pavlin Exp $"
 
15
#ident "$XORP: xorp/mibs/bgp4_mib_1657_bgplocalas.cc,v 1.10 2008/01/04 03:16:49 pavlin Exp $"
16
16
 
17
17
 
18
18
#include <net-snmp/net-snmp-config.h>
22
22
 
23
23
#include "bgp4_mib_module.h"
24
24
#include "libxorp/xorp.h"
 
25
#include "libxorp/asnum.hh"
25
26
 
26
27
#include "xorpevents.hh"
27
28
#include "bgp4_mib_1657.hh"
43
44
                                         HANDLER_CAN_RONLY));
44
45
}
45
46
 
46
 
void get_local_as_done(const XrlError& e, const uint32_t* as, 
 
47
void get_local_as_done(const XrlError& e, const string* as, 
47
48
                               netsnmp_delegated_cache* cache)
48
49
{
49
50
 
78
79
    // no longer delegated since we'll answer down below
79
80
 
80
81
    requests->delegated = 0;
81
 
    uint32_t local_as = *as;
 
82
    AsNum asnum(*as);
 
83
    uint32_t local_as = asnum.as4();
82
84
 
83
85
    snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
84
86
        reinterpret_cast<unsigned char *>(&local_as), sizeof(uint32_t));
95
97
{
96
98
    DEBUGMSGTL((BgpMib::the_instance().name(), "get_bgpLocalAs called\n"));
97
99
    BgpMib& bgp_mib = BgpMib::the_instance();
98
 
    BgpMib::GetBgpVersionCB cb_localas;
 
100
    BgpMib::GetLocalAsCB cb_localas;
99
101
    netsnmp_delegated_cache* req_cache = netsnmp_create_delegated_cache
100
102
        (handler, reginfo, reqinfo, requests, NULL);
101
103
    cb_localas = callback(get_local_as_done, req_cache);