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);
struct msghdr with a known type, fixed-size I/O and control buffers
void getFixed(void *raw, size_t size) const
always load size bytes
void putInt(int n)
store an integer
void getPod(Pod &pod) const
load POD
void putFixed(const void *raw, size_t size)
always store size bytes
void putPod(const Pod &pod)
store POD
int getInt() const
load an integer
void assign(const Pdu &pdu)
perform full assignment
void unpack(const Ipc::TypedMsgHdr &msg)
restore struct from the message
void clear()
clear all internal members
void aggregate(const Pdu &pdu)
Pdu & operator=(const Pdu &pdu)
void clearVars()
clear variables list
void setSystemOid(const Range< const oid * > &systemOid)
void setVars(variable_list *vars)
perform assignment of variables list
void pack(Ipc::TypedMsgHdr &msg) const
prepare for sendmsg()
int varCount() const
size of variables list
void init()
initialize members
unsigned int aggrCount
The number of other Pdus merged into.
Range< const oid * > getSystemOid() const
void copyValue(const Var &var)
copy variable from another one
void unpack(const Ipc::TypedMsgHdr &msg)
restore struct from the message
Range< const oid * > getName() const
returns variable name
void pack(Ipc::TypedMsgHdr &msg) const
prepare for sendmsg()
void setName(const Range< const oid * > &aName)
set new variable name
AggrType snmpAggrType(oid *Current, snint CurrentLen)
#define SNMP_DEFAULT_ERRSTAT
#define SNMP_DEFAULT_ERRINDEX
void snmp_var_free(struct variable_list *)
struct sockaddr_in address
struct variable_list * variables
struct sockaddr_in agent_addr
struct variable_list * next_variable