Go to the documentation of this file.
61 Must(p_aggr !=
nullptr);
62 Var& aggr =
static_cast<Var&
>(*p_aggr);
63 Var& var =
static_cast<Var&
>(*p_var);
102 address.sin_addr.s_addr = pdu.
address.sin_addr.s_addr;
108 agent_addr.sin_addr.s_addr = pdu.
agent_addr.sin_addr.s_addr;
121 while (var !=
nullptr) {
135 *p_var =
new Var(
static_cast<Var&
>(*vars));
142 if (enterprise !=
nullptr) {
144 enterprise =
nullptr;
146 enterprise_length = 0;
160 enterprise_length = systemOid.
size();
161 enterprise =
static_cast<oid*
>(
xmalloc(enterprise_length *
sizeof(
oid)));
162 std::copy(systemOid.
start, systemOid.
end, enterprise);
174 msg.
putPod(non_repeaters);
175 msg.
putPod(max_repetitions);
176 msg.
putInt(enterprise_length);
177 if (enterprise_length > 0) {
178 Must(enterprise !=
nullptr);
179 msg.
putFixed(enterprise, enterprise_length *
sizeof(
oid));
183 msg.
putPod(specific_type);
187 static_cast<Var*
>(var)->
pack(msg);
199 msg.
getPod(non_repeaters);
200 msg.
getPod(max_repetitions);
201 enterprise_length = msg.
getInt();
202 if (enterprise_length > 0) {
203 enterprise =
static_cast<oid*
>(
xmalloc(enterprise_length *
sizeof(
oid)));
204 msg.
getFixed(enterprise, enterprise_length *
sizeof(
oid));
208 msg.
getPod(specific_type);
234 Var& aggr =
static_cast<Var&
>(*p_aggr);
#define SNMP_DEFAULT_ERRSTAT
void putFixed(const void *raw, size_t size)
always store size bytes
void pack(Ipc::TypedMsgHdr &msg) const
prepare for sendmsg()
int varCount() const
size of variables list
void unpack(const Ipc::TypedMsgHdr &msg)
restore struct from the message
void unpack(const Ipc::TypedMsgHdr &msg)
restore struct from the message
void putPod(const Pod &pod)
store POD
void setSystemOid(const Range< const oid * > &systemOid)
void putInt(int n)
store an integer
struct variable_list * variables
struct sockaddr_in address
void clear()
clear all internal members
void clearVars()
clear variables list
int getInt() const
load an integer
unsigned int aggrCount
The number of other Pdus merged into.
void setVars(variable_list *vars)
perform assignment of variables list
void init()
initialize members
Range< const oid * > getSystemOid() const
void setName(const Range< const oid * > &aName)
set new variable name
void snmp_var_free(struct variable_list *)
void aggregate(const Pdu &pdu)
Pdu & operator=(const Pdu &pdu)
#define SNMP_DEFAULT_ERRINDEX
void pack(Ipc::TypedMsgHdr &msg) const
prepare for sendmsg()
AggrType snmpAggrType(oid *Current, snint CurrentLen)
Range< const oid * > getName() const
returns variable name
struct msghdr with a known type, fixed-size I/O and control buffers
void getPod(Pod &pod) const
load POD
struct variable_list * next_variable
void assign(const Pdu &pdu)
perform full assignment
struct sockaddr_in agent_addr
void copyValue(const Var &var)
copy variable from another one
void getFixed(void *raw, size_t size) const
always load size bytes