* Finds object name in @ctlv by @idx and @type. * Uses the following facts: * 1) All TLVs are the same size * 2) Kernel implementation provides already sorted list. * * Returns table name or NULL. */
| 5264 | * Returns table name or NULL. |
| 5265 | */ |
| 5266 | static char * |
| 5267 | object_search_ctlv(ipfw_obj_ctlv *ctlv, uint16_t idx, uint16_t type) |
| 5268 | { |
| 5269 | ipfw_obj_ntlv *ntlv; |
| 5270 | struct object_kt key; |
| 5271 | |
| 5272 | key.uidx = idx; |
| 5273 | key.type = type; |
| 5274 | |
| 5275 | ntlv = bsearch(&key, (ctlv + 1), ctlv->count, ctlv->objsize, |
| 5276 | compare_object_kntlv); |
| 5277 | |
| 5278 | if (ntlv != NULL) |
| 5279 | return (ntlv->name); |
| 5280 | |
| 5281 | return (NULL); |
| 5282 | } |
| 5283 | |
| 5284 | static char * |
| 5285 | table_search_ctlv(ipfw_obj_ctlv *ctlv, uint16_t idx) |
no test coverage detected