Changeset 8d9217d in mainline for uspace/lib


Ignore:
Timestamp:
2024-03-20T17:06:29Z (19 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
384f081
Parents:
78edb5e
Message:

nic, drvs, pcapctl

Location:
uspace/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nic/include/nic.h

    r78edb5e r8d9217d  
    282282extern pcap_iface_t *nic_get_pcap_iface(nic_t *);
    283283
     284extern errno_t nic_fun_add_to_cats(ddf_fun_t *fun);
     285
    284286#endif // __NIC_H__
    285287
  • uspace/lib/nic/src/nic_impl.c

    r78edb5e r8d9217d  
    844844}
    845845
     846errno_t nic_fun_add_to_cats(ddf_fun_t *fun)
     847{
     848        errno_t rc;
     849        rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     850        if (rc != EOK)
     851                goto err_add_to_cat;
     852
     853        rc = ddf_fun_add_to_category(fun, "pcap");
     854        if (rc != EOK) {
     855                //ddf_msg(LVL_ERROR, "Failed adding function to category pcap");
     856                goto err_add_to_cat;
     857        }
     858        return EOK;
     859
     860err_add_to_cat:
     861        ddf_fun_unbind(fun);
     862        return rc;
     863}
     864
    846865/** @}
    847866 */
  • uspace/lib/pcap/include/pcapctl_dump.h

    r78edb5e r8d9217d  
    5555extern errno_t pcapctl_list(void);
    5656
    57 
    5857#endif
    5958
  • uspace/lib/pcap/src/pcapctl_dump.c

    r78edb5e r8d9217d  
    4545//static service_id_t *pcap_svcs = NULL; ??
    4646
    47 static errno_t str2num(const char* str, size_t* number) {
     47static errno_t str2num(const char *str, size_t *number)
     48{
    4849        size_t num = 0;
    4950        if (*str == 0)
     
    6869}
    6970
    70 static errno_t pcapctl_cat_get_svc(const char *drv_name, service_id_t* svc) {
     71static errno_t pcapctl_cat_get_svc(const char *drv_name, service_id_t *svc)
     72{
    7173        errno_t rc;
    7274        category_id_t pcap_cat;
     
    98100}
    99101
    100 extern errno_t pcapctl_list(void) {
    101 
     102errno_t pcapctl_list(void)
     103{
    102104        errno_t rc;
    103105        category_id_t pcap_cat;
     
    118120        }
    119121
    120         fprintf(stdout, "Services:\n");
     122        fprintf(stdout, "Devices:\n");
    121123        for (unsigned i = 0; i < count; ++i) {
    122124                char *name = NULL;
     
    128130}
    129131
    130 
    131 static errno_t pcapctl_get_name_from_number(const char* svcnum, const char** svcname) {
    132 
     132static errno_t pcapctl_get_name_from_number(const char *svcnum, const char **svcname)
     133{
    133134        errno_t rc;
    134135        category_id_t pcap_cat;
     
    183184                return ENOMEM;
    184185
    185 
    186         const char* svcname;
     186        const char *svcname;
    187187
    188188        rc = pcapctl_get_name_from_number(svcnum, &svcname);
Note: See TracChangeset for help on using the changeset viewer.