Print this page
XXXX adding PID information to netstat output
@@ -105,10 +105,21 @@
bcopy(blob, (char *)mpdata->b_wptr, len);
mpdata->b_wptr += len;
return (1);
}
+int
+snmp_append_mblk(mblk_t *mpdata, mblk_t *mblk)
+{
+ if (!mpdata || !mblk)
+ return (0);
+ while (mpdata->b_cont)
+ mpdata = mpdata->b_cont;
+ mpdata->b_cont = mblk;
+ return (1);
+}
+
/*
* Need a form which avoids O(n^2) behavior locating the end of the
* chain every time. This is it.
*/
int
@@ -131,10 +142,25 @@
bcopy(blob, (char *)(*last_mpp)->b_wptr, len);
(*last_mpp)->b_wptr += len;
return (1);
}
+int
+snmp_append_mblk2(mblk_t *mpdata, mblk_t **last_mpp, mblk_t *mblk)
+{
+ if (!mpdata || !mblk)
+ return (0);
+ if (*last_mpp == NULL) {
+ while (mpdata->b_cont)
+ mpdata = mpdata->b_cont;
+ *last_mpp = mpdata;
+ }
+ (*last_mpp)->b_cont = mblk;
+ *last_mpp = (*last_mpp)->b_cont;
+ return (1);
+}
+
/*
* SNMP requests are issued using putmsg() on a stream containing all
* relevant modules. The ctl part contains a O_T_OPTMGMT_REQ message,
* and the data part is NULL
* to process this msg. If snmpcom_req() returns FALSE, then the module