]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
s/fr_cursor/fr_dcursor/ in dhcpv4/packet.c
authorNick Porter <nick@portercomputing.co.uk>
Sat, 9 Jan 2021 15:00:17 +0000 (15:00 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
src/protocols/dhcpv4/dhcpv4.h
src/protocols/dhcpv4/packet.c

index 01bec54889ebd356df901e647bb63a88853a959b..eeb59afaf7ce0dd5e82e5ca09f2c967a14c0d588 100644 (file)
@@ -170,7 +170,7 @@ ssize_t             fr_dhcpv4_encode_option(fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *
  */
 uint8_t const  *fr_dhcpv4_packet_get_option(dhcp_packet_t const *packet, size_t packet_size, fr_dict_attr_t const *da);
 
-int            fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_cursor_t *cursor, unsigned int *code);
+int            fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_dcursor_t *cursor, unsigned int *code);
 
 int            fr_dhcpv4_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list);
 
index 66def47f1705e44a7ab027c0c89369c045da34e3..f3ec4bd36a5ef9a3d98667d8b537b416689af5d7 100644 (file)
@@ -103,7 +103,7 @@ uint8_t const *fr_dhcpv4_packet_get_option(dhcp_packet_t const *packet, size_t p
        return NULL;
 }
 
-int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_cursor_t *cursor, unsigned int *code)
+int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_dcursor_t *cursor, unsigned int *code)
 {
        size_t          i;
        uint8_t const   *p = data;
@@ -131,8 +131,8 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_c
                        fr_strerror_const_push("Cannot decode packet due to internal error");
                error:
                        talloc_free(vp);
-                       fr_cursor_head(cursor);
-                       fr_cursor_free_list(cursor);
+                       fr_dcursor_head(cursor);
+                       fr_dcursor_free_list(cursor);
                        return -1;
                }
 
@@ -190,14 +190,14 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_c
 
                if (!vp) continue;
 
-               fr_cursor_append(cursor, vp);
+               fr_dcursor_append(cursor, vp);
        }
 
        /*
         *      Loop over the options.
         */
 
-       head = fr_cursor_head(cursor);
+       fr_dcursor_head(cursor);
 
        /*
         *      Nothing uses tail after this call, if it does in the future
@@ -218,8 +218,8 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_c
 
                        len = fr_dhcpv4_decode_option(ctx, cursor, dict_dhcpv4, p, (end - p), NULL);
                        if (len <= 0) {
-                               fr_cursor_head(cursor);
-                               fr_cursor_free_list(cursor);
+                               fr_dcursor_head(cursor);
+                               fr_dcursor_free_list(cursor);
                                return len;
                        }
                        p += len;
@@ -251,8 +251,8 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_c
                                        len = fr_dhcpv4_decode_option(ctx, cursor, dict_dhcpv4,
                                                                      p, end - p, NULL);
                                        if (len <= 0) {
-                                               fr_cursor_head(cursor);
-                                               fr_cursor_free_list(cursor);
+                                               fr_dcursor_head(cursor);
+                                               fr_dcursor_free_list(cursor);
                                                return len;
                                        }
                                        p += len;
@@ -271,8 +271,8 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_c
                                        len = fr_dhcpv4_decode_option(ctx, cursor, dict_dhcpv4,
                                                                      p, end - p, NULL);
                                        if (len <= 0) {
-                                               fr_cursor_head(cursor);
-                                               fr_cursor_free_list(cursor);
+                                               fr_dcursor_head(cursor);
+                                               fr_dcursor_free_list(cursor);
                                                return len;
                                        }
                                        p += len;
@@ -360,7 +360,7 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_c
                fr_value_box_cast(vp, &vp->data, vp->da->type, vp->da, &box);
        }
 
-       fr_cursor_append(cursor, vp);
+       fr_dcursor_append(cursor, vp);
 
        /*
         *      Client can request a LARGER size, but not a smaller