Commit 1e24379
committed
core: support receiving multipart objects
In order to support an upcoming patch implementing support for
requesting bridge vlan information for a single interface, a
modification to the pickup code is needed to allow handling of multipart
messages.
Based on the implementation of the bridge vlan dumping code in the
kernel, information relating to a single interface may not all be
contained within a single message. If the maximum message size is
exceeded before all entries can be filled in, a new message will be
started with the same ifindex but containing the remaining entries.
The code is currently only designed for handling netlink responses where
the provided parser function will be called a maximum of one time. This
is based on the assumption that all data relating to an object will be
contained within a single response message. If multiple messages are
received and the parser function is invoked multiple times, previously
stored objects will be leaked and the resulting object will only contain
information from the last parsed message.
In order to handle the case where multiple messages need to be parsed to
construct a single object, use the already existing oo_update function
that may be defined for an object. The function will be called to merge
partial objects (that are the result of each invocation of the parser
function) together into a single object that is returned at the end.1 parent 384db3d commit 1e24379
3 files changed
+34
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1146 | 1155 | | |
1147 | 1156 | | |
1148 | 1157 | | |
| |||
1168 | 1177 | | |
1169 | 1178 | | |
1170 | 1179 | | |
1171 | | - | |
| 1180 | + | |
1172 | 1181 | | |
1173 | 1182 | | |
1174 | 1183 | | |
1175 | 1184 | | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1176 | 1189 | | |
1177 | 1190 | | |
1178 | 1191 | | |
| |||
1184 | 1197 | | |
1185 | 1198 | | |
1186 | 1199 | | |
1187 | | - | |
| 1200 | + | |
| 1201 | + | |
1188 | 1202 | | |
1189 | 1203 | | |
1190 | 1204 | | |
1191 | | - | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
1192 | 1211 | | |
1193 | 1212 | | |
1194 | 1213 | | |
| |||
1216 | 1235 | | |
1217 | 1236 | | |
1218 | 1237 | | |
1219 | | - | |
| 1238 | + | |
| 1239 | + | |
1220 | 1240 | | |
| 1241 | + | |
1221 | 1242 | | |
1222 | 1243 | | |
1223 | 1244 | | |
| |||
0 commit comments