X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2Fsnmp.c;h=03bbf81a277a78bc6cef8a5c358b93b19e3654d5;hb=refs%2Ftags%2Fupstream%2F1.5.pre1;hp=f688c55d9242a473a203cc4b39985b630ecb35de;hpb=67fc54773e1504698e80c9cb83977bde32665350;p=ap-utils.git diff --git a/lib/snmp.c b/lib/snmp.c index f688c55..03bbf81 100644 --- a/lib/snmp.c +++ b/lib/snmp.c @@ -2,7 +2,8 @@ * snmp.c from Access Point SNMP Utils for Linux * basic snmp packets assembly/disassembly and send/receive functions * - * Copyright (c) 2002 Roman Festchook + * Copyright (c) Roman Festchook + * Jan Rafaj * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 from @@ -46,6 +47,20 @@ static void alarm_handler() siglongjmp(position, 1); } +/* +unsigned int ber_decode_uint(unsigned char *bevp, int len) +{ + unsigned int out = 0; + + while (len--) { + out = (out << 7) | (*bevp & (*bevp & 0x80 ? 0x7f : 0xff)); + bevp++; + } + + return out; +} +*/ + int ber(char *message, varbind * varbindlist, int num, int type) {