summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/l2tp/dict.c5
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.h6
-rw-r--r--accel-pppd/ctrl/l2tp/packet.c7
3 files changed, 11 insertions, 7 deletions
diff --git a/accel-pppd/ctrl/l2tp/dict.c b/accel-pppd/ctrl/l2tp/dict.c
index aaa7da4e..1a507fd6 100644
--- a/accel-pppd/ctrl/l2tp/dict.c
+++ b/accel-pppd/ctrl/l2tp/dict.c
@@ -46,9 +46,10 @@ struct l2tp_dict_attr_t *l2tp_dict_find_attr_by_id(int id)
return NULL;
}
-struct l2tp_dict_value_t *l2tp_dict_find_value(struct l2tp_dict_attr_t *attr, l2tp_value_t val)
+const struct l2tp_dict_value_t *l2tp_dict_find_value(const struct l2tp_dict_attr_t *attr,
+ l2tp_value_t val)
{
- struct l2tp_dict_value_t *v;
+ const struct l2tp_dict_value_t *v;
list_for_each_entry(v, &attr->values, entry) {
switch (attr->type) {
diff --git a/accel-pppd/ctrl/l2tp/l2tp.h b/accel-pppd/ctrl/l2tp/l2tp.h
index 8a8cffdd..d6aed681 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.h
+++ b/accel-pppd/ctrl/l2tp/l2tp.h
@@ -70,11 +70,13 @@ extern int conf_avp_permissive;
struct l2tp_dict_attr_t *l2tp_dict_find_attr_by_name(const char *name);
struct l2tp_dict_attr_t *l2tp_dict_find_attr_by_id(int id);
-struct l2tp_dict_value_t *l2tp_dict_find_value(struct l2tp_dict_attr_t *attr, l2tp_value_t val);
+const struct l2tp_dict_value_t *l2tp_dict_find_value(const struct l2tp_dict_attr_t *attr,
+ l2tp_value_t val);
int l2tp_recv(int fd, struct l2tp_packet_t **, struct in_pktinfo *);
void l2tp_packet_free(struct l2tp_packet_t *);
-void l2tp_packet_print(struct l2tp_packet_t *, void (*print)(const char *fmt, ...));
+void l2tp_packet_print(const struct l2tp_packet_t *,
+ void (*print)(const char *fmt, ...));
struct l2tp_packet_t *l2tp_packet_alloc(int ver, int msg_type, struct sockaddr_in *addr);
int l2tp_packet_send(int sock, struct l2tp_packet_t *);
int l2tp_packet_add_int16(struct l2tp_packet_t *pack, int id, int16_t val, int M);
diff --git a/accel-pppd/ctrl/l2tp/packet.c b/accel-pppd/ctrl/l2tp/packet.c
index c9de3c75..33859562 100644
--- a/accel-pppd/ctrl/l2tp/packet.c
+++ b/accel-pppd/ctrl/l2tp/packet.c
@@ -19,10 +19,11 @@ static mempool_t attr_pool;
static mempool_t pack_pool;
static mempool_t buf_pool;
-void l2tp_packet_print(struct l2tp_packet_t *pack, void (*print)(const char *fmt, ...))
+void l2tp_packet_print(const struct l2tp_packet_t *pack,
+ void (*print)(const char *fmt, ...))
{
- struct l2tp_attr_t *attr;
- struct l2tp_dict_value_t *val;
+ const struct l2tp_attr_t *attr;
+ const struct l2tp_dict_value_t *val;
if (pack->hdr.ver == 2) {
print("[L2TP tid=%u sid=%u", ntohs(pack->hdr.tid), ntohs(pack->hdr.sid));