Skip to content
  • Thomas Haller's avatar
    platform: separate the refresh-type from the object type · b9ee40b8
    Thomas Haller authored
    Currently, there is a directy one to one relation between
    
     - DELAYED_ACTION_TYPE_REFRESH_ALL_*
    
     - REFRESH_ALL_TYPE_*
    
     - NMP_OBJECT_TYPE_*
    
    For IP addresses, routes and routing policy rules, when we request
    a refresh-all (NLM_F_DUMP), we want to specify the address family.
    
    For addresses and routes that is currently solved by having two
    sets of NMPObject types, for each address family one.
    
    I think that is cumbersome because the implementations of both address
    families are quite similar. By implementing both families as different
    object types, we have a lot of duplicate code and it's hard to see where
    the families actually differ. It would be better to have only one NMPObject
    type, but then when we "refresh-all" such types, we still want to be able
    to dump all (AF_UNSPEC) or only a particular address family (AF_INET, AF_INET6).
    
    Decouple REFRESH_ALL_TYPE_* from NMP_OBJECT_TYPE_* to make that
    possible.
    b9ee40b8