Revision 1772a358 include/AddressRangeIPAM.h

View differences:

include/AddressRangeIPAM.h
32 32
    virtual ~AddressRangeIPAM(){};
33 33

  
34 34
    /* ---------------------------------------------------------------------- */
35
    /* AddressRange Interface **TODO contact IPAM**                           */
35
    /* AddressRange Interface                                                 */
36 36
    /* ---------------------------------------------------------------------- */
37
    int from_vattr(VectorAttribute * attr, std::string& error_msg)
38
    {
39
        error_msg = "Not Implemented";
40
        return -1;
41
    };
42

  
43
    int allocate_addr(unsigned int index, unsigned int size, string& error_msg)
44
    {
45
        error_msg = "Not Implemented";
46
        return -1;
47
    };
48

  
49
    int get_addr(unsigned int& index, unsigned int rsize, string& error_msg)
50
    {
51
        error_msg = "Not Implemented";
52
        return -1;
53
    };
54

  
55
    int free_addr(unsigned int index, string& error_msg)
56
    {
57
        error_msg = "Not Implemented";
58
        return -1;
59
    };
37
    /**
38
     *  Init an Address Range based on a vector attribute.
39
     *    @param attr the description of the AddressRange
40
     *    @param error_msg description if error
41
     *    @return 0 on success
42
     */
43
    int from_vattr(VectorAttribute * attr, std::string& error_msg);
44

  
45
    /**
46
     *  Sets the given range of addresses (by index) as used
47
     *    @param index the first address to set as used
48
     *    @param sz number of addresses to set
49
     *    @param msg describing the error if any
50
     *
51
     *    @return 0 if success
52
     */
53
    int allocate_addr(unsigned int index, unsigned int rsize, string& error_msg);
54

  
55
    /**
56
     *  Gets a range of free addresses
57
     *    @param index the first address in the range
58
     *    @param size number of addresses requested in the range
59
     *    @param msg describing the error if any
60
     *
61
     *    @return 0 if success
62
     */
63
    int get_addr(unsigned int& index, unsigned int rsize, string& error_msg);
64

  
65
    /**
66
     *  Sets the given address (by index) as free
67
     *    @param index of the address
68
     *    @param msg describing the error if any
69
     *
70
     *    @return 0 if success
71
     */
72
    int free_addr(unsigned int index, string& msg);
60 73
};
61 74

  
62 75
#endif

Also available in: Unified diff