This file is indexed.

/usr/lib/x86_64-linux-gnu/opensips/perl/OpenSIPS/Constants.pm is in opensips-perl-modules 2.2.2-3build4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#
# $Id$
#
# Perl module for OpenSIPS
#
# Copyright (C) 2006 Collax GmbH
#		     (Bastian Friedrich <bastian.friedrich@collax.com>)
#
# This file is part of opensips, a free SIP server.
#
# opensips is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version
#
# opensips is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
#

=head1 OpenSIPS::Constants

This package provides a number of constants taken from enums and defines of
OpenSIPS header files. Unfortunately, there is no mechanism for updating the
constants automatically, so check the values if you are in doubt.

=cut

package OpenSIPS::Constants;

use Exporter;

# Constants from route_struct.h

our @ISA = qw(Exporter);

our @EXPORT;

BEGIN {

	sub const {
		my $c = shift;
		my $v = shift;

		eval "use constant $c => $v";

		push(@EXPORT, $c);
	}

###########################################################
## Unfortunately, there are no "enum"s in Perl. The following blocks reflect
## some C headers from OpenSIPS.
## UPDATE THIS FILE WHEN THESE HEADER FILES CHANGE!

#####################
# From parse_fline.h
	const( SIP_REQUEST	=> 1);
	const( SIP_REPLY	=> 2);
	const( SIP_INVALID	=> 0);

#####################
# From route_struct.h

	const( EXP_T	=> 1);
	const( ELEM_T	=> 2);


	const( AND_OP	=> 1);
	const( OR_OP	=> 2);
	const( NOT_OP	=> 3);


	const( EQUAL_OP	=> 10);
	const( MATCH_OP	=> 11);
	const( GT_OP	=> 12);
	const( LT_OP	=> 13);
	const( GTE_OP	=> 14);
	const( LTE_OP	=> 15);
	const( DIFF_OP	=> 16);
	const( NO_OP	=> 17);


	const( METHOD_O		=> 1);
	const( URI_O		=> 2);
	const( FROM_URI_O	=> 3);
	const( TO_URI_O		=> 4);
	const( SRCIP_O		=> 5);
	const( SRCPORT_O	=> 6);
	const( DSTIP_O		=> 7);
	const( DSTPORT_O	=> 9);
	const( PROTO_O		=> 9);
	const( AF_O		=> 10);
	const( MSGLEN_O		=> 11);
	const( DEFAULT_O	=> 12);
	const( ACTION_O		=> 13);
	const( NUMBER_O		=> 14);
	const( RETCODE_O	=> 15);


	const( FORWARD_T		=> 1);
	const( SEND_T			=> 2);
	const( DROP_T			=> 3);
	const( LOG_T			=> 4);
	const( ERROR_T			=> 5);
	const( ROUTE_T			=> 6);
	const( EXEC_T			=> 7);
	const( SET_HOST_T		=> 8);
	const( SET_HOSTPORT_T		=> 9);
	const( SET_USER_T		=> 10);
	const( SET_USERPASS_T		=> 11);
	const( SET_PORT_T		=> 12);
	const( SET_URI_T		=> 13);
	const( IF_T			=> 14);
	const( MODULE_T			=> 15);
	const( SETFLAG_T		=> 16);
	const( RESETFLAG_T		=> 17);
	const( ISFLAGSET_T 		=> 18);
	const( LEN_GT_T			=> 19);
	const( PREFIX_T			=> 20);
	const( STRIP_T			=> 21);
	const( STRIP_TAIL_T		=> 22);
	const( APPEND_BRANCH_T		=> 23);
	const( REVERT_URI_T		=> 24);
	const( FORCE_RPORT_T		=> 25);
	const( FORCE_LOCAL_RPORT_T	=> 26);
	const( SET_ADV_ADDR_T		=> 27);
	const( SET_ADV_PORT_T		=> 28);
	const( FORCE_TCP_ALIAS_T	=> 29);
	const( FORCE_SEND_SOCKET_T	=> 30);
	const( SERIALIZE_BRANCHES_T	=> 31);
	const( NEXT_BRANCHES_T		=> 32);
	const( RETURN_T			=> 33);
	const( EXIT_T			=> 34);
	const( SWITCH_T			=> 35);
	const( CASE_T			=> 36);
	const( DEFAULT_T		=> 37);
	const( SBREAK_T			=> 38);
	const( SET_DSTURI_T		=> 39);
	const( RESET_DSTURI_T		=> 40);
	const( ISDSTURISET_T		=> 41);


	const( NOSUBTYPE	=> 0);
	const( STRING_ST	=> 1);
	const( NET_ST		=> 2);
	const( NUMBER_ST	=> 3);
	const( IP_ST		=> 4);
	const( RE_ST		=> 5);
	const( PROXY_ST		=> 6);
	const( EXPR_ST		=> 7);
	const( ACTIONS_ST	=> 8);
	const( CMD_ST		=> 9);
	const( MODFIXUP_ST	=> 10);
	const( MYSELF_ST	=> 11);
	const( STR_ST		=> 12);
	const( SOCKID_ST	=> 13);
	const( SOCKETINFO_ST	=> 14);


#####################
# non-enum constants from dprint.h:
# Logging levels
	const( L_ALERT	=> -3);
	const( L_CRIT	=> -2);
	const( L_ERR	=> -1);
	const( L_WARN	=> 1);
	const( L_NOTICE	=> 2);
	const( L_INFO	=> 3);
	const( L_DBG	=> 4);


#####################
# From flags.h:
# Flags for setflag et.al
	const( FL_WHITE		=> 1);
	const( FL_YELLOW	=> 2);
	const( FL_GREEN		=> 3);
	const( FL_RED		=> 4);
	const( FL_BLUE		=> 5);
	const( FL_MAGENTA	=> 6);
	const( FL_BROWN		=> 7);
	const( FL_BLACK		=> 8);
	const( FL_ACC		=> 9);
	const( FL_MAX		=> 10);


#####################
# From db/db_val.h:
# Value types for virtual database classes
	const( DB_INT		=> 0 );
	const( DB_BIGINT	=> 1 );
	const( DB_DOUBLE	=> 2 );
	const( DB_STRING	=> 3 );
	const( DB_STR		=> 4 );
	const( DB_DATETIME	=> 5 );
	const( DB_BLOB		=> 6 );
	const( DB_BITMAP	=> 7 );


#####################
# For VDB call types
	const( VDB_CALLTYPE_FUNCTION_SINGLE	=> 0 );
	const( VDB_CALLTYPE_FUNCTION_MULTI	=> 0 );
	const( VDB_CALLTYPE_METHOD		=> 1 );

}

1;