[SR-Dev] git:master: Kamailio compatiblity: function to set/get all branch flags

Jan Janak jan at iptel.org
Mon Mar 16 15:06:17 CET 2009


Module: sip-router
Branch: master
Commit: 5a68f95d1068617c2cbd324b56a0f5632db1a70c
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5a68f95d1068617c2cbd324b56a0f5632db1a70c

Author: Jan Janak <jan at iptel.org>
Committer: Jan Janak <jan at iptel.org>
Date:   Mon Mar 16 14:46:51 2009 +0100

Kamailio compatiblity: function to set/get all branch flags

---

 dset.c |   19 +++++++++++++++++++
 dset.h |   22 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/dset.c b/dset.c
index 8c0a555..cbc636b 100644
--- a/dset.c
+++ b/dset.c
@@ -126,6 +126,25 @@ int resetbflag(unsigned int branch, flag_t flag)
 }
 
 
+int getbflags(flag_t* res, unsigned int branch)
+{
+	flag_t* flags;
+	if (res == NULL) return -1;
+	if ((flags = get_bflags_ptr(branch)) == NULL) return -1;
+	*res = *flags;
+	return 1;
+}
+
+
+int setbflagsval(unsigned int branch, flag_t val)
+{
+	flag_t* flags;
+	if ((flags = get_bflags_ptr(branch)) == NULL) return -1;
+	*flags = val;
+	return 1;
+}
+
+
 /*
  * Initialize the branch iterator, the next
  * call to next_branch will return the first
diff --git a/dset.h b/dset.h
index 36ffaff..e350238 100644
--- a/dset.h
+++ b/dset.h
@@ -121,4 +121,26 @@ int resetbflag(unsigned int branch, flag_t flag);
  */
 int isbflagset(unsigned int branch, flag_t flag);
 
+/**
+ * Get the value of all branch flags for a branch
+ *
+ * This function returns the value of all branch flags
+ * combined in a single variable.
+ * @param res A pointer to a variable to store the result
+ * @param branch Number of the branch (0 for the main Request-URI branch)
+ * @return 1 on success, -1 on failure
+ */
+int getbflags(flag_t* res, unsigned int branch);
+
+/**
+ * Set the value of all branch flags at once for a given branch.
+ *
+ * This function sets the value of all branch flags for a given
+ * branch at once.
+ * @param branch Number of the branch (0 for the main Request-URI branch)
+ * @param val All branch flags combined into a single variable
+ * @return 1 on success, -1 on failure
+ */
+int setbflagsval(unsigned int branch, flag_t val);
+
 #endif /* _DSET_H */




More information about the sr-dev mailing list