Browse code

Kamailio compatiblity: function to set/get all branch flags

Jan Janak authored on 16/03/2009 13:46:51
Showing 2 changed files
... ...
@@ -126,6 +126,25 @@ int resetbflag(unsigned int branch, flag_t flag)
126 126
 }
127 127
 
128 128
 
129
+int getbflags(flag_t* res, unsigned int branch)
130
+{
131
+	flag_t* flags;
132
+	if (res == NULL) return -1;
133
+	if ((flags = get_bflags_ptr(branch)) == NULL) return -1;
134
+	*res = *flags;
135
+	return 1;
136
+}
137
+
138
+
139
+int setbflagsval(unsigned int branch, flag_t val)
140
+{
141
+	flag_t* flags;
142
+	if ((flags = get_bflags_ptr(branch)) == NULL) return -1;
143
+	*flags = val;
144
+	return 1;
145
+}
146
+
147
+
129 148
 /*
130 149
  * Initialize the branch iterator, the next
131 150
  * call to next_branch will return the first
... ...
@@ -121,4 +121,26 @@ int resetbflag(unsigned int branch, flag_t flag);
121 121
  */
122 122
 int isbflagset(unsigned int branch, flag_t flag);
123 123
 
124
+/**
125
+ * Get the value of all branch flags for a branch
126
+ *
127
+ * This function returns the value of all branch flags
128
+ * combined in a single variable.
129
+ * @param res A pointer to a variable to store the result
130
+ * @param branch Number of the branch (0 for the main Request-URI branch)
131
+ * @return 1 on success, -1 on failure
132
+ */
133
+int getbflags(flag_t* res, unsigned int branch);
134
+
135
+/**
136
+ * Set the value of all branch flags at once for a given branch.
137
+ *
138
+ * This function sets the value of all branch flags for a given
139
+ * branch at once.
140
+ * @param branch Number of the branch (0 for the main Request-URI branch)
141
+ * @param val All branch flags combined into a single variable
142
+ * @return 1 on success, -1 on failure
143
+ */
144
+int setbflagsval(unsigned int branch, flag_t val);
145
+
124 146
 #endif /* _DSET_H */